Building Blocks in Web Services: SOA, SOAP, WSDL


This presentation, part 2 of Presentation 7 from Ingeniørhøjskolen i Aarhus, covers the building blocks of web services, including
- Uploaded on | 0 Views
-
warinder
About Building Blocks in Web Services: SOA, SOAP, WSDL
PowerPoint presentation about 'Building Blocks in Web Services: SOA, SOAP, WSDL'. This presentation describes the topic on This presentation, part 2 of Presentation 7 from Ingeniørhøjskolen i Aarhus, covers the building blocks of web services, including. The key topics included in this slideshow are . Download this presentation absolutely free.
Presentation Transcript
Slide1Presentation 7 part 2:SOAP & WSDL
Slide2Ingeniørhøjskolen i ÅrhusSlide 2 Outline • Building blocks in Web Services SOA • SOAP • WSDL • (UDDI)
Slide3Ingeniørhøjskolen i ÅrhusSlide 3 Service-Oriented Architecture (SOA) Client Client Server Server Registry Registry Abstract Architecture - Web service stack Abstract Architecture - Web service stack Legacy code on server Legacy code on server 1 1 2 2 3 3 Opening up for doing business (the sharing of objects) on the Internet
Slide4Ingeniørhøjskolen i ÅrhusSlide 4 Technologies for Implementing SOA SOAP for communication SOAP for communication WSDL for contract & binding WSDL for contract & binding UDDI & WSDL for registration & discovery UDDI & WSDL for registration & discovery
Slide5Ingeniørhøjskolen i ÅrhusSlide 5 What is SOAP? • Simple Object Access Protocol • Wire protocol similar to – IIOP for CORBA – JRMP for RMI • XML is used for data encoding – “text” based protocol vs. “binary” protocol • Supports XML-based RPC
Slide6Ingeniørhøjskolen i ÅrhusSlide 6 What is Not SOAP? • Not a component model – So it will not replace objects and components, i.e. EJB, JavaBeans and .NET • Not a programming language – So it will not replace Java, C# og C++ • Not a solution for all – So it will not replace other distributed computing technologies such as RMI and CORBA
Slide7Ingeniørhøjskolen i ÅrhusSlide 7 Where is SOAP? • W3C XML Protocol working group – SOAP 1.2 current version: http://www.w3.org/TR/soap12/ • Microsoft, SUN, Oracle, HP, IBM all support the W3C recommendation – but there are still differences to be overcome – security issues, transactions etc.
Slide8Ingeniørhøjskolen i ÅrhusSlide 8 What does SOAP define? • Message Envelope • Encoding Rules • RPC Convention • Binding with underlying protocols – HTTP (which we will use in this course) – SMTP – FTP and others
Slide9Ingeniørhøjskolen i ÅrhusSlide 9 SOAP Message Format Possible to Attach binaries (images, cryptographic material) to attachments Possible to Attach binaries (images, cryptographic material) to attachments
Slide10Ingeniørhøjskolen i ÅrhusSlide 10 SOAP Message Envelope • Encoding information • Header – Optional – Could contain context knowledge • Security • Transaction • Body – RPC methods and parameters – Contains application data
Slide11Ingeniørhøjskolen i ÅrhusSlide 11 Two types of communication
Slide12Ingeniørhøjskolen i ÅrhusSlide 12 SOAP RPC Request Example <SOAP-ENV:Envelope xmlns:SOAP-ENV="…" SOAP-ENV:encodingStyle="…"> <SOAP-ENV:Header> <!-- Optional context information --> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m=“some_URI"> <tickerSymbol>SUNW</tickerSymbol> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Slide13Ingeniørhøjskolen i ÅrhusSlide 13 SOAP RPC Response Example <SOAP-ENV:Envelope xmlns:SOAP-ENV="…" SOAP-ENV:encodingStyle="…"> <SOAP-ENV:Header> <!-- Optional context information --> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m=“some_URI"> <price>30.5</price> </m:GetLastTradePriceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Slide14Ingeniørhøjskolen i ÅrhusSlide 14 SOAP RPC composition I • Information needed for a method call: 1. The URI of the target object (marked with red) • <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m=“http://stocks.com/StockQuotes"> <tickerSymbol>SUNW</tickerSymbol> </m:GetLastTradePrice> </SOAP-ENV:Body>
Slide15Ingeniørhøjskolen i ÅrhusSlide 15 SOAP RPC composition II • Information needed for a method call: 1. The URI of the target object 2. The Method Name <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m=“http://stocks.com/StockQuotes"> <tickerSymbol>SUNW</tickerSymbol> </m:GetLastTradePrice> </SOAP-ENV:Body>
Slide16Ingeniørhøjskolen i ÅrhusSlide 16 SOAP RPC composition III • Information needed for a method call: 1. The URI of the target object 2. The Method Name 3. Parameters 4. Binding protocol (next slide) <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m=“http://stocks.com/StockQuotes"> <tickerSymbol>SUNW</tickerSymbol> </m:GetLastTradePrice> </SOAP-ENV:Body> Name is not important Name is not important
Slide17Ingeniørhøjskolen i ÅrhusSlide 17 SOAP RPC composition IV: complete SOAP RPC Request POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: "Some-URI" <SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/encoding" SOAP-ENV:encodingStyle=”http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m=" http://stocks.com/StockQuotes "> <tickerSymbol>SUNW</tickerSymbol> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Envelope> HTTP HTTP Encoding Encoding Name- space Name- space STEP 4: BINDING TO PROTOCOL STEP 4: BINDING TO PROTOCOL
Slide18Ingeniørhøjskolen i ÅrhusSlide 18 Request to HelloWorld.jws Input parameters type string Input parameters type string HTTP Post Call HTTP Post Call HTTP Host Target HTTP Host Target Method name Method name
Slide19Ingeniørhøjskolen i ÅrhusSlide 19 … and the HTTP Response from Server HTTP Response HTTP Response Method Response Method Response Parameter value Parameter value Parameter name Parameter name Apache Tomcat Server Responding Apache Tomcat Server Responding
Slide20Ingeniørhøjskolen i ÅrhusSlide 20 Issues with SOAP • Issues with SOAP – Lack of business semantics – Insufficient functionality for business operations – Security – Reliability – Under development • Low performance
Slide21Ingeniørhøjskolen i ÅrhusSlide 21 WSDL • WSDL is used for describing WebServices
Slide22Ingeniørhøjskolen i ÅrhusSlide 22 What is WSDL? • XML language for describing web services • Web service is described as – A set of communication endpoints (ports) • Endpoint is made of – Abstract definitions of operations and messages – Concrete binding to networking protocol and message format
Slide23Ingeniørhøjskolen i ÅrhusSlide 23 Why WSDL? • Enables automation of communication details between communicating partners – Machines can read WSDL – Machines can invoke a service defined in WSDL • Note that WSDL defines only low-level aspects of Web services, however other technologies might follow … – Security – Transactions – Persistency
Slide24Ingeniørhøjskolen i ÅrhusSlide 24 WSDL Document Example • Simple service providing stock quotes • A single operation called GetLastTradePrice • Deployed using SOAP 1.1 over HTTP • Request takes a ticker symbol of type string • Response returns price as a float
Slide25Ingeniørhøjskolen i ÅrhusSlide 25 WSDL Elements • Types – Data type definitions – Used to describe exchanged messages – Uses W3C XML Schema as canonical type system
Slide26Ingeniørhøjskolen i ÅrhusSlide 26 WSDL Elements • Messages – Abstract, typed definitions of data being exchanged • Operations – Abstract description of an action – Refers to input and output messages • Port type – Collection of operations – Resembles a Class in OOPL
Slide27Ingeniørhøjskolen i ÅrhusSlide 27 WSDL Elements • Binding – Concrete protocol and data format for a particular Port type – Example: SOAP 1.1, HTTP, MIME • Port – Defines a single communication endpoint – Address for binding – URL for HTTP, email address for SMTP • Service – Aggregate set of related ports
Slide28Ingeniørhøjskolen i ÅrhusSlide 28 HelloWorld.jws?wsdl
Slide29Ingeniørhøjskolen i ÅrhusSlide 29 Tools • Generate WSDL document from – existing Java classes or EJB components – AXIS: Java2WSDL • Generate SOAP messages from – WSDL document (via client stub and server skeleton) • JAX-RPC – Part of J2EE from Sun (needs AS) • IDE Tools: – NetBeans, Eclipse, Forte for Java, JBuilder, JDeveloper • Microsoft: – IIS for services and Visual Studio for IDE
Slide30Ingeniørhøjskolen i ÅrhusSlide 30 UDDI • UDDI for publishing & discovery – the SOA
Slide31Ingeniørhøjskolen i ÅrhusSlide 31 UDDI • Universel Descrition, Discovery & Integration • UDDI defines a scheme to publish and discover information about Webservices • Programmatic registration and discovery business entities and their Webservices • Based on SOAP, HTTP, XML • Registry data – Business registrations – Service type definitions
Slide32Ingeniørhøjskolen i ÅrhusSlide 32 Registration • “ White pages” – Address, contact, and known identifiers • “ Yellow pages” – industrial categorizations – Industry: NAICS (Industry codes - US Govt.) – Product/Services: UN/SPSC (ECMA) – Location: Geographical taxonomy • “ Green pages” – technical information about services
Slide33Ingeniørhøjskolen i ÅrhusSlide 33 What uses UDDI? • Tool building client (Service Consumer) – Browse or search registry – Create a service proxy • Tool publishing the service – Generates WSDL – Construct UDDI entries • Application that needs dynamic binding – Directly access UDDI – Query can be pre-generated