I am trying to deploy the JAX-WS Webservice on glassfish as given in the up & running example. I created the simple webservice with with @WebService annotation and packaged it as WAR and deployed in glassfish. I can see that it got deployed successfully but when I try to access the wsdl url, as mentioned in the book, it doesn't come up. It gives resource not found error. The example code:
If I add web.xml and sun-jaxws.xml with the WAR and configure it as following then I am able to access the wsdl:
Now I can access the wsdl using: http://localhost:8080/webservice2/team?wsdl. As per the book the Metro, bundled with glassfish, will automatically generate all the dependent class files, which we generate using wsgen, and also webservice.xml & sun-jaxws.xml which doesn't seems to be happening. Do I need to do some customization to make it happen automatically with providing my own custom web.xml & sun-jaxws.xml?
The context root of my web-app is "webservice2" (have deployed as webservice2.war in glassfish). When I try to access the WSDL for Teams service (as mentioned in below code) with URL http://localhost:8080/webservice2/TeamsService?wsdl, it doesn't come up and gives 404 error.
But as I had mentioned in my previous msg that I can access the wsdl with url http://localhost:8080/webservice2/team?wsdl only when I have web.xml & sun-jaxws.xml configured. But let's say I only bundle the Teams class in a WAR and deploy then will glassfish will be able to deploy it as a webservice automatically as mentioned in the Java Webservice Up & Running book. The book says we can access with URL: http://localhost:8080/webservice2/TeamsService?wsdl which I am not able to access it after deploying without any deployment files.
Today again I deployed the war and it worked. I can see the wsdl & tester URL for the deployed war. Not sure what was the problem with earlier deployment as I haven't done any code or config changes.
Thanks for your help and prompt reply.
Note: I am using the glassfish 4.0.