Arci
Arci

Reputation: 6819

How to create a Dynamic Web Project with JAX-WS based Web Service in Eclipse?

How can I create and run a JAX-WS web service in a Dynamic Web Project using Eclipse? I'll be using Tomcat 7 as my server. Can you provide a step by step tutorial on how to do it? A hello world web service will do.

I followed this tutorial but I wasn't able to make it run. I did not follow the tutorial's step 4 - 6 because I'm already using Eclipse and the directories are already properly structured on a Dynamic Web Project. Also, my Tomcat is running under JDK 6. Since JAX-WS is already part of JDK 6, there's no need for me to copy it inside Tomcat. When I run the URL indicated in the tutorial, I get a resource not found error.

Upvotes: 1

Views: 1995

Answers (2)

Grim
Grim

Reputation: 1976

Ok, JDK6+JAXWS often gives problems.

You need to create an endorsed-Folder.

Try to run Tomcat from Eclipse. using these additional VM-Arguments:

-Djava.endorsed.dirs="<your-server>\endorsed" -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.MessageFactoryImpl
-Djavax.xml.soap.SOAPFactory=com.sun.xml.messaging.saaj.soap.SOAPFactoryImpl
-Djavax.xml.soap.MetaFactory=com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

now, place the latest saaj-impl and saaj-api to the endorsed folder.

This should work.

Upvotes: 1

Csujo
Csujo

Reputation: 507

I think the jax-ws is not part of the JDK. You have to copy the jax-ws implementation into the Tomcat. Did you find the jax-ws.jar in your JDK folder?

Upvotes: 1

Related Questions