aspose file tools*
The moose likes Web Services and the fly likes web service using json in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "web service using json in java" Watch "web service using json in java" New topic
Author

web service using json in java

Anupa Nandi
Greenhorn

Joined: Apr 19, 2011
Posts: 4
Hi,

I have to develop a server side web service that will be consumed by an Iphone Application.

I have developed using SOAP and restful web service.But the problem is that when using SOAP I getting wsdl format xml which the client is unable to parse using TinyParser and for restful its wadl which is not support for Iphone aaplication.

Now the client want web service in json format.I have searched a lot in google but unable to get any relevant example from where I could find how to develop web service using json.

Please help me by giving any link where I could find an example or any help will be anticipated

Thanks in advance for your help,
Anupa
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
I don't follow the remarks about WSDL and WADL; those are used to build the client code, not to run the client code. Thus, the iPhone app wouldn't have to parse it.

What, specifically, are you curious about regarding JSON? json.org will tell you all about the syntax, and point you to numerous libraries to create and parse JSON, including several written in Objective-C.


Ping & DNS - updated with new look and Ping home screen widget
Anupa Nandi
Greenhorn

Joined: Apr 19, 2011
Posts: 4
Hi Ulf Dittmer ,

Thanks for reply.
I have to develop web service in java whose return type will be json, means the client will read this json to get the response of the request.

For example,
For login we need username and password.The client will call my webservice method by giving username and password as parameter .The method will return "login succesful" in json format.This is what my requirement.

Hope you get my problem this time.

Thanks
Anupa
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Check out the JAX-RS API for RESTful web services, particularly its Jersey implementation that runs as a Java web app. JAX-RS provides for various result types including JSON.
Anupa Nandi
Greenhorn

Joined: Apr 19, 2011
Posts: 4
Hi,
I am sorry to say I didnot get you properly.Will please be more precise?

Thanks
Anupa
Anupa Nandi
Greenhorn

Joined: Apr 19, 2011
Posts: 4
I have used JAXRS.
The problem with that is when I am using that I am getting wadl format link which is not supported by the Iphone Application as that is being developed in C.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
You don't need to use WADL to create client code. It's easier that way, but not at all required. It's not like building a REST client is terribly difficult. I'm sure there are freely available REST libraries written in Objective-C.
 
 
subject: web service using json in java
 
Similar Threads
New to webservice
CX-311-232 - No Exam Topics at Oracle site?
New To Web Service
New to web service
RESTFul webservice with axis2