• 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

Is there a tutorial for SOAP 1.2 HTTP GET using JAX-WS?

 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Section 4.1.1 SOAP HTTP GET Usage of the SOAP Version 1.2 Part 0: Primer (Second Edition), the Example 8a shows this GET request:

GET /travelcompany.example.org/reservations?code=FT35ZBQ HTTP/1.1
Host: travelcompany.example.org
Accept: text/html;q=0.5, application/soap+xml

And it shows a corresponding SOAP response within a HTTP response. I guess this is in SOAP 1.2, but was not part of 1.1.

I can issue the HTTP GET to a URL. I realize that with the query parameters, it looks like JAX-RS, but I would like to achieve this using JAX-WS.

My question is: How to write the backend web service that accepts the HTTP GET and returns a SOAP response? Is there a coding example or tutorial for this?

I am very new to this and EJBs. Any help and comments are very much appreciated, e.g. if my statements or assumptions above are wrong. TIA!

Srini
 
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!

R Srini wrote:My question is: How to write the backend web service that accepts the HTTP GET and returns a SOAP response? Is there a coding example or tutorial for this?


Using different techniques for implementing a web service according to the question:
- JAX-WS
JAX-WS is, as far as I know, out of the question since it will only accept POST request.
There is the javax.xml.ws.Provider<T> interface, which will allow you to implement a web service endpoint implementation class that accepts any kind of payload. To be able to supply payload, the client would still have to use POST.
- JAX-RS
JAX-RS is a more likely candidate.
As of JavaEE 6, EJBs can be annotated with JAX-RS annotations to be exposed as RESTful web services.
Using EJBs gives you container managed threads, support for transactions, method level security etc.
- Servlet technology.
This is the basic technology used to implement Java web services and it can be used to implement most anything using HTTP.
Using servlet technology, you have to consider thread issues yourself, the container only supports more coarse grained security (compared to EJBs).

I have not seen any tutorials regarding the subject.
What are your motivations for wanting to implement such a service?
Best wishes!
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ivan, Thank you for the detailed response!

What are your motivations for wanting to implement such a service?



I would like to learn more about web services and then take the SCDJWS exam, and I am studying the material. As I go along, I like to also write some simple examples to understand the material. Hence my question.

One more question: So with Java EE 6, can I mix and match JAX-RS and JAX-WS services in the same project? I am learning using the latest version of Netbeans, and I think it supports JAX-RS. So I will try that. Thank you!

Srini

 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic