Deploying JAX-WS WebService on Tomcat-6

Now we are going to see how to deploy JAX-WS WebService on Tomcat Server.
We are going to deploy The AuthenticationService developed in on apache-tomcat-6.0.32.

To deploy our AuthenticationService we need to add the following configuration.




2. Create a new file WEB-INF/sun-jax-ws.xml

<?xml version="1.0" encoding="UTF-8"?>

3. Download the JAX-WS Reference Implementation from
Copy all the jar files from jaxws-ri/lib folder to WEB-INF/lib.

Now deploy the application on Tomcat server.
You don’t need to publish the Service by our-self as we did using EndpointPublisher.
Once the tomcat is up and running see the generated wsdl at http://localhost:8080/CAAS/services/AuthenticationService?wsdl.

Now if you test the AuthenticationService using standalone client it will work fine.

public static void testAuthenticationService()throws Exception
URL wsdlUrl = new URL("http://localhost:8080/CAAS/services/AuthenticationService?wsdl");
QName qName = new QName("", "AuthenticationService");
Service service = Service.create(wsdlUrl,qName);
AuthenticationService port = service.getPort(AuthenticationService.class);
Credentials credentials=new Credentials();
AuthenticationStatus authenticationStatus = port.authenticate(credentials);

But if you try to test with the wsimport tool generated client code make sure that you dont have jax-ws-ri jars in Client classpath.
Otherwise you will get the below error:

Exception in thread "main" java.lang.NoSuchMethodError:;


  1. Two Things 1) I see the CAAS in your publish class, but when you move away from that to the Web App/Tomcat, I don't see where it's coming into play, but it still seems to be part of the URL you're using to import your client. 2) Shouldn't the name of the additional .xml file be sun-jaxws.xml rather than sun-jax-ws.xml?

    I seem to be getting web.xml and all the rest linked up, but can't find the WSDL when I enter the URL and it's not popping up in Web Services Explorer.

Leave a Reply

Your email address will not be published. Required fields are marked *