title: Embedding the WSDL for a web service in a JAX-WS client .jar
body: <p>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 <em>is</em> solvable, but none of the suggested ways seems to work.</p>
  
  <p>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 <a href="https://stackoverflow.com/questions/2097789/creating-a-web-service-client-with-a-known-but-inaccessible-wsdl">Creating a web-service client with a known but inaccessible wsdl</a>, 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 (<code>-wsdllocation "/path/to/wsdl/in/jar.wsdl"</code>) prints out a warning that I do not want to show up.</p>
  
  <p>I would also prefer <em>not</em> 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 <code>META-INF/jax-ws-catalog.xml</code> files that translate the URL used in <code>-wsdllocation</code> to a path in the .jar file, but those do not seem to work in our testing.</p>
  
  <p>Is there a "recipe" so that I can put the WSDL inside the .jar somewhere and have a JAX-WS client <em>just work</em> with no extra effort on the part of the client user and with no warnings?</p>