Introduction Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD
Agenda of KICK-OFF MEETING Introduction Organization of Course Topics Questions & Answers Ericsson Telekommunikation GmbH & Co. KG Ericsson Internal
WEB SERVICES Ericsson Telekommunikation GmbH & Co. KG Ericsson Internal
What is a Web service? Definition: A Web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols. [W3C] 4
Service-oriented Architecture (SOA) Find-bind-and-execute paradigm: Registry Contract Find Register Service Comsumer Bind and Invoke Service Provider 5
Web service properties Reuse existing building blocks of code created by others to assemble and extend them in new ways. These software components are loosely coupled. Web services semantically encapsulate functionality Does not give details about implementation Accessed programmatically Service is triggered and data can be processes by computers on the client side and the service side Distributed over the Internet HTTP over firewall policies 6
7 Engaging a Web Service
STANDARDS THAT ENABLE WEB SERVICES Ericsson Telekommunikation GmbH & Co. KG Ericsson Internal
Web Service Core Standards Simple Object Access Protocol (SOAP) Web service message format Web Services Description Language (WSDL) Web service interface description Universal Description, Discovery, and Integration (UDDI) Web service discovery 10
SOA via Web services Example using the standard protocols UDDI Registry WSDL Find WSDL via UDDI Publish WSDL via UDDI WS Client SOAP / HTTP WS Server 11
SOAP <1/3> Anatomy of a SOAP Message: SOAP envelope SOAP header Header block Header block Header block SOAP body Intermediate Processing: Addressing Routing Security Header block < Body block payload Interaction style: 12 RPC-style: request response Document style: result document has ID
SOAP <2/3> Sample Request: <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body> <QuoteRequest xmlns ="http://myservice.com"> <Items> <Item name="pencil" amount="10"/> <Item name="notepad" amount="10"/> <Item name="eraser" amount="2"/> </Items> </QuoteRequest> </soap:body> </soap:envelope> Quote Request: 10 x pencils 10 x notepads 2 x erasers 13
SOAP <3/3> Sample Request: <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body> <QuoteResponse xmlns ="http://myservice.com"> <Items> <Item name="pencil" prize="0.89"/> <Item name="notepad" prize="3.99"/> <Item name="eraser" prize="1.99"/> </Items> <Order prize="52.78" date="2008-05-01"/> </QuoteResponse> </soap:body> </soap:envelope> Quote Response: 10 x pencils (à.89) 10 x notepads (à 3.99) 2 x erasers (à 1.99) 52.78 14 Delivery: 1st May 08
Web Service Description Language (WSDL) <1/2> WSDL v1.x, interface definition language for Web services Abstract: types: XSD message: input, output, and error messages porttype: logical interface with set of operations Deployed: binding: binds logical interface to a specific set formats and protocols service: specifies the physical endpoints Service Interface (abstract) Service Impl. (concrete) types message porttypes binding service 15
Web Service Description Language (WSDL) <2/2> Characteristics of WSDLs Machine readable Generate Stubs/Skeletons from WDSL and vice versa Two strategies Generated WSDL from code Interoperability problems due to service-specific types WSDL-first Can generate interface code from WSDL WSDL v2.0 Removed the message section Renamed the porttype to interface that directly references types (Several other modifications) 16
The WSDL Document (v1.2) <1/4> 17 <?xml version="1.0"?> <definitions name="stockquote" targetnamespace="http://example.com/stockquote.wsdl" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema targetnamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2000/10/xmlschema"> <element name="tradepricerequest"> <complextype> <all> <element name="tickersymbol" type="string"/> </all> </complextype> </element> <element name="tradeprice"> <complextype> <all> <element name="price" type="float"/> </all> </complextype> </element> </schema> </types> </definitions>
The WSDL Document (v1.2) <2/4> <?xml version="1.0"?> <definitions name="stockquote" > <types> </types> <message name="getlasttradepriceinput"> <part name="body" element="xsd1:tradepricerequest"/> </message> <message name="getlasttradepriceoutput"> <part name="body" element="xsd1:tradeprice"/> </message> <porttype name="stockquoteporttype"> <operation name="getlasttradeprice"> <input message="tns:getlasttradepriceinput"/> <output message="tns:getlasttradepriceoutput"/> </operation> </porttype> <binding> </binding> 18 <service> </service> </definitions>
The WSDL Document (v1.2) <3/4> <definitions name="stockquote" > <types> </types> <message> </message> <porttype> </porttype> <binding name="stockquotesoapbinding" type="tns:stockquoteporttype"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="gettradeprice"> <soap:operation soapaction="http://example.com/gettradeprice"/> <input> <soap:body use="encoded namespace="http://example.com/stockquote" encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="http://example.com/stockquote" encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service> </service> 19 </definitions>
The WSDL Document (v1.2) <4/4> <definitions name="stockquote" > <types> </types> <message> </message> <porttype> </porttype> <binding> </binding> <service name="stockquoteservice"> <documentation>my first service</documentation> <port name="stockquoteport" binding="tns:stockquotebinding"> <soap:address location="http://example.com/stockquote"/> </port> </service> </definitions> 20
Universal Description Discovery and Integration (UDDI) UDDI is used as a discovery service publish Web service descriptions classify Web services search for resource descriptions E.g., publish and find WSDL documents UDDI API: Inquiry-API and Publisher-API 21
References 1. W3C: Web Services Architecture Requirements. http://www.w3.org/tr/wsa-reqs/ 2. W3C: Web Services Architecture. http://www.w3.org/tr/ws-arch/ 3. F. Curbera, A. Nagy, and S. Weerawarana: Web Services: Why and How. 2001. 4. F. Curbera et. al.: Unraveling the Web Services Web. 2002. 22
Organization Abstract + Reference: 14.5. Pre-Versions: 4.6. Reviews for two other papers: 11.6. Feedback meeting: 11.-15.6. Final Versions: 2.7. Presentation: 12.7. (and 13.7.) 23