P. 1


|Views: 153|Likes:
Published by Mahesh

More info:

Published by: Mahesh on May 06, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Simple Object Access Protocol - SOAP SOAP provides a simple and lightweight mechanism for exchanging structured and

typed information between peers in a decentralized, distributed environment using XML. It is a simple protocol that allows you to access an Object on the Net. SOAP can potentially be used in combination with a variety of protocols like HTTP, SMTP and so many other protocols. Parts of SOAP Message SOAP consists of three parts: • • • The SOAP envelope construct defines an overall framework for expressing what is in a message; that should deal with it, and whether it is optional or mandatory. The SOAP encoding rules defines a serialization mechanism that can be used to exchange instances of application-defined data types. The SOAP RPC representation defines a convention that can be used to represent remote procedure calls and responses.

Examples of SOAP Messages In this example, a IsValidUser SOAP request is sent to a CheckUser service. The request takes two string parameters, userid and password, and returns a string result in the SOAP response. The SOAP Envelope element is the top element of the XML document representing the SOAP message. XML namespaces are used to disambiguate SOAP identifiers from application specific identifiers. SOAP Message Embedded in HTTP Request POST /mysamples1/User/CheckUser.asmx HTTP/1.1 SOAPAction: http://tempuri.org/IsValidUser Content-Type: text/xml Content-Length: 448 User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204) Host: muma:8080 Connection: Keep-Alive < ?xml version="1.0"?> < SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapspenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

< SOAP:Body> < IsValidUser xmlns="http://tempuri.org/"> < userid xmlns="http://tempuri.org/">199< /userid> < passwordxmlns="http://tempuri.org/">uma< /password> < /IsValidUser> < /SOAP:Body> < /SOAP:Envelope> SOAP Message Embedded in HTTP Response HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Mon, 12 Feb 2001 05:37:01 GMT Cache-Control: private, max-age=0 Content-Type: text/xml Content-Length: 407 < ?xml version="1.0"?> < soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"> < soap:Body> < IsValidUserResult xmlns="http://tempuri.org/"> < result>true< /result> < /IsValidUserResult> < /soap:Body> < /soap:Envelope>

Relation to XML All SOAP messages are encoded using XML A SOAP application should include the proper SOAP namespace on all elements and attributes defined by SOAP in messages that it generates. A SOAP application MUST be able to process SOAP namespaces in messages that it receives. It MUST discard messages that have incorrect namespaces and it MAY process SOAP messages without SOAP namespaces as though they had the correct SOAP namespaces.

SOAP defines two namespaces • • The SOAP envelope has the namespace identifier http://schemas.xmlsoap.org/soap/envelope/ The SOAP serialization has the namespace identifier http://schemas.xmlsoap.org/soap/encoding/

What SOAP Does? SOAP messages are fundamentally one-way transmissions from a sender to a receiver, but often SOAP messages are combined to implement patterns such as Request/Response. Soap defines an XML structure to call a method and pass that method parameters. Soap also defines an XML structure to return values that were requested. Soap defines an XML structure to return error values (faults) if the service provider cannot execute the requested method. What SOAP doesn’t takes care of The current SOAP1.1 specification doesn’t speak about the following issues. Distributed garbage collection Box carring or batching of messages Objects-by-reference (which requires distributed garbage collection) Activation (which requires objects-by-reference) Advantages of SOAP SOAP provides a platform-independent way to call methods located on diverse distributed systems. Since it uses port number 80, which is the default port number for HTTP, it is Firewall friendly. So unlike other protocols like DCOM, which uses dynamic port it can be caught into firewalls. Since SOAP is XML-based it is lightweight and easy to understand.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->