The most intelligent Java IDE
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Web Services
 
RSS feed
 
New topic
Author

JAX WS servlet end point

Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Messages: 62

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>

the following is my web.xml file.

<servlet>
<description>JAX-WS endpoint - fromjava</description>
<display-name>hello</display-name>
<servlet-name>hello</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet>
<description>JAX-WS endpoint - fromjava</description>
<display-name>helloRPC</display-name>
<servlet-name>hello2</servlet-name>
<servlet-class>test.myService</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/HelloService</url-pattern>
</servlet-mapping>


<servlet-mapping>
<servlet-name>hello2</servlet-name>
<url-pattern>/HelloService2</url-pattern>
</servlet-mapping>
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Messages: 960

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
Messages: 62

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
Sheriff

Joined: Mar 22, 2005
Messages: 26787

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).

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Messages: 62

I removed the entry from web.xml, but still i am getting 'resource not available' when i tried to see the wsdl.
Please find the attachments.
[Thumb - jaxws conf files.JPG]
 Filename jaxws conf files.JPG [Disk] Download
 Description
 Filesize 125 Kbytes
 Downloaded:  5 time(s)

[Thumb - jaxws.JPG]
 Filename jaxws.JPG [Disk] Download
 Description
 Filesize 166 Kbytes
 Downloaded:  4 time(s)

This message was edited 2 times. Last update was at by Jobin Mathew

Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26787

Not sure what's going on, you might want to compare your setup with the one described in http://www.coderanch.com/t/223670/Web-Services/java/Deploy-JAXWS-Mustang-WS-Tomcat

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Messages: 62

In that post also, the servlet class is given as

<servlet-class>
com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>


But in some tutorials they listed only the implementation class here.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Messages: 960

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
Sheriff

Joined: Mar 22, 2005
Messages: 26787

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
Messages: 196

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.

My Blog
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Messages: 62

"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


http://java.sun.com/blueprints/guidelines/designing_webservices/html/architecture5.html#1127196
http://www.lalitbhatt.com/tiki-index.php?page=JAX-WS%20Servlet%20Endpoint
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Messages: 196

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.

My Blog
Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Messages: 62

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>
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Web Services
 
RSS feed
 
New topic
IntelliJ open source