I have a web service that was created several years ago in C++ and is consumed by a .NET client using C#'s "wsdl.exe" to generate the client stubs. For a variety of reasons, I now also need a Java client and am willing to restrict usage to Java 6 (JDK 1.6) with JAX-WS. The generated stubs work fine, even when packaged in a .jar, but I'm having a problem with the way that JAX-WS web service clients want to be deployed. It looks like the problem I'm having is solvable, but none of the suggested ways seems to work.
JAX-WS expects the WSDL to be accessible, preferably from the network, as it parses the WSDL on startup every time to create the bindings. Like jgrowl in Creating a web-service client with a known but inaccessible wsdl, the client may not have access to the WSDL at the URL that JAX-WS uses (which will likely be a file on the build machine or a pointer to localhost). I want to ship the WSDL inside the client .jar, but the simplest solution (-wsdllocation "/path/to/wsdl/in/jar.wsdl"
) prints out a warning that I do not want to show up.
I would also prefer not having the client do something like the solution jgrowl found, which appears to work but doesn't Just Work. Articles found on Google mostly address server WSDL locations, but suggest that clients should be able to work with META-INF/jax-ws-catalog.xml
files that translate the URL used in -wsdllocation
to a path in the .jar file, but those do not seem to work in our testing.
Is there a "recipe" so that I can put the WSDL inside the .jar somewhere and have a JAX-WS client just work with no extra effort on the part of the client user and with no warnings?