Soap and WSDL: Satish Gummadelli
Soap and WSDL: Satish Gummadelli
Satish Gummadelli
SOAP
WSDL
Internal
2 © Nokia Siemens Networks Tech Presentation 14.11.07
Why SOAP
Firewall
Internal
3 © Nokia Siemens Networks Tech Presentation 14.11.07
Implications
Vendor Specific
Lack of Interoperability
Internal
4 © Nokia Siemens Networks Tech Presentation 14.11.07
Why XML?
Easily extensible
Internal
5 © Nokia Siemens Networks Tech Presentation 14.11.07
Why HTTP?
Ubiquitous
Internal
6 © Nokia Siemens Networks Tech Presentation 14.11.07
HTTP
Internal
7 © Nokia Siemens Networks Tech Presentation 14.11.07
XML + HTTP = SOAP
Internal
8 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP call anatomy
Internal
9 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Component
SOAP Envelope
SOAP Body
Parameter Data
Internal
10 © Nokia Siemens Networks Tech Presentation 14.11.07
Uses of SOAP
Internal
11 © Nokia Siemens Networks Tech Presentation 14.11.07
Uses of SOAP Skeleton of SOAP Message
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
... ...
</soap:Header>
</soap:Envelope>
Internal
12 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Envelope Element
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
</soap:Envelope>
Internal
13 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Header Element
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">
234
</m:Trans>
</soap:Header>
Internal
14 © Nokia Siemens Networks Tech Presentation 14.11.07
Actor Attribute
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:actor="http://www.w3schools.com/appml/">
234
</m:Trans>
</soap:Header>
Internal
15 © Nokia Siemens Networks Tech Presentation 14.11.07
mustUnderstand Attribute
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">
234
</m:Trans>
</soap:Header>
Internal
16 © Nokia Siemens Networks Tech Presentation 14.11.07
encodingStyle Attribute
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"
Internal
17 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Body Element
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
..messages..
</soap:Body>
</soap:Envelope>
Internal
18 © Nokia Siemens Networks Tech Presentation 14.11.07
Example Message
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
Internal
19 © Nokia Siemens Networks Tech Presentation 14.11.07
Example Response
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
Internal
20 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Fault
Internal
21 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Fault cont..
Internal
22 © Nokia Siemens Networks Tech Presentation 14.11.07
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:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Internal Application Error</faultstring>
<detail xmlns:f=“http://www.a.com/CalculatorFault”>
<f:errorCode>794634</f:errorCode>
<f:errorMsg>Divide by zero</f:errorMsg>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Internal
23 © Nokia Siemens Networks Tech Presentation 14.11.07
Conclusion
Internal
24 © Nokia Siemens Networks Tech Presentation 14.11.07
WSDL Introduction
Internal
25 © Nokia Siemens Networks Tech Presentation 14.11.07
WSDL Introduction
Internal
26 © Nokia Siemens Networks Tech Presentation 14.11.07
Working of WSDL
Internal
27 © Nokia Siemens Networks Tech Presentation 14.11.07
Working of WSDL cont..
Internal
28 © Nokia Siemens Networks Tech Presentation 14.11.07
Working of WSDL cont..
Internal
29 © Nokia Siemens Networks Tech Presentation 14.11.07
Working of WSDL cont..
Internal
30 © Nokia Siemens Networks Tech Presentation 14.11.07
Namespace
Internal
31 © Nokia Siemens Networks Tech Presentation 14.11.07
Service
Internal
32 © Nokia Siemens Networks Tech Presentation 14.11.07
Port
Internal
33 © Nokia Siemens Networks Tech Presentation 14.11.07
Message
Internal
34 © Nokia Siemens Networks Tech Presentation 14.11.07
Message cont..
Internal
35 © Nokia Siemens Networks Tech Presentation 14.11.07
Operations and Port Type
Internal
36 © Nokia Siemens Networks Tech Presentation 14.11.07
Operations and Port Type
Internal
37 © Nokia Siemens Networks Tech Presentation 14.11.07
Binding
Internal
38 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Binding
</binding>
Internal
39 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Binding cont..
<soap:body> - Specifies how the message parts appear inside the SOAP
Body element
<input>
<soap:body parts=“nmtokens”? use=“literal|encoded”?
encodingStyle=“uri-list”? Namespace=“uri”?>
</input>
<soap:fault> - Specifies the contents of the contents of the SOAP fault
<fault>
<soap:fault name=“nmtoken” use=“literal|encoded” encodingStyle=“uri-
list”? Namespace=“uri”?>
</fault>
Internal
40 © Nokia Siemens Networks Tech Presentation 14.11.07
SOAP Binding cont..
Internal
41 © Nokia Siemens Networks Tech Presentation 14.11.07
References
DevXpert
http://www.devxpert.com/tutors/wsdl/wsdlprint.asp
Internal
42 © Nokia Siemens Networks Tech Presentation 14.11.07