*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Handlers and Providers Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Handlers and Providers Interfaces" Watch "Handlers and Providers Interfaces" New topic
Author

Handlers and Providers Interfaces

Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Hi,

I got two questions

The first one:
How do I map between an (Endpoint Service Interface : A class annotated with the @WebService annotation) and a URL pattern ??
Same question goes for the Provider, how do I map between the Provider class an a URL Pattern.

To more clarify my question, I want the Web Service represented by the annotated class CalculatorService to be bound to the context /khaled_calc

The second one:
How can I add handlers in the client when invoking a web service.

Thanks in advance.


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Khaled Mahmoud wrote:
How do I map between an (Endpoint Service Interface : A class annotated with the @WebService annotation) and a URL pattern ??

The same way as you would do with a regular web application. This applies to web service endpoints annotated with either @WebService or @WebServiceProvider.
Typically, the context will be the same as the name of the WAR file. If your web service is deployed in an EAR, then it is possible to configure the root in a file named application.xml.

How can I add handlers in the client when invoking a web service.

See section 9.5 of my SCDJWS study notes for a complete example.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
Regarding my first question, I mean specifying a mapping for a Web Service annotated class as you do for the regular servlet.

Let's suppose that the web application context is : /SCDJWS

How I specify :



  • The Web service associated with annotated class (Calculator) is accessible at the URL: /SCDJWS/Calculator1234


  • The web service served by the provider class StockProvider is accessible at the URL /SCDJW/StockSRV


  • Thanks in advnace
    Ivan Krizsan
    Ranch Hand

    Joined: Oct 04, 2006
    Posts: 2198
        
        1
    Hi!
    Have you tried using the web.xml deployment descriptor?
    As far as I recall, this is where you would set the mapping for a servlet, in the case of deploying using a WAR-file.
    Best wishes!
    Khaled Mahmoud
    Ranch Hand

    Joined: Jul 15, 2006
    Posts: 361
    Hi,

    I have seen a tutorial on the Internet that does the mapping in [web.xml], in the <select-class>, it uses the annotated service class fully qualified path. I tried this way, and it did not work .

    Any clues ??
    Ivan Krizsan
    Ranch Hand

    Joined: Oct 04, 2006
    Posts: 2198
        
        1
    Hi!
    In my SCDJWS study notes, on page 263 and forward, there is an example on how to set up a web.xml deployment descriptor for a web service.
    Have you seen this example?
    I remember that deploying a web service with a web.xml deployment descriptor that you have written yourself was a little tricky.
    Best wishes!
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: Handlers and Providers Interfaces
     
    Similar Threads
    xsd:anyType
    How to create a notification webservice
    SOAP message with attachment server-side implementation
    Hi..help required
    Regarding javax.xml.ws.Provider interface