2

I have a JAX-WS web service exposed through the simple Endpoint interface (example)

If I understand the API correctly, as an alternative to directly calling Endpoint.publish (which uses the Sun's HTTP Server), we can:

  1. Create the Endpoint --> Endpoint e = Endpoint.create(impl);
  2. Publish the Endpoint ---> e.publish(context);

Can I use this e.publish(..) API to publish to an embedded tomcat server? (example)

The javadoc of the Publish method is pretty confusing to me.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Pradyumna
  • 1,583
  • 4
  • 19
  • 34

1 Answers1

2

Although it is more than two years old, this answer to a related question still applies. If you want to deploy to tomcat, no matter whether it is running in embedded mode or normal, you need to package a war and place it in the webapps directory.

To be usable with the publish() method in the way described in your question, tomcat would have to provide a Sun HTTP Server Service Provider Implementation, which it does not. An alternative to Sun's HTTP Server is for example Jetty.

Community
  • 1
  • 1
joergl
  • 2,850
  • 4
  • 36
  • 42
  • Thanks. I followed your clue on Jetty and found Apache CXF (which uses Jetty internally) that works fine. I posted a few other helpful links that I found on this topic to my [blog](http://kpachar.blogspot.in/2012/09/secure-jax-ws-with-apache-cxf-some-links.html) – Pradyumna Sep 15 '12 at 11:24