How to use SOAP in asp.net mvc

人盡茶涼 提交于 2019-12-18 06:23:42

问题


A 3rd party site sends its notifications after my web application has completed some action in order to notify me of its success. Receiving a notification item requires a response back to the 3rd party server (URL) with the a containing the value "accepted".

I have never user SOAP and with the basic info found I'm a bit lost for the case of asp.net mvc. Are there any good links showing the principle of receiving and sending SOAP responses?

Tutorials / information may be presented in other languages such as java, asp.net (classic) or something. I need to get a general idea since googling on SOAP has not given me anything for the past few hours.


回答1:


You need to learn a little about WCF. See the WCF Developer Center, especially the Beginners Guide.

What you want is to create a simple WCF service that corresponds to the WSDL that they will give you. You will need to implement only the operation (method) that they will call to notify you. You can host a WCF service in IIS along with the rest of your application.

The issue will be how to correlate the notifications with the page you're on in your MVC application.




回答2:


I don't think this is specific to ASP.NET MVC really. If you have a WSDL for their web service, just use that to generate stub classes using either wsdl.exe or by adding a web reference to your project, then call the web service from your controller.




回答3:


If I remember correctly SOAP is basically xml requests and responses. You might want to look into WSDL (Web Service Definition Language) to avoid having to deal with raw data, and you would likely find a great deal of tutorials on wsdl as well.



来源:https://stackoverflow.com/questions/2715914/how-to-use-soap-in-asp-net-mvc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!