what are the functionality of http and soap in webservices
Can somebody开发者_Python百科 explain in a simple manner about what exactly happens with http and soap in web services. I was going through http://vijaybalajithecitizen.blogspot.com/2008/11/aspnet-web-services-interview-questions.html ,it describes the soap but what about http, what are the relationship between them When I call a webmethod from a asp.net application , is it a soap/http call...how does it return value. How to detect if it is a soap/http call?
HTTP is the transport mechanism, SOAP is the payload protocol. SOAP can be transferred over other protocols, but HTTP is the most widely used. This is very similar to HTML and HTTP. HTTP is the transport, and HTML is the payload. You could also email an HTML file, which means it's no longer using HTTP.
When you call a webmethod (or any other webservice), it is a "SOAP over HTTP" call. HTTP includes a Content-Type header which is set to "soap+xml". That lets the server know what kind of payload is contained, and how to parse it. I'm not actually sure that ASP.NET webmethods look at that, though. It could just try to parse the HTTP request as SOAP, and error if it doesn't parse. You'd usually only check the Content-Type if you were able to support multiple formats on the same URL.
Values are returned as SOAP formatted messages in the HTTP response. So, instead of sending HTML back, the server sends an XML document in the SOAP format.
HTTP is a transport used to carry SOAP formatted payloads. You can also use TCP to transport SOAP as well, or whatever else might strike your fancy. HTTP is, obviously, the most common transport for the SOAP payload because these things were built for web-based RPC.
精彩评论