• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web service using json in java

 
Anupa Nandi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anupa Nandi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am sorry to say I didnot get you properly.Will please be more precise?

Thanks
Anupa
 
Anupa Nandi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic