Search code examples
httpmavenwebwebsphere

Router servlet for webservice project


In my recent project i started using maven , instead of depending on RAD to deploy and build ear, i have been coming across little things why to use , which one is best..

My question here is , below code i copied form web.xml and it us com.ibm.ws.websvcs.transport.http.WASAxis2Servlet servlet by ibm to route http request to web services, is there any servlet present from java that can replace the above one , we dont want our ear generation should be dependent on specific application server

<servlet>
    <servlet-name>com.test.HelloWorld</servlet-name>
    <servlet-class>com.ibm.ws.websvcs.transport.http.WASAxis2Servlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>com.test.HelloWorld</servlet-name>
    <url-pattern>/HelloWorldService</url-pattern>
</servlet-mapping>

Solution

  • No.

    The Servlet that you're seeing in the web.xml is an IBM-proprietary Servlet that routes HTTP requests to Web Services and, as far as I can tell, if you're running WAS 7.0 onwards you don't need it. You can simply use JAX-WS to annotate your Web Service class.

    EDIT as per OP's comment

    As you're using WAS 8.5, you have JavaEE 6.0 at your disposal. You don't need any router project anymore. IBM's proprietary router was needed in previous versions of WAS in order to route HTTP requests to Web Services and/or EJBs; however, with JavaEE 6.0, you can use JAX-WS in order to automatically intercept HTTP requests by Web Service classes as well as EJBs.

    If you have a "router" project, you can safely throw it away.