Creating a web-service client directly from the source

java, jax-ws, maven-2, wsdl

Solution

You should use `<wsdlLocation>` option to give the location of the service where the WSDL file is going to be available after deployment.

Using -wsdlLocation switch

There is another easy way to do it - just run wsimport with -wsdlLocation switch and provide the WSDL location value which is relative to the generated Service class and you need to put this WSDL file at this relative location.

See the post for more details.

Problem

I am trying to generate the WS client jar directly from the @Webservice class(es). Let's take this example : ``` package com.example.maven.jaxws.helloservice; import javax.jws.WebService; @WebService public class Hello { public String sayHello(String param) { return "Hello " + param; } } ``` I can generate a war file and use GlassFish to serve this web service, and from there I can use the glassfish WSDL URL to generate the client sources. What I am trying to do is to skip the GlassFish part. From my maven project defining the webservice, I would like to use the jaxws-maven-plugin to create the client classes but I cannot find any way to specify the actual URL of the webservice. It should be possible, right? @see also Creating a web-service client with a known but inaccessible wsdl

Original source

Related problems