Java Reference
In-Depth Information
<types>
<xsd:schema>
<xsd:import namespace="http://soacookbook.com/"
schemaLocation="http://localhost:7777/TestWS/HelloWSService?xsd=1"/>
</xsd:schema>
</types>
That URI references a complete XML Schema document that indicates the values of the com-
plex types used in the request and response messages.
If you are writing your own WSDL, you can define your types this way in an external schema,
or define them entirely inline, like this:
<types>
<xsd:schema>
<xsd:simpleType name="ID">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]{5}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</types>
In general, it's considered a best practice not to define your types inline in order to keep the
interface separate from the implementation as much as possible. Instead, refer to an external
schema.
Messages
The Messages section of the WSDL contains definitions for the request and responses to be
used in communicating with the service. You'll notice that there is one message each for the
request and response. The request message has the same name as the method invocation be-
cause you are doing RPC style here. The response is given the name of the operation appended
with “Response”, which is the default according to the JAX-WS specification. Each of these
messages has a part child. A message part is similar to a parameter to a method in that it
has a name and a type. The name for the first part is “arg0”, which is the default. Subsequent
arguments would be named “arg1”, and so forth. These names can be customized to make
them easier to read and follow, which becomes increasingly important for more complicated
WSDLs.
For the response, there is an element <part name="return" type="xsd:string"> . Because
the default parameter style value is “wrapped,” the value that gets returned by the web service
will be wrapped within a single element with a name of “return” from which you can extract
the rest of the payload. This is discussed in more detail in Choosing Encoding, Use, and Para-
meter Styles .
Search WWH ::




Custom Search