Register / Login
Configure wsimport to not insert wsdl location in client service class?
posted 7 years ago
Is there a way that I can tell wsimport to not generate the wsdl location url in the client service class?
I.E. when I use wsimport to generate my client side service class using
<wsimport . . wsdl="TestService.wsdl" . . .
When I do this my generated client has hard coded my wsdl to its path at compile time. I do not really want this hardcoded path in their as I do not use the default constructor to get my service.
Service service = Service.create(wsdlURL, serviceName); TestServiceEndpoint endpoint = service.getPort(TestServiceEndpoint.class);
So as you can see I always provide my own wsdl location and service name in my client so I don't really need the extra code in the generated client service.
As an aside I do this because I deploy yo many different URL's and each client reads in properties for the wsdl location so that each client has a configurable property to go to different servers.
I guess I could always set the wsdLocation when using wsimport to a empty
"", but I am not sure that I like that either.
many questions about ws
JAX-WS - domain model
Generating and using client code from wsdl file with wsimport
Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL
Best practices regarding client code generation to a third party webservice and deployment issues