What is HTTP SOAP and how does it differ from HTTP POST as far as Web Services in ASP.Net are concerned?
To get an answer to the question, one must first have an understanding of the HTTP Protocol - how does it work.
HTTP Protocol allows, among other methods, two most widely methods - GET and POST. You may consider them as the commands given to the server to perform specific tasks.
Associated with every command given by the client is a set of headers that follows the command and optionally some data that is sent for further parsing. This data can be username and password using which you logon to your favourite webmail or it can be the contents of the file that you upload.
When you go to a website by typing a URL in the browser, the browser sends a GET command to the server. A sample data sent by the browser to the server may be:
GET / HTTP/1.1
Host: http://www.edujinionline.com
Connection: close
GET command consists of just two parts -- a line containing the command and optionally a set of headers following thereafter.
Similar to GET is the command POST. POST command has three parts -- a line containing the command, a set of headers and data to be sent to the server. A sample POST command may look like:
POST /SomePage HTTP/1.1
Host: http://www.edujinionline.com
Content-Type: application/x-www-url-encoded
Content-Length: 33
Connection: close
username=edujini&password=online
OR
POST /SomePage HTTP/1.1
Host: http://www.edujinionline.com
Content-Type: multipart/form-data;
boundary=--EduJiniOnlineBndry
Content-Length: Some-Length
Connection: close
--EduJiniOnlineBndry
Some Data
--EduJiniOnlineBndry--
For the server to be able to parse the contents after the headers correctly, one must send at least two headers Content-Length indicating the number of bytes of the content (after headers) and Content-Type providing the type of the content.
When you submit a form, the content-type would generally by application/x-www-url-encoded and when you upload a file it must be multipart/form-data
When one works with SOAP-based Web Services on HTTP Protocol, the Content-Type must be text/xml and nothing else.
Enabling HTTP-POST for the Web Services means that one can connect to a URL like http://www.edujinionline.com/WebService.asmx?op=Op1, submit the form (automatically generated by the engine) and get the results back (in XML format).
Enabling HTTP-SOAP for the Web Services means that one can connect to the URL (http://www.edujinionline.com/WebService.asmx) using the POST method and using the content type as 'text/xml' and providing the content (after headers) as the SOAP-Message and expect a SOAP-Message in response.
Still unable to figure the what's the difference between HTTP-POST and HTTP-SOAP... drop in a comment and we shall get back to you.