Download presentation
Presentation is loading. Please wait.
1
1 Web Services Web and Database Management System
2
2 Web Services Web services are application components Web services can be discovered using UDDI Web services can be used by other applications XML is the basis for Web services
3
3 Why Web Services? Interoperability has Highest Priority –Web-applications are simple applications that run on the web. –They can be used by any browser on any platform Web Services take Web-applications to the Next Level –By using Web services, our application can publish its function or message to the rest of the world Web Services have Two Types of Uses –Reusable application-components –Connect existing software
4
4 How does it work? The basic Web services platform is XML + HTTP Web services platform elements include: –SOAP (Simple Object Access Protocol) –WSDL (Web Services Description Language) –UDDI (Universal Description, Discovery and Integration)
5
5 What is WSDL? WSDL is an XML-based language for locating and describing Web services –WSDL stands for Web Services Description Language –WSDL is based on XML –WSDL is used to describe Web services –WSDL is used to locate Web services
6
6 The WSDL Document Structure A WSDL document has these major elements: Element Defines The data types used by the web service The messages used by the web service The operations performed by the web service The communication protocols used by the web service
7
7 WSDL document definition of types........ definition of a message.... definition of a port....... definition of a binding....
8
8 WSDL Elements WSDL Types –The element defines the data types that are used by the web service. –For maximum platform neutrality, WSDL uses XML Schema syntax to define data types. WSDL Messages –The element defines the data elements of an operation. –Each message can consist of one or more parts. –The parts can be compared to the parameters of a function call in a traditional programming language.
9
9 WSDL Elements (cont) WSDL Ports –The element is the most important WSDL element. –It describes a web service, the operations that can be performed, and the messages that are involved. –The element can be compared to a function library (or a module, or a class) in a traditional programming language. WSDL Bindings –The element defines the message format and protocol details for each port.
10
10 WSDL Example Compared to traditional programming: glossaryTerms is a function library, "getTerm" is a function with "getTermRequest" as the input parameter, and getTermResponse as the return parameter.
11
11 WSDL Port: Operation Types The request-response type is the most common operation type, but WSDL defines four types: Type Definition 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
12
12 One-Way Operation A one-way operation example:
13
13 Request-Response Operation A request-response operation example:
14
14 Binding to SOAP <soap:binding style="document“ transport="http://schemas.xmlsoap.org/soap/http" />
15
15 What is SOAP? SOAP is an XML-based protocol to let applications exchange information over HTTP: –SOAP is a communication protocol for accessing a Web Service. –SOAP is a format for sending messages –SOAP is platform independent –SOAP is language independent –SOAP is based on XML –SOAP is simple and extensible –SOAP is designed to communicate via Internet –SOAP allows us to get around firewalls
16
16 Why SOAP? Remote Procedure Calls (RPC) like DCOM and CORBA are used to communicated between object –Firewalls and proxy servers will normally block this kind of traffic. A better way to communicate between apps is over HTTP –since it is supported by all Internet browsers and servers. SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
17
17 SOAP Building Blocks A SOAP message is an XML document containing the following elements: –An Envelope element that identifies the XML document as a SOAP message –A Header element that contains header information –A Body element that contains call and response information –A Fault element containing errors and status information
18
18 Syntax Rules A SOAP message MUST be encoded using XML A SOAP message MUST use the SOAP Envelope namespace A SOAP message MUST use the SOAP Encoding namespace A SOAP message must NOT contain a DTD reference A SOAP message must NOT contain XML Processing Instructions
19
19 Skeleton SOAP Message.........
20
20 SOAP Envelope Element SOAP Envelope element is the root element of a SOAP message It defines the XML document as a SOAP message.... Message information goes here...
21
21 SOAP Header Element Optional SOAP Header element contains application- specific information (like authentication, payment, etc) about the SOAP message 234......
22
22 The SOAP Body Element Required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of message. Immediate child elements of the SOAP Body element may be namespace-qualified Apples
23
23 The SOAP Fault Element Optional SOAP Fault element is used to indicate error msg If a Fault element is present, it must appear as a child element of the Body element. A Fault element can only appear once in a SOAP message SOAP Fault element has the following sub elements: Sub Element Description A code for identifying the fault A human readable explanation of the fault Information about who caused the fault to happen Holds application specific error information related to the Body element
24
24 SOAP Fault Codes The faultcode values defined below must be used in the faultcode element when describing faults: Error Description VersionMismatch Found an invalid namespace for the SOAP Envelope element MustUnderstand An immediate child element of the Header element, with mustUnderstand attribute set to "1", was not understood Client The message was incorrectly formed or contained incorrect information Server There was a problem with the server so the message could not proceed
25
25 SOAP HTTP Binding A SOAP method is an HTTP request/response that complies with the SOAP encoding rules. A SOAP request could be an HTTP POST or an HTTP GET request The HTTP POST request specifies at least two HTTP headers: Content-Type and Content-Length. HTTP + XML = SOAP POST /item HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Content-Length: 250
26
26 An Example of SOAP Request POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn IBM
27
27 An Example of SOAP Response HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn 34.5
28
28 SOAP Request and SOAP Response Michael Jordan Hello Michael Jordan
29
29 What is UDDI? UDDI is a directory service where companies can register and search for Web services –UDDI stands for Universal Description, Discovery and Integration –UDDI is a directory for storing information about web services –UDDI is a directory of web service interfaces described by WSDL –UDDI communicates via SOAP –UDDI is built into the Microsoft.NET platform
30
30 UDDI A UDDI registry is like an electronic phone book for businesses that provide Web Services. A UDDI registry is accessed with SOAP messages, –So, a UDDI registry is really just a Web Service WSDL provides a standard for describing a Web Service so that we know how to interact with it UDDI enables the publication and discovery of Web Service description
31
31 Types of UDDI UDDI registries are categorized into: public and private A private UDDI registry is operated by a single organization or a group of collaborating organizations –They are located on large corporate intranets with security control Public UDDI registries are freely available for anyone to publish and query over the Internet. –There is a massive public UDDI registry called the UDDI Business Registry (UBR) that is hosted by IBM, Microsoft, SAP, and NTT.
32
32 Web Services Service Provider Service Consumer Directory Service Description service request service response SOAP WSDL XML
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.