Java Reference
In-Depth Information
Generally, when you start your development from Java, you do not want to specify the
WSDL—just allow JAX-WS to create it for you. Glassfish has had uneven support surround-
ing this issue, and the specification indicates that starting from Java and WSDL is optional. If
you want to specify your own schemas, however (because there are restrictions you want to
add, for example), it's the only way.
Deployment descriptors
You might see references to deployment descriptors such as sun-JAX-WS.xml. This is the
deployment descriptor for Metro, and is used to describe service endpoints. Each endpoint
represents a different port in the WSDL and contains information on binding, implementing
class, and the URL pattern that can be used to invoke it. In general, you can forget about
this file. The elements it defines are all replicated as annotations. Instead of having to create
and maintain and package a separate file to include a description of your service deployment,
in many cases, you can just use the corresponding annotations. For example, to indicate that
you want to enable MTOM (Message Transmission Optimization Mechanism), just use the
@MTOM(enable=true) annotation on your service endpoint interface. The same is true for
handler chains. Here is an example of a basic file:
<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
version="2.0">
<endpoint name="HelloService"
implementation="com.soacookbook.ch04.HelloServer" url-pattern="/
hello" />
</endpoints>
This descriptor would configure your servlet to be published as http://localhost:8080/
HelloService/hello if you are using the default port.
There are recipes throughout this chapter that illustrate how to use some of these options.
Search WWH ::




Custom Search