简体   繁体   中英

ASP.NET webservices, HTTP, XML and SOAP

ASP.NET webservices use HTTP protocol to send/receive messages.

But the messaging protocol is SOAP

and SOAP makes use of XML.

This is right?

It is right to some extent, but it is not the whole truth!

I don't think that ASP.NET imposes many constraints on what formats you use to send/receive messages when you implement web services. After all, you're still on top of the .NET framework which offers a really wide variety of options.

That being said, HTTP is the application layer protocol used for message transmission with web services. But other protocol might also be used.

SOAP is XML-based, and is a commonly used as format of exchange of structured information. But you can also have REST services (see http://spf13.com/post/soap-vs-rest ) that do not use SOAP. You can even exchange plain text or XML or some private format - it depends on your case.

It really depends on your purpose and the client applications you expect will consume the service. Is this an in-house service where you should follow some obscure internal protocols/formats of communication, or is it a service that has to be accessible from the web and must offer as much compatibility as possible? If it is the latter, go in a standardized manner with SOAP or REST.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM