title: JAX-WS Endpoint to Domino
body: <p>My Domino <em>Web Service Provider</em> broke when I upgraded the (Win64) server from 8.5.3FP2 to FP3. I wrote some information about it to <a href="http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&amp;documentId=B1FE" rel="nofollow">XPage forum</a>.</p>
  
  <p>Instead of fighting with Axis based legacy stuff I'd like to use JAX WS which comes with Java 1.6. I decided to try <a href="http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/" rel="nofollow">this</a> very simple example. I copy pasted the code to a Java project on my Designer Eclipse, run it and the Web Service was up and running on my local machine: it responded and returned the WSDL.</p>
  
  <p>Next I copy pasted the code to an NSF on server as Code/Java elements and changed:</p>
  
  <pre><code>public static void main(String[] args)
  </code></pre>
  
  <p>to</p>
  
  <pre><code>public HelloWorldPublisher()
  </code></pre>
  
  <p>and called this constructor from SSJS in XPage. I got this error:</p>
  
  <blockquote>
    <p>Exception in thread "main"
    com.sun.xml.internal.ws.model.RuntimeModelerException : A
    @WebService.targetNamespace must be specified on classes with no
    package.  Class: HelloWorldImpl</p>
  </blockquote>
  
  <p>The classes were in packages. I run it also with command line on Domino server JVM and got the same error. After googling I added this</p>
  
  <pre><code>@WebService(targetNamespace="http://mycompany.net/dev/ph")
  </code></pre>
  
  <p>to <em>HelloWorld</em> and </p>
  
  <pre><code>@WebService(endpointInterface="com.mkyong.ws.HelloWorld", targetNamespace="http://mycompany.net/dev/ph", portName="HelloWorldPort", name="HelloWorld", serviceName="HelloWorldService")
  </code></pre>
  
  <p>to <em>HelloWorldImpl</em> in NSF and run it. After that the web service seemed to be up and running!</p>
  
  <p>Next I booted the server because it was slow and after that I have not seen the WSDL! I've run the code many times, restarted HTTP and tried removing <code>@WebService</code> attributes. I've also tried to run the code with command line on server again but that gives me always the above <em>@WebService.targetNamespace</em> error, I have no idea why.</p>
  
  <p>Now I get always this to Domino console:</p>
  
  <blockquote>
    <p><strong>java.lang.NoClassDefFoundError: com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory
    (initialization failure)</strong>   at
    java.lang.J9VMInternals.initialize(J9VMInternals.java:140)   at
    com.sun.xml.internal.ws.server.SDDocumentImpl.writeTo(SDDocumentImpl.java:266)
    at
    com.sun.xml.internal.ws.transport.http.HttpAdapter.publishWSDL(HttpAdapter.java:538)
    at
    com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230)
    at
    com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:107)
    at
    com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:92)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)   at
    sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:77)   at
    com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)   at
    sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:569)
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)   at
    sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:541)   at
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    at java.lang.Thread.run(Thread.java:738)</p>
  </blockquote>
  
  <p>when accessing this URL on server:</p>
  
  <pre><code>http://localhost:9999/ws/hello?wsdl
  </code></pre>
  
  <p>I'm a bit surprised I get anything to Domino log because I think this uses JVM http server. I don't understand why it worked first and now it cannot find this class.</p>
  
  <p>How do I publish JAX WS endpoint to Domino Server?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I downloaded the JAX WS jars from here:</p>
  
  <p><a href="http://jax-ws.java.net/" rel="nofollow">http://jax-ws.java.net/</a></p>
  
  <p>and placed the them in <em>\jvm\lib\ext</em> folder. The WSDL URL started to work again! Also the endpoint URL has some information now. I don't know why I had to do this because the functionality should be included in JVM 1.6. Next I will try to use Domino objects in the endpoint code.</p>
  
  <p>Is it possible to make JAX WS to use Domino http server? </p>
  
  <p>thanks,</p>
  
  <ul>
  <li>Panu</li>
  </ul>