Wednesday, 18 June 2014

Difference Between SOAP and Web API?

 SOAP WEB API
SizeHeavy weight because of complicated WSDL structure.Light weight, only the necessary information is transferred.
ProtocolIndependent of protocols.Only  for HTTP protocol
FormatsTo parse SOAP message, the client needs to understand WSDL format. Writing custom code for parsing WSDL is a heavy duty task. If your client is smart enough to create proxy objects like how we have in .NET (add reference) then SOAP is easier to consume and call.Output of “WebAPI” are simple string message,JSON,Simple XML format etc. So writing parsing logic for the same in very easy.
PrinciplesSOAP follows WS-* specification.WEB API follows REST principles. (Please refer about REST in WCF chapter).
WCF was brought in to implement SOA, never the intention was to implement REST.
"WebAPI'" is built from scratch and the only goal is to create HTTP services using REST. Due to the one point focus for creating “REST” service “WebAPI” is more preferred.