I tried deploying JAX Ws Servlet webservice in tomcat. If i give servlet class as <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> , i am getting the wsdl when i hit the URL.
But if i give my implementation class as servlet class it is not showing the wsdl.
<servlet-class>test.myService</servlet-class>
Hi!
Isn't the servlet deployment descriptor generated by the container when deploying the web service?
Best wishes!
This message was edited 1 time. Last update was at by Ivan Krizsan
Jobin Mathew
Ranch Hand
Joined: Oct 17, 2006
Posts: 82
posted
0
I already created web.xml and sun-jaxws.xml. Are you talking about server-config.wsdd?
Everything is fine if i give <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
Are you developing a servlet or a web service? If the latter, then it should be listed in the sun-jaxws.xml file, not the web.xml file. In the web.xml file you need just the WSServlet declaration (and the WSServletContextListener listener).
But in some tutorials they listed only the implementation class here.
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2160
posted
0
Hi!
Specifying the endpoint implementation class that not is associated with an EJB is, according to the JSR-109 specification, allowed.
This would be a so-called servlet-based web service.
I recall that, when playing around with deployment descriptors when deploying a web service, if I had a web.xml deployment descriptor, then I also needed a webservices.xml deployment descriptor.
For details, see page 263- in my document that can be found here: http://www.javaforum.se/jforum/posts/list/549.page Best wishes!
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
I recall that, when playing around with deployment descriptors when deploying a web service, if I had a web.xml deployment descriptor, then I also needed a webservices.xml deployment descriptor.
I don't think that applies here - it's a "JAX-WS RI in Tomcat" scenario, where no webservices.xml file is involved.
Vinod K Singh
Ranch Hand
Joined: Sep 30, 2008
Posts: 198
posted
0
Jobin Mathew wrote:I removed the entry from web.xml, but still i am getting 'resource not available' when i tried to see the wsdl.
The listing of HelloService2 is visible because it is defined in sun-jaxws.xml file but WSDL is inaccessible as there is no Servlet configured in web.xml to handle the /HelloService2 URL.
"The listing of HelloService2 is visible because it is defined in sun-jaxws.xml file but WSDL is inaccessible as there is no Servlet configured in web.xml to handle the /HelloService2 URL"
I agreed with this. But how can i see the wsdl here? In many examples i can see the servlet class is gievn as the implementation class instead of <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>. But I can see WSDL only if i give servlet class as com.sun.xml.ws.transport.http.servlet.WSServlet
Jobin Mathew wrote:I agreed with this. But how can i see the wsdl here?
Just uncomment the servlet mapping part for the HelloService2 in web.xml, you should be able to see the WSDL.
Jobin Mathew
Ranch Hand
Joined: Oct 17, 2006
Posts: 82
posted
0
In that case also it is giving "The requested resource (Servlet hello2 is not available) is not available."
But I can see the WSDL only if i give servlet class as <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
Jobin Mathew
Ranch Hand
Joined: Oct 17, 2006
Posts: 82
posted
0
If am adding my servlet service in web.xml, the servlet class should be WSServlet or my own servlet class?
From my experience only WSServlet is working properly. Is this correct?
Jobin Mathew wrote:If am adding my servlet service in web.xml, the servlet class should be WSServlet or my own servlet class?
From my experience only WSServlet is working properly. Is this correct?
So, for all the webservices i need to give the same servlet class as "com.sun.xml.ws.transport.http.servlet.WSServlet", right?
and there is no need of giving my own servlet class in web.xml?
Vinod K Singh
Ranch Hand
Joined: Sep 30, 2008
Posts: 198
posted
0
Jobin Mathew wrote:So, for all the webservices i need to give the same servlet class as "com.sun.xml.ws.transport.http.servlet.WSServlet", right?