Java Reference
In-Depth Information
Discussion
Let's take a look at each of the important sections of the WSDL to see how it maps. This might
not seem important at this stage because you can just use the wsdimport tool to generate the
artifacts necessary to invoke the service. But this will be very important to be able to do later
when you're working with orchestrations, and it's good to know a little about what's happen-
ing under the hood in case something breaks.
NOTE
In this discussion, I will use the qualified name wsdl:<elementName> in referring to WSDL ele-
ments in the namespace xmlns="http://schemas.xmlsoap.org/wsdl/" . By default, JAX-
WS generates a WSDL that does not qualify these elements, making WSDL the default namespace. I
use the prefix for clarity, though your WSDL document won't be qualified in this way. For example,
a reference to wsdl:service here will appear in your generated WSDL as service.
Package and types
Notice that your EJB that defines the service is with the com.soacookbook.catalog.ejb
package. Without customizations, JAX-WS will generate a namespace for your imported
types that matches the package name:
<types>
<xsd:schema>
<xsd:import namespace="http://ejb.catalog.soacookbook.com/"
schemaLocation="http://localhost:8080/CartEJBService/CartEJB?xsd=1">
</xsd:import>
</xsd:schema>
</types>
It also generated a schema document and placed it in the location specified by the schem-
aLocation attribute. Unlike IBM's implementation in WebSphere, which generates inline
types in WSDLs, Glassfish follows the best practice of writing the schemas to an external file
and importing it into the WSDL to keep the WSDL abstract. The generated schema looks like
this:
<xs:schema xmlns:tns="http://ejb.catalog.soacookbook.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://ejb.catalog.soacookbook.com/">
<xs:element name="getVersion" type="tns:getVersion">
</xs:element>
<xs:element name="getVersionResponse" type="tns:getVersionResponse">
Search WWH ::




Custom Search