Java Reference
In-Depth Information
NOTE
While it may be tempting to place clues about the relation between schema elements and WSDL parts
in your schema, do not. Schemas have more jobs in life than being tied to our WSDLs. If you are
certain they will never do anything else, it may be simpler to inline them within the WSDL and save
maintainers the puzzle. This does undermine the modularity of your WSDL, however.
Your web service implementation itself does not specify anything about your schema, but the
WSDL must point to it.
NOTE
Once you deploy your service, the schema's annotations may be the only thing visible if you open it
in Internet Explorer for viewing. You can use the view source option to see the entire schema con-
tents. This is not necessary in Firefox, which just shows the entire schema regardless.
WSDL
This WSDL in Example 7-2 is very simple. It defines a target namespace that is shared by
the schema and the service implementation. In the wsdl:types section, import the Credit.xsd
schema defined in the previous listing. In this example, it is located in the same directory as
the WSDL, though it could be specified as a URL or within another directory relative to the
WSDL.
NOTE
You might notice that Glassfish rewrites the WSDL to have the schemaLocation attribute of
xsd:import point to an absolute URL (in the form of http://localhost:8080/soaCook-
bookWS/CreditService?xsd=1 ) if you've passed it a relative path.
The WSDL defines a single wsdl:portType , CreditAuthorizer , which is similar to a Java
interface that defines one operation, authorize . The soap:address element indicates the
URL at which the service is available. The soap prefix is used because you are binding the
service using the SOAP protocol.
Search WWH ::




Custom Search