Book Image

Java 7 JAX-WS Web Services

By : Deepak Vohra
Book Image

Java 7 JAX-WS Web Services

By: Deepak Vohra

Overview of this book

<p>Web services are applications that use open, XML-based standards and transport protocols to exchange data with clients. <br /><br />In the book Developing a JAX-WS Web Service using the wsimport clientjar Option, we shall create a JAX-WS web service with Java 7. We shall discuss the new clientjar option in the wsimport tool or the wsimport ant task which is used to generate JAX-WS portable artifacts from a service wsdl. Subsequently, we use the web service artifacts to invoke the web service from a web service client.</p>
Table of Contents (8 chapters)

What is new in Java 7 wsimport?


Java 7 supports Java API for XML Web Services (JAX-WS) 2.2.4, which has introduced a new (since JAX-WS 2.2.2) wsimport option called -clientjar as shown in the following sample command:

wsimport -clientjar wsclient.jar http://example.com/service/hello?WSDL

The -clientjar option fetches the WSDLs and the schemas and packages them with the generated client-side artifacts into a JAR file. By including the generated JAR file in the classpath of the web service client, there is no need to fetch the WSDLs from the endpoint each time a service instance is created, thus saving on network overhead.