introduction to wsdl presented by xiang fu. source wsdl 1.1 specification wsdl 1.1 specification –...

21
Introduction to WSDL Introduction to WSDL presented presented by Xiang Fu by Xiang Fu

Upload: eddy-clutter

Post on 14-Jan-2016

247 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

Introduction to WSDLIntroduction to WSDL

presentedpresented by Xiang Fu by Xiang Fu

Page 2: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

SourceSource

• WSDL 1.1 specificationWSDL 1.1 specification– http://www.w3.org/TR/wsdlhttp://www.w3.org/TR/wsdl

• WSDL 1.2 working draftWSDL 1.2 working draft– http://www.w3.org/TR/wsdl12/http://www.w3.org/TR/wsdl12/

• W3C School TutorialW3C School Tutorial– http://www.w3schools.com/wsdl/wsdl_intro.asphttp://www.w3schools.com/wsdl/wsdl_intro.asp

Page 3: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

What is WSDLWhat is WSDL

• WWeb eb SService ervice DDescription escription LLanguage.anguage.• An XML language used to An XML language used to describedescribe and and locatelocate web services. web services.– Written in XML.Written in XML.– Describe functionality of a web serviceDescribe functionality of a web service– Specify how to access the service (binding Specify how to access the service (binding

protocol, message format, and etc.)protocol, message format, and etc.)• Not a W3C standard yet.Not a W3C standard yet.

– Version Version 1.11.1 released March 2001 released March 2001– Working draft of Version 1.2 released July 2003Working draft of Version 1.2 released July 2003

Page 4: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

Related StandardsRelated Standards

• Type System: XML SchemaType System: XML Schema

• Name space: XML namespacesName space: XML namespaces

• Binding: SOAP, HTTP, MIME and etc.Binding: SOAP, HTTP, MIME and etc.

Page 5: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

The Main Structure of WSDLThe Main Structure of WSDL

<definition <definition namespacenamespace = “http/… “> = “http/… “><<typetype> xschema types </type>> xschema types </type><<messagemessage> … </message>> … </message><<portport> a set of operations </port>> a set of operations </port><<bindingbinding> communication protocols </binding>> communication protocols </binding><<serviceservice> a list of binding and ports </service>> a list of binding and ports </service>

<definition><definition>

Page 6: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

TypesTypes

• <types> define types used in <types> define types used in message declarationmessage declaration

• XML Schema, DTD, and etc.XML Schema, DTD, and etc.

• XML Schema must be supported by XML Schema must be supported by any vendor of WSDL conformant any vendor of WSDL conformant products.products.

Page 7: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

<types> <types> <schema <schema

targetNamespace="http://example.com/stockquote.xsd" targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/XMLSchema"> xmlns="http://www.w3.org/2000/10/XMLSchema">

<element name="<element name="TradePriceRequestTradePriceRequest"> "> <complexType> <complexType> <<allall> > <element name="<element name="tickerSymboltickerSymbol" type="string“" type="string“ minOccurminOccur = “1” = “1” maxOccurmaxOccur=“10”/> =“10”/> <element name = “payment”><element name = “payment”> <complexType> <<complexType> <choicechoice>> <element name = “<element name = “accountaccount” type=“string”>” type=“string”> <element name = “<element name = “creditcardcreditcard” ”

type=“string”>type=“string”> </</choicechoice> </complexType>> </complexType> </element></element> </</allall> > </complexType> </complexType> </element> </element> </schema> </schema> </types> </types>

Page 8: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

WSDL MessagesWSDL Messages

• The The <message><message> element defines the element defines the data elements of an operation.data elements of an operation.

• Each messages can consist of one or more Each messages can consist of one or more parts. The parts can be compared to the parts. The parts can be compared to the parameters of a function call in a parameters of a function call in a traditional programming language.traditional programming language.

Page 9: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

<message name="GetLastTradePriceInput"> <part name="body" element="TradePriceRequest"/>

</message>

<message name="GetLastTradePriceOutput"> <part name="body" element="TradePrice"/>

</message>

Page 10: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

WSDL PortsWSDL Ports

• The The <portType><portType> element is the most important element is the most important WSDL element. WSDL element.

• It defines It defines a web servicea web service, the , the operationsoperations that can that can be performed, and the be performed, and the messagesmessages that are that are involved.involved.

• The <The <portport> defines the connection point to a web > defines the connection point to a web service, an instance of <service, an instance of <portTypeportType>. >.

• It can be compared to a function library (or a It can be compared to a function library (or a module, or a class) in a traditional programming module, or a class) in a traditional programming language. Each operation can be compared to a language. Each operation can be compared to a function in a traditional programming language.function in a traditional programming language.

Page 11: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

<portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation> </portType>

Page 12: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

Operation TypesOperation Types

• The request-response type is the most common The request-response type is the most common operation type, but WSDL defines four types:operation type, but WSDL defines four types:

• One-way: The operation can receive a message but will not return a response

• Request-response:The operation can receive a request and will return a response

• Solicit-response:The operation can send a request and will wait for a response

• Notification:The operation can send a message but will not wait for a response

• -- v 1.2 additionrequest – multiple response …

Page 13: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

One way and Notification One way and Notification ExampleExample

<portType name=“RegisterPort"> <operation name=“register"> <input name=“customerInfo" message=“RegInfo"/> </operation>

<operation name = “register Response”> <output name = “response” message=“ResponseInfo”/> </operation></portType >

Page 14: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

BindingBinding

• Binding defines how message are Binding defines how message are transmitted, and the location of the transmitted, and the location of the service.service.

Page 15: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetLastTradePrice"> <soap:operation soapAction="http://example.com/GetLastTradePrice"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding>

Page 16: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

<service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location="http://example.com/stockquote"/> </port> </service>

Page 17: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

WSDL and UDDIWSDL and UDDI

• Description of web service.Description of web service.

• Discovery of web service?Discovery of web service?

• UDDI – yellow page.UDDI – yellow page.

Page 18: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

What is UDDIWhat is UDDI

• UDDI is a platform-independent framework for UDDI is a platform-independent framework for describing services, discovering businesses, and describing services, discovering businesses, and integrating business services by using the integrating business services by using the Internet. Internet.

• UDDI stands for UDDI stands for UUniversal niversal DDescription, escription, DDiscovery iscovery and and IIntegration ntegration

• UDDI is a directory for storing information about UDDI is a directory for storing information about web services web services

• UDDI is a directory of web service interfaces UDDI is a directory of web service interfaces described by WSDL described by WSDL

Page 19: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

How can UDDI be UsedHow can UDDI be Used

• If the industry published an UDDI If the industry published an UDDI standardstandard for for flight rate checking and reservation, airlines could flight rate checking and reservation, airlines could register their services into an UDDI directory. register their services into an UDDI directory.

• Travel agencies could then search the UDDI Travel agencies could then search the UDDI directory to find the airline's reservation interface. directory to find the airline's reservation interface.

• When the interface is found, the travel agency can When the interface is found, the travel agency can communicate with the service immediately communicate with the service immediately because it uses a well-defined reservation because it uses a well-defined reservation interface. (by WSDL)interface. (by WSDL)

Page 20: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

What’s missing?What’s missing?

Quality of service. (how fast, how reliable?) Quality of service. (how fast, how reliable?) Smart Searching (currently business code Smart Searching (currently business code

match)match)• DAML-S project. DAML-S project.

– DARPA Agent Markup Language for web Services.DARPA Agent Markup Language for web Services.• Describes control flowDescribes control flow• Quality of service.Quality of service.• Support smart discovery of serviceSupport smart discovery of service

– Ontology based technology.Ontology based technology.• A big dictionary defining the relations between concepts.A big dictionary defining the relations between concepts.

e.g. vehicle – car – truck …e.g. vehicle – car – truck …

Page 21: Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL

ProblemsProblems

• Complex long running web services.Complex long running web services.

• Communication infrastructure –Communication infrastructure –– Asynchronous communicationAsynchronous communication

• Analysis and verificationAnalysis and verification

• Automatic composition of complex Automatic composition of complex services.services.

… …