Deployment descriptors are standard text files, formatted using XML and packaged in a Web services application. You can optionally use the Web Services for Java Platform, Enterprise Edition (Java EE) specification (JSR 109) service reference deployment descriptor to augment or override application metadata specified in annotations within Java API for XML-Based Web Services (JAX-WS) Web services client.
You must first generate the Web services client artifacts from a Web Services Description Language (WSDL) file using the wsimport command.
You can add service-ref entries within the application-client.xml, web.xml, or ejb-jar.xml Java EE deployment descriptors. A service-ref entry represents a reference to a Web service that is used by a Java EE component in Web, Enterprise JavaBeans (EJB) or application client containers. A service-ref entry has a JNDI name that is used to lookup the service. Specifying the service-ref entry enables the client applications to locate the service using a JNDI lookup and you can also use these service references for resource injection.
For each service-ref entry found in one of the deployment descriptors, the corresponding service object is bound into the JNDI namespace and the port information is included, if specified. The JAX-WS client can now perform a JNDI lookup to retrieve either a JAX-WS service or port instance.
When binding a JAX-WS service into JNDI, use the javax.xml.ws.Service subclass that is generated by the wsimport tool as the service-interface value. This is the class that contains the @WebServiceClient annotation. When binding a JAX-WS port into the namespace, the service-interface value is still the javax.xml.ws.Service subclass generated by the wsimport tool, and the service-ref-type value specifies the service endpoint interface (SEI) class used by the port. The SEI class is also generated by wsimport, and it is annotated with the @WebService annotation.
You can now use the service references that were defined in the deployment descriptor within your client application. Additionally, you can use deployment descriptors to augment or override information specified by @WebServiceRef or @Resource annotations.
Complete the client implementation by writing your client application code that is used to invoke the Web service.
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) |