Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document.

Similar presentations


Presentation on theme: "Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document."— Presentation transcript:

1 Chapter 10 Intro to SOAP and WSDL

2 Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document Describe what is SOAP envelope Exam the purpose of the SOAP headers and how SOAP handles errors Describe what is WSDL and why we need WSDL Exam what information is stored in the WSDL file and how WSDL is used in a Web service transaction Questions and discussions Homework

3 Concept of SOAP What is SOAP? –Stands for Simple Object Access Protocol –Is interoperability specification and standard for Web services –Provides a simple mechanism for making remote procedure calls and document exchanges using XML Why SOAP? - Easier to use - Distributed computing - Accessibility - XML based protocol

4 Concept of SOAP (continue) Why SOAP is different? –Like a CORBA application, a call is made and a response is returned; unlike CORBA, in which a CORBA client actually makes calls to the object on the server in a tightly coupled way, but a SOAP client just formats a text file and transfer it to the other machine –Is based on loosely coupled architecture, so there is no challenge of the client program for the calls or requests; therefore, it has casual relationship between clients and servers –Supports just-in-time peer-to-peer discovery

5 The SOAP Grammar The SOAP envelope contains both the header and the SOAP body SOAP envelope SOAP header (optional) SOAP body

6 The SOAP Grammar (continue) SOAP envelope tag SOAP envelope tag –A SOAP message is defined as beginning with the tag –A SOAP message is defined as beginning with the tag –And ending with –And ending with –We define XML namespace SOAP-ENV in the SOAP envelope tag. For example:

7 The SOAP Grammar (continue) SOAP header tag SOAP header tag –SOAP header tag is optional –It must be the first child element in the SOAP envelope if it’s present –Since SOAP header tag is not defined in the SOAP specification, so it’s available to the clients and services for their own use –Typically it’s used to communicate credential such as user name and password –Example of using the header tag (next slide)

8 The SOAP Grammar (continue) Example of using the SOAP header tag <SOAP-ENV:Header> <myNS:authentication xmlns:myNS=“http://www.stevepotts.com/auth” SOAP:ENV:mustUnderstand=“1”> SOAP:ENV:mustUnderstand=“1”><login>admin</login><password>admin</password></myNS:authentication></SOAP-ENV:Header>

9 The SOAP Grammar (continue) The SOAP body tag The SOAP body tag –The body of the SOAP message begins with the tag –And ending with the tag –Typically we place a remote call with the parameters in this tag. –Example (see next slide)

10 The SOAP Grammar (continue) Example of using the SOAP body tag <SOAP-ENV:Body><checkAccountBalance> 16888 16888</accountNumber></checkAccountBalance></SOAP-ENV:Body>

11 The SOAP Grammar (continue) Error handling tags –Using the optional SOAP error handling tags, the error message will be reported to the client –SOAP has the following four optional tags: <SOAP-ENV:Faulcode><SOPA-ENV:faultstring><SOPA-ENV:faultactor><SOPA-ENV:detail> –Example (see next slide)

12 The SOAP Grammar (continue) Example of using the error handling tag <SOAP-ENV:faultcode> The error message to the client if it occurs </SOAP-ENV:faultcode>

13 How SOAP is used SOAP is the specification, not a software SOAP document is an XML document We must have SOAP processors (parsers) at both the client-side and the server-side to be able to handle a SOAP message We can write our SOAP applications with any computer languages at both ends Many Web services servers have provided SOAP processors (SOAP engines) for free to promote the usages, so programmers don’t need to know SOAP grammar in details

14 How SOAP is used (continue) Many computer languages, such as Java and.NET, have Web services development packs, i.e., JAX-RPC and ASP.NET, to create Web services applications without knowing SOAP grammar in details Many computer languages, such as Java and.NET, have Web services development packs, i.e., JAX-RPC and ASP.NET, to create Web services applications without knowing SOAP grammar in details We will use such easy-to-use features to build our simple Web services application using Apache Axis and JAX-RPC in later chapters

15 WSDL and WSDL document WSDL (Web Services Description Language) is a specification that tells us how to describe a Web service WSDL document follows XML grammar and stored in the Web services server, such as http://www.xmethods.com, to communicate metadata about a Web service to all potential clients http://www.xmethods.com The basic operations that use the WDSL are find, bind, and publish (see next slide)

16 WSDL and WSDL document (continue) Example of how WDSL works Web services directory Client (Web service customer) Web service provider find publish bind

17 WSDL and WSDL document (continue) There are two types of WSDL document: –The concrete description –The abstract description There are four abstract XML elements that can be defined in a WSDL file as follows: -- describe data types -- describe data types -- describe request/response message -- describe request/response message -- describe method calls -- describe method calls -- it contains all operations -- it contains all operations

18 WSDL and WSDL document (continue) There are three concrete XML elements in a WSDL file: -- contains all ports in the WSDL -- contains all ports in the WSDL -- contains IP address and port of the Web service -- contains IP address and port of the Web service -- contains information how to physically connect to all of the Web services, respectively -- contains information how to physically connect to all of the Web services, respectively In addition, there is a root element -- specify the targetNameSpace Example of a WSDL document –http://www.xmethods.com http://www.xmethods.com

19 HTTP communication handshake

20 Questions and Discussion

21 Homework for Extra Points Use of goole search to find out SOAP tutorial’s appendix, and write down how many data types it supports Summarize why is the WSDL needed Due: Wednesday, June 8, 2005 in the class


Download ppt "Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document."

Similar presentations


Ads by Google