• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handlers and Providers Interfaces

 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 2198
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 361
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 2198
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic