Upload
clara-warren
View
221
Download
3
Embed Size (px)
Citation preview
Establishing a foundation for web services
Establishing a foundation for web services
Ashraf MemonAshraf Memon
2
Overview
• SOAP 101
• WSDL 101
3
SOAP 101
• SOAP stands for Simple Object Access Protocol • SOAP is a communication protocol • SOAP is for communication between applications • SOAP is a format for sending messages • SOAP is designed to communicate via Internet • SOAP is platform independent • SOAP is language independent • SOAP is based on XML • SOAP is simple and extensible
4
<?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:Body> ... ...
<soap:Fault> ... ... </soap:Fault>
</soap:Body></soap:Envelope>
SOAP Skeleton
Soap Body
SOAP Envelope
SOAP Header
Parameters
SOAP Body
5
Example Soap Request
<?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 xmlns:m="http://www.stock.org/stock"> <m:GetStockPrice>
<m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body>
</soap:Envelope>
6
Example Soap 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 xmlns:m="http://www.stock.org/stock">
<m:GetStockPriceResponse> <m:Price>34.5</m:Price>
</m:GetStockPriceResponse> </soap:Body>
</soap:Envelope>
7
WSDL 101
• WSDL stands for Web Services Description Language
• WSDL is written in XML
• WSDL is an XML document
• WSDL is used to describe Web services
• WSDL is also used to locate Web services
8
WSDL Elements
Element Defines<portType> The operations performed by the web service<message> The messages used by the web service<types> The data types used by the web service<binding> The communication protocols used by the web
service
A WSDL document describesWhat the service can doWhere it residesHow to invoke it
9
WSDL Skeleton
<definitions>
<types> definition of types........ </types> <message> definition of a message.... </message>
<portType> definition of a port....... </portType>
<binding> definition of a binding.... </binding>
</definitions>
10
WSDL Example
<message name="getTermRequest"> <part name="term" type="xs:string"/></message><message name="getTermResponse"> <part name="value" type="xs:string"/></message><portType name="glossaryTerms"> <operation
name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation></portType>
11
Next Chapter
• Creating Web Service