Java Reference
In-Depth Information
Understanding WSDL
Problem
You have just deployed a simple web service and want to view its WSDL to understand the
relation of your code to the deployed web service.
Solution
Inspect the WSDL by appending ?WSDL to the end of the service name. This is only a conven-
tion and is not required by any specification, but all of the major vendors (IBM, Microsoft,
BEA/Oracle, Sun, JBoss) adhere to it.
Check out the following discussion on the key sections of a WSDL in order to better under-
stand this important part of your web service contract.
Discussion
It's hard to have a general discussion of WSDL sections because they change depending on
choices you made in a specific service. So in this discussion, we examine the WSDL that is
generated for the web service you created in Creating and Deploying the Simplest Web Ser-
vice , Example 4-3 .
Inspect the WSDL published to the Java 6 internal HTTP server by opening your web browser
to http://localhost:9999/hello?wsdl . You should see something like Example 4-4 .
Example4-4.The Hello WSDL
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://ch03.soacookbook.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://ch03.soacookbook.com/"
name="HelloWSService">
<types></types>
<message name="sayHello">
<part name="arg0" type="xsd:string"></part>
</message>
<message name="sayHelloResponse">
<part name="return" type="xsd:string"></part>
</message>
<portType name="Hello">
Search WWH ::




Custom Search