问题
I'm sorry to ask this question but I have spent hours trying to understand where each one of them fits in in a web service. I just can't wrap my head around what do I need to use to create a web service.
I know that web service can be .Net or Java or PHP based. Say I want to create a web service in .NET using C#. When do SOAP, XML-RPC or JSON come into picture?
Thank you!
回答1:
JSON is a standard to represent human-readable data. It merely represents data, nothing more.
SOAP is a protocol specification for transmiting information and calling web services, and uses XML to encode it. SOAP works over HTTP (amogst other network protocols).
XML-RPC is another protocol, used for transmiting information and calling remote procedures. It doesn't run over HTTP, but is rather a different protocol, different port, etc.
So the main difference between SOAP and XML-RPC that the former wraps inside HTTP, while the latter does not. JSON is something completely different.
来源:https://stackoverflow.com/questions/11270869/what-is-there-difference-between-soap-xml-rpc-json