1 / 36

WEB SERVICES Introduction

WEB SERVICES Introduction. Web Services. Software components designed to provide specific operations (“services”) accessible using standard Internet technology. For machine interaction over a network.

pekelo
Télécharger la présentation

WEB SERVICES Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WEB SERVICESIntroduction Grid Computing, B. Wilkinson, 2004

  2. Web Services • Software components designed to provide specific operations (“services”) accessible using standard Internet technology. • For machine interaction over a network. • Usually through SOAP (simple Object Access Protocol) messages carrying XML documents, and a HTTP transport protocol. Grid Computing, B. Wilkinson, 2004

  3. Basic client-server model Grid Computing, B. Wilkinson, 2004

  4. Client needs to: • Identify location of the required service • Know how to communicate with the service to get it to provide the actions required. • Uses service registry - a third party. Grid Computing, B. Wilkinson, 2004

  5. Service-Oriented Architecture Steps: • Services “published” in a Service registry. • Service requestor asks Service Registry to locate service. • Service requestor “binds” with service provider to invoke service. Grid Computing, B. Wilkinson, 2004

  6. Service-Oriented Architecture Service registry 1. Publish 2. Find 3. Bind Service requester Service provider Grid Computing, B. Wilkinson, 2004

  7. Key aspects Has similarities with RMI and other distributed object technologies (CORBA etc.) but:: • Web Services are platform independent • They use XML within a SOAP message). • Most use HTTP to transmit message. Grid Computing, B. Wilkinson, 2004

  8. XML-based Web Services • XML provides a flexible basis for storing and retrieving service information on web services. • Web services use data-centric XML documents to communicate information. Grid Computing, B. Wilkinson, 2004

  9. Web Services “Stack” • HTTP transport • SOAP message carrying XML documents • WSDL (Web Services Description Language used to describe message syntax for invoking a service and its response. • UDDI (Universal Description, Discovery and Integration) used as web service discovery mechanism. Grid Computing, B. Wilkinson, 2004

  10. Web Services “Stack” + XML Grid Computing, B. Wilkinson, 2004

  11. Web Services 1 3 2 4 5 6 From http://www.globus.org Grid Computing, B. Wilkinson, 2004

  12. Simple Object Access Protocol (SOAP) A communication protocol for passing XML documents. Provides mechanisms for: • Defining communication unit - a SOAP message • Error handling • Extensions • Data representation • Remote Procedure Calls (RPC’s) • Document-centric approach for business transactions • Binding to HTTP Grid Computing, B. Wilkinson, 2004

  13. SOAP Envelope <SOAP-ENV:Envelope xmlns=“http://schemas.xmlsoap.org/soap/envelope/”> <SOAP-ENV:header> . . . </SOAP-ENV:Header> . . . <SOAP-ENV:Body> . . . </SOAP-ENV:Body> </SOAP-ENV:Envelope> namespace, see later Grid Computing, B. Wilkinson, 2004

  14. What goes down the Wire HTTP packet containing: • Stuff about context, transactions, routing, reliability, security • SOAP message • Attachments XML/SOAP standardization body, World Wide Web Consortium (W3C) covers SOAP and attachments. Grid Computing, B. Wilkinson, 2004

  15. Structure of an XML document • Optional Prolog • Root Element Grid Computing, B. Wilkinson, 2004

  16. Prolog • Includes processing instruction (<?…?>) to specify how to process document.. • Includes meta-information about document, and comments. Grid Computing, B. Wilkinson, 2004

  17. One PI identifies document as a XML document, e.g. <?xml version=“1.0” encoding=“UTF-8”?> • Comments, same form as HTML: <!-- this is a comment --> Grid Computing, B. Wilkinson, 2004

  18. Root element • Root element contains contents of document. • Other elements are within root element and can be nested. Grid Computing, B. Wilkinson, 2004

  19. XML Tags • Not predefined as in HTML. • Must define your own tags using names as names in a programming languages • As in programming languages, restrictions. Case sensitive. Start with a letter. • “Elements” have start and end tags. • Start tags can have attributes as in HTML. Grid Computing, B. Wilkinson, 2004

  20. Namespace Mechanism • If XML documents combined, can be problem if different documents use the same tag names to mean different things. • With namespace mechanism, tags given additional namespace identifier to qualify it. Grid Computing, B. Wilkinson, 2004

  21. Qualifying names • Qualified name given by namespace identifier and name used in document: Qualified name = namespace identifier + local name Grid Computing, B. Wilkinson, 2004

  22. Namespace identifier • Uses URI’s (Uniform Resource Identifiers) - web naming mechanism. • URLs are a subset of URI, and would typically be used, e.g.: http://www.cs.wcu.edu/~abw/ns Grid Computing, B. Wilkinson, 2004

  23. URIs also include email addresses, i.e. mailto:abw@email.wcu.edu and Uniform Resource Names (URNs) which are globally unique and persistent. UDDI uses URNs. Grid Computing, B. Wilkinson, 2004

  24. Associating namespace identifier with local name • Names in document given a prefix, i.e.: <mypo:street> • Namespace identifier associated with prefix in root element:: xmlns:po=“http://www.cs.wcu.edu/~abw/ns” Grid Computing, B. Wilkinson, 2004

  25. Namespace Example prefix <mypo:po xmlns:mypo=“http://www.cs.wcu.edu/~abw/ns”> <mypo:description> Computer, Pentium IV, 2.8 Ghz, 4 Gbytes main memory </mypo:description> </mypo:po> Grid Computing, B. Wilkinson, 2004

  26. Can apply namespace to every tag without a prefix automatically if that is required: <mypo:po xmlns=“http://www.cs.wcu.edu/~abw/ns”> <description> Computer, Pentium IV, 2.8 Ghz, 4 Gbytes main memory </description> </mypo:po> Grid Computing, B. Wilkinson, 2004

  27. Defining Legal XML Tags • Legal tags in a document defined optionally using either: • Document type definitions (DTD) within document. <!DOCTYPE …. > (old, not allowed with SOAP). or • XML schema Grid Computing, B. Wilkinson, 2004

  28. XML Schema • Flexible way of handing legal element names. Expressed in XML. • Schema is an XML document with required definitions. • Handles namespaces. • Has notation of data types Grid Computing, B. Wilkinson, 2004

  29. XML schema Document xsi:schemaLocation=“ .. “ Grid Computing, B. Wilkinson, 2004

  30. XML Schema StructureExample <?xml version=“1.0” encoding=“UTF-8”?> <xsd:schema xmlns=“http://www.skatestown.com/ns/po” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” targetNamespace=http://www.skatestown.com/ns/po”> <xsd:annotations> <xsd:documentation xml:lang=“en”> Purchase order schema for SkatesTown. </xsd:documentation> </xsd:annotation> . . . </xsd:schema> From: “Building Web Services with Java, making sense of XML, SOAP, WSDL, and UDDI, 2nd ed” by S. Graham et al, SAMS publishing, 2004, p 54. Grid Computing, B. Wilkinson, 2004

  31. Associating schema to documentExample <?xml version=“1.0” encoding=UTF-8”?> <po:po xmlns:po=“http://www.skatestown.com/ns/po” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://www.skatestown.com/ns/po http://www.skatestown.com/schema/po.xsd” id=“43871” submitted=“2001-10-05”> . . . </po:po> From: “Building Web Services with Java, making sense of XML, SOAP, WSDL, and UDDI, 2nd ed” by S. Graham et al, SAMS publishing, 2004, p 54. Grid Computing, B. Wilkinson, 2004

  32. Additional XML materialsOn-line materials • W3C consortium home page: http://www.w3.org/XML/ • W3Schools XML Tutorial : http://www.w3schools.com/xml/ Grid Computing, B. Wilkinson, 2004

  33. Books Several books on XML, e.g.: “Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, 2nd edition” by S. Graham et al, SAMS publishing, 2004 Very good but 792 pages!! Grid Computing, B. Wilkinson, 2004

  34. Additional SOAP materials See: http://www.w3c.org/TR/soap Grid Computing, B. Wilkinson, 2004

  35. Hosting Environments for Web Services • Microsoft .NET • IBM Websphere • Apache Axis - we will be using this for assignment 1 Grid Computing, B. Wilkinson, 2004

  36. More information on Axis http://xml.apache.org/axis Grid Computing, B. Wilkinson, 2004

More Related