views:

230

answers:

2

I was going through this link below:

http://support.microsoft.com/kb/819267

Here it explains to enable HTTP GET/POST calls for web service, for calling a service directly through the browser.

Questions:

  1. While calling through browser are we using GET or POST? How it gets decided?

  2. If we are using regular HTTP GET/POST instead of SOAP, where does SOAP comes in? Or is it wrong to say that web services always use SOAP protocol for sending receiving messages?

+2  A: 
  1. If you're passing all parameters through the query string of the URL, then you're using GET. If you're building the request using something Fiddler to explicitly use POST, then you're using POST.

  2. If you're using GET/POST with .NET Web Services, SOAP doesn't come in to the picture at all. You'll also notice that as your service gets more complex, you lose the ability to call the Service through GET/POST because the complexity of SOAP is needed to wrap the data.

Justin Niessner
+1. Thanks Justin. So now I understand that we can call service through HTTP GET and POST too but SOAP is a standard way as most of the options, security, etc will not be available through basic HTTP calls.
noob.spt
+2  A: 
  1. If the request you are making has a payload/request body then a POST request will be used.

  2. The SOAP protocol defines the type of message that is sent, typically as the body of an HTTP POST request or the body of an HTTP response. Not all web services use SOAP, although rightly or wrongly it has become the de facto standard.

Andy
He's referring to calling the Web Services using the special HttpPost and HttpPost protocol options available in .NET 1.1 and 2.0 which allowed calling the services without any SOAP formatting.
Justin Niessner
Thanks Andy. Could you tell more about what do you mean by "payload"?
noob.spt
Sorry, just the data in the body of the HTTP request, so in this case that would be the SOAP message.
Andy
Got it!.. Thanks for help :).
noob.spt