title: call a JAX WS webservice from the server without http or servlets
body: <p>I've created a SOAP based JAX-WS server (classes and WSDL created with
  wsgen).  I've successfully tested this by creating a stand-alone
  server with Endpoint.publish() and connected to it successfully with
  java, perl and .NET clients. Now I would like to deploy it on a
  non-servlet based web framework (Play Framework).</p>
  
  <p>Unfortunately even
  after looking all over the web for docs and code I can't figure out
  how to invoke the webservice outside of http from within the server.
  On the play side, the framework routes an http POST request to a
  static java method.  It's easy to access the soap packet but I can't
  figure out how to pass it to JAX WS for invokation.</p>
  
  <p>In a nuteshell here's what I'm trying to do</p>
  
  <pre><code>public class Application extends Controller 
  {
      // function referenced by routing table
      public static void func1() {
          // TODO: use play to get SOAP request from caller
          String soapRequest = playFrameworkCode();
  
          Object implementor = MyJaxWsWebService();
  
          // !!! insert JAX WS code here !!!
          Object magicJaxWsObject;
          String soapResult = magicJaxWsObject.invoke(soapRequest);
  
          // TODO: use Play to return SOAP result to caller
      }
  }
  </code></pre>