This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Getting JSON as Response In Axis 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Getting JSON as Response In Axis 1" Watch "Getting JSON as Response In Axis 1" New topic
Author

Getting JSON as Response In Axis 1

Shashank Acharya
Greenhorn

Joined: Mar 20, 2010
Posts: 21

Hello Friends,

I am using axis 1(which comes as built-in in eclipse 3.4) fro my current running web service.Now as per new requirement I want the response this web service in JSON.Can anyone help me out that how to solve this.Currently the response is in xml format.

Thanks In Advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
AXIS 1 only does SOAP so XML is what you get. Incidently AXIS 1 is really really outdated.

RESTful services easily return JSON, XML or any type of resource. Search for the jersey project or restlet to find some RESTful tools.

I'm assuming your client for JSON is a web page in a browser, right?

Bill


Shashank Acharya
Greenhorn

Joined: Mar 20, 2010
Posts: 21

Hi Bill,

Can I switch to axis 2 for json response?

Sorry for that I haven't mentioned my client.Basically my client is mobile app in android.

I surely search for jersey.

Thanks for your reply.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I don't think any serious web service programmer recommends AXIS 2 for anything but SOAP.

Jersey and Restlet are so very very very much easier.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting JSON as Response In Axis 1