• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handlers and Providers Interfaces

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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!
     
    Yes, my master! Here is the tiny ad you asked for:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic