Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAX WS With REST

 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am able to fetch the value if i pass the value through URL as name-value pair(GET method- QUERY_STRING).How to get the value if i pass the value by POST method. Its returning as null when its passed by POST.

My first post in Java Ranch
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Are you certain that POST parameters are supported by the JAX-WS REST support? RESTful services generally use the URL for transporting parameters. And, of course, the JAX-WS REST support has been made obsolete by JAX-RS and its Jersey implementation.
 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ULF. I am just trying to figure it out whether i can able to fetch the post value.

I just googled and found a link where they are passing the value through POST.
http://www.java2s.com/Code/Java/Web-Services-SOA/RESTbasedWebServicesusingtheHTTPbindingandJAXWSProviderDispatch.htm

What is the basic difference or advantage AXIS2 with REST over JAX WS with Rest ?

Vignesh
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Axis2 an implementation of the JAX-WS API; it has some other REST facilities (search for "REST/POX" in the Axis documentation), but since those are Axis-specific I'd stay away from them. If I wanted to use REST with Java, I'd look into JAX-RS first.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, the attempt to cram REST into Axis2 is clumsy and doomed to be a side-show. I dont see how it could ever be a complete implementation of all REST concepts.

The Jersey project is an open source implementation of JAX-RS - as a fresh start it is a lot cleaner than tools that attempt to graft REST onto a SOAP foundation.

Bill
 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I can able to get POST value using InputStream class. I like to know whether it will degrade the performance as well as is there any other way to get Post value.

Vignesh
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cliff Ahead

 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
I am newbie to java ranch !! So can you please let me know, what that img represent !!
Should i need to carry on with my approach?

Vignesh
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it means you should not go that way. If you find yourself having to deal with the input stream, then you're most likely on the wrong track. And if you're extracting parameters you might as well use a regular servlet, which at least does that for you.
 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf.If we use Service and Dispatch class in client side and set the value in post ,then there may be a chance to work.
But my scenario is entirely different. Client side is not using java.So i decided to go for JAX WS with REST ,since
client need to invoke only the URL (there is no need for WSDL,Stub files creation).

Vignesh
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vignesh Bhupathi wrote:So can you please let me know, what that img represent !!


It means you've been given good advice that you seem to be ignoring and seem determined to "walk off the cliff" even when advised not to.
 
Vignesh Bhupathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
I am just analysis and trying to find a solution for my problem.Thanks a lot for your suggestion.
I won't use InputStream class since it will degrade the performance and a servlet can do this, but right now i have no other choice.
So how can i achieve this ?

Vignesh
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. STOP thinking in terms of JAX-WS
2. BACK UP a couple of thousand meters
3. THINK about how to define your problem in general terms without reference to ANY toolkit
Use pencil and paper or whiteboard to diagram the various parts of the application and how data moves around.
List outside requirements you have no control over.
4. SELECT the least complicated way to accomplish the essential requirements (see 3.)

Bill

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic