aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Query on Ivan Notes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Query on Ivan Notes" Watch "Query on Ivan Notes" New topic
Author

Query on Ivan Notes

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1105
    
    1

I am reading Ivan notes. I am on page 269. Topic is Servlet-Based Web Service Configuration Example



The web service implementation bean declaration and instance variable declarations:



Now in web.xml deployment descriptor, HelloWorldWS class is configured as Servlet



I guess we need to either extend HelloWorldWS class with HttpServlet class OR annotate it with HttpServlet (as per new Servlet version 3.0). In the given code, none of this is done.
So is this web.xml file mapping is incorrect ?

thanks
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1675
    
  25

Abhay Agarwal wrote:
I guess we need to either extend HelloWorldWS class with HttpServlet class OR annotate it with HttpServlet (as per new Servlet version 3.0). In the given code, none of this is done.
So is this web.xml file mapping is incorrect ?

This the old way of creating a WebService as a Servlet-based endpoint. It needs the webservices.xml in combination with the web.xml. Did you include the webservices.xml deployment descriptor?

You can read more about it in the JSR-109:
5.3.2.1 javax.jws.WebService annotation
For Servlet based endpoints using this annotation, fully qualified name of the Service Implementation Bean class must be used as the <servlet-link> element in the deployment descriptor to map the Port component to the actual Servlet.
Following default mapping rules apply for Web modules that contain Servlet based endpoints that use this annotation but do not package a web.xml or a partial web.xml:
  • fully qualified name of the Service Implementation Bean class maps to <servlet-name> element in web.xml.
  • fully qualified name of the Service Implementation Bean class maps to <servlet-class> element in web.xml (also specified in section 7.1.2)
  • serviceName attribute of javax.jws.WebService annotation prefixed with "/" maps to <url-pattern> element in web.xml. If the serviceName attribute in javax.jws.WebService annotation is not
    specified, then the default value as specified in JSR-181 specification is used.


  • Regards,
    Frits
    Abhay Agarwal
    Ranch Hand

    Joined: Feb 29, 2008
    Posts: 1105
        
        1

    thanks for the detailed solution.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Query on Ivan Notes