views:

226

answers:

3

A 3rd party site sends its notifications after my web application has completed some action in order to notify me of its succes. 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 is not giving me anything for the past few hours.

thanks in advance.

A: 

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.

Jonas B
+1  A: 

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.

Eric Petroelje
I have done this and have successfully obtained the stubs. But now I'm kinda lost on how to send a response as I cannot find a sendResponse method or something alike. Is it normal that sendNotification methods are supplied as well in the same wdsl or is this just done using generic methods?
bastijn
+1  A: 

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.

John Saunders
marked as the final answer as it is a little more descriptive and providing links. Indeed WCF was the solution.
bastijn