cs info 330 web driven web applications
play

CS/INFO 330: Web Driven Web Applications Web Services Definition: - PowerPoint PPT Presentation

CS/INFO 330: Web Driven Web Applications Web Services Definition: Web Services A standardized way of integrating Web- based applications, using XML to tag data SOAP to transport data Simple Object Access Protocol WSDL to


  1. CS/INFO 330: Web Driven Web Applications Web Services

  2. Definition: Web Services • A standardized way of integrating Web- based applications, using • XML to tag data • SOAP to transport data • Simple Object Access Protocol • WSDL to describe available services • Web Services Description Language • An Interface Description Language (IDL) • UDDI to list available services • Universal Description, Discovery and Integration

  3. Goals for B2B Integration • Service-Oriented Architecture • Redesign of middleware protocols • Standardization

  4. Service-Oriented • Service: procedure, method, or object with stable published interface • Functionality always exposed as services • Loosely coupled • Invoked by programs as well as users

  5. Middleware Redesign • Peer-to-Peer • No central coordinator • Between trust domains • Compatibility with Internet

  6. Web Services Integrating Between Companies languages and protocols standardized, eliminating need for customer many different middleware infrastructures (need only the Web supplier Web services middleware) service Web service internal procurement requests internal internal infrastructure infrastructure interactions based on protocols Web redesigned for peer to peer and service B2B settings internal internal functionality made infrastructure available as a service warehouse

  7. Basic Web Services • Components: • communicate (SOAP) • describe services - IDL (WSDL) • directory service (UDDI)

  8. Minimalist Infrastructure ... service provider service requestor application object application object (service provider) (client) SOAP-based SOAP-based middleware middleware SOAP messages exchanged on top of, HTTP, SMTP, or other transport converts procedure calls to/ from XML messages sent through HTTP or other protocols.

  9. Using WSDL Specification <operation name="orderGoods"> WSDL of service <input message = "OrderMsg"/ > provider </ operation> WSDL compiler WSDL compiler (client side) (server side) service requestor service provider application object application object (service provider) (client) skeleton stub SOAP-based SOAP-based middleware middleware SOAP messages Note all WSDL “processing” happens at development time.

  10. Using UDDI Registry service requestor service provider application object application object (client) (service provider) stub skeleton SOAP-based SOAP-based middleware middleware SOAP messages SOAP messages SOAP messages (to look for services) (to publish service description) SOAP-based middleware service descriptions UDDI registry

  11. Simple Object Access Protocol • Specifies: • message format for one-way comms • specification for SOAP RPC • rules for processing SOAP messages • rules for transport - HTTP and SMTP

  12. A SOAP Message SOAP envelope Header: info for SOAP header intermediate header block nodes Body: actual SOAP body message body block

  13. <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> SOAP <env:Header> <m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" Message env:mustUnderstand="true"> <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference> <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime> Example </m:reservation> <n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <n:name>Åke Jógvan Øyvind</n:name> </n:passenger> <env:Body> </env:Header> <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel"> <p:departure> <p:departing>New York</p:departing> <p:arriving>Los Angeles</p:arriving> <p:departureDate>2001-12-14</p:departureDate> <p:departureTime>late afternoon</p:departureTime> <p:seatPreference>aisle</p:seatPreference> </p:departure> <p:return> <p:departing>Los Angeles</p:departing> <p:arriving>New York</p:arriving> <p:departureDate>2001-12-20</p:departureDate> <p:departureTime>mid-morning</p:departureTime> <p:seatPreference/> </p:return> </p:itinerary> <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels"> <q:preference>none</q:preference> </q:lodging> </env:Body> </env:Envelope>

  14. SOAP over HTTP service requestor service provider SOAP HTTP HTTP SOAP engine engine engine engine client implementation service implementation (other tiers) (other tiers)

  15. Simple Implementation service provider service requestor service client implementation implementation invokes the local procedure of invokes the service as a local call the service implementation server stub client stub invoke SOAP engine to the router parses the message, identifies the appropriate stub, prepare SOAP message and delivers the parsed message SOAP engine SOAP router packages SOAP into HTTP and passes the content of the HTTP passes it to an HTTP client that message to the router sends it to the provider HTTP engine HTTP server

  16. WSDL Specifications WSDL specification • Abstract part abstract part • signatures, types operations messages • like traditional IDL operations • Concrete part port types • bindings / services concrete part / ports bindings services and ports

  17. Concrete Part • Interface Bindings • message encoding and protocol bindings (e.g., RPC-style operation, communication via SOAP over HTTP) • Ports • interface binding + network address where port type implementation can be accessed • Services • logical groupings of ports

  18. Automatic Generation of WSDL WSDL of service provider 1 2 WSDL generator WSDL compiler WSDL compiler (client side) (server side) service requestor service provider application object application object (service provider) (client) stub skeleton SOAP-based SOAP-based middleware middleware SOAP messages

  19. WSDL Example: GreatH Hotel Reservation Service <?xml version="1.0" encoding="utf-8" ?> <description xmlns="http://www.w3.org/@@@@/@@/wsdl" targetNamespace= "http://greath.example.com/2004/wsdl/resSvc" xmlns:tns= "http://greath.example.com/2004/wsdl/resSvc" . . . > . . . </description> WSDL 2.0 empty shell (Example taken from W3C’s WSDL primer)

  20. Message <?xml version="1.0" encoding="utf-8" ?> <description xmlns="http://www.w3.org/@@@@/@@/wsdl" Types targetNamespace= "http://greath.example.com/2004/wsdl/resSvc" xmlns:tns= "http://greath.example.com/2004/wsdl/resSvc" xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc" . . . > ... <types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://greath.example.com/2004/schemas/resSvc" xmlns="http://greath.example.com/2004/schemas/resSvc"> <xs:element name="checkAvailability" type="tCheckAvailability"/> <xs:complexType name="tCheckAvailability"> <xs:sequence> <xs:element name="checkInDate" type="xs:date"/> <xs:element name="checkOutDate" type="xs:date"/> <xs:element name="roomType" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:element name="checkAvailabilityResponse" type="xs:double"/> <xs:element name="invalidDataError" type="xs:string"/> </xs:schema> </types> . . . </description>

  21. Interface <?xml version="1.0" encoding="utf-8" ?> <description xmlns="http://www.w3.org/@@@@/@@/wsdl" Definition targetNamespace= "http://greath.example.com/2004/wsdl/resSvc" xmlns:tns= "http://greath.example.com/2004/wsdl/resSvc" xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc" . . . xmlns:wsdlx="http://www.w3.org/@@@@/@@/wsdl-extensions"> . . . <types> ... </types> <interface name = "reservationInterface" > <fault name = "invalidDataFault" element = "ghns:invalidDataError"/> <operation name="opCheckAvailability" pattern="http://www.w3.org/@@@@/@@/wsdl/in-out" style="http://www.w3.org/@@@@/@@/wsdl/style/iri" wsdlx:safe = "true"> <input messageLabel="In" element="ghns:checkAvailability" /> <output messageLabel="Out" element="ghns:checkAvailabilityResponse" /> <outfault ref="tns:invalidDataFault" messageLabel="Out"/> </operation> </interface> . . . </description>

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend