Download presentation
Presentation is loading. Please wait.
Published byEdward Lawson Modified over 9 years ago
1
.NET and SOAP An Overview of SOAP By Raghavendra Aekka
2
Overview Introduction SOAP Message format SOAP Request SOAP response SOAP Data types SOAP-HTTP binding SOAP-RPC SOAP Fault Element Conclusion
3
Introduction SOAP is an XML-based protocol for exchanging information between computers. Primary focus of SOAP is Remote Procedure Calls transported via HTTP. SOAP is platform and language independent as it is entirely written in XML. For example, a SOAP Java client running on Linux or a Perl client running on Solaris can connect to a Microsoft SOAP server running on Windows 2000
4
SOAP Contains Four Parts: The SOAP envelope construct Defines an overall framework to express what is in a message, who 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 datatypes. The SOAP RPC representation Defines a convention that can be used to represent remote procedure calls and responses. The SOAP binding Defines a convention to exchange SOAP envelopes between peers using an underlying protocol for transport.
5
SOAP Message Format
6
SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/ SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/”> 345 3 4
7
SOAP Response <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ ”> 345 7
8
SOAP Data types Types are either simple (scalar) or compound which is a composite of several parts Simple Type A "simple type" is a class of simple values SOAP uses all the types found in the section "Built-in data types" of XML Schema A simple value is represented as character data, that is, without any sub-elements
9
Simple Type Example
10
Compound type A “compound” type is a class of compound values Each related value is potentially distinguished by a role name, ordinal or both (accessor) Supports traditional types like structs and arrays Struct Type A compound value in which accessor name is the only distinction among member values, and no accessor has the same name as any other William Shakespeare The Tempest
11
Array type A compound value in which ordinal position serves as the only distinction among member values. Apple 1.56 Peach 1.48
12
SOAP-HTTP A binding of SOAP to a transport protocol is a description of how a SOAP message is to be sent using that transport protocol The typical binding for SOAP is HTTP SOAP can use GET or POST. With GET, the request is not a SOAP message but the response is a SOAP message, with POST both request and response are SOAP messages SOAP uses the same error and status codes as those used in HTTP so that HTTP responses can be directly interpreted by a SOAP module.
13
HTTP Request POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: "GetLastTradePrice“ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > DIS
14
HTTP Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: nnnn <SOAP-ENV:Envelope xmlns:SOAP-ENV= "http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle= “http://schemas.xmlsoap.org/soap/encoding/"/> 34.5
15
SOAP-RPC SOAP messages are basically one-way transmissions from a sender to a receiver. However they are often combined to implement request/response mechanisms. A few conventions must be followed to do RPC using SOAP Areduced, RPC-based view of the SOAP message. Only the body portions of the SOAP request and response envelopes are shown.
16
Request DEF Response 22.50
17
SOAP Fault Element Used to carry error and/or status information within a SOAP message Appears within the SOAP body Defines the following: faultcode (mandatory) algorithmic mechanism for identifying the fault defined in the SOAP spec Faultstring (mandatory) human readable explanation of the fault
18
SOAP Fault… faultactor (optional) information about who caused the fault to happen URI value identifying the source Detail error information related only to the Body element. If not present then indicates that the fault is not related to the Body element.
19
SOAP Fault example <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP- ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/” > SOAP-ENV:Server Internal Application Error 794634 Divide by zero
20
SOAP Implementations Apache SOAP Open source, based on IBM SOAP4J Microsoft SOAP toolkit COM implementation, for COM-compliant languages SOAP::Lite for Perl
21
Conclusion SOAP provides a basic mechanism for: encapsulating messages into an XML document. mapping the XML document with the SOAP message into an HTTP request. transforming RPC calls into SOAP messages. SOAP takes advantage of the standardization of XML to resolve problems of data representation and serialization.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.