jQuery in Action, 2nd edition*
The moose likes Web Services and the fly likes Is there a tutorial for SOAP 1.2 HTTP GET using JAX-WS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Is there a tutorial for SOAP 1.2 HTTP GET using JAX-WS?" Watch "Is there a tutorial for SOAP 1.2 HTTP GET using JAX-WS?" New topic
Author

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

R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
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
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
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

 
GeeCON Prague 2014
 
subject: Is there a tutorial for SOAP 1.2 HTTP GET using JAX-WS?