HI, i Have developed a restful webservice sample application, i want to create a client for the webservice, can anyone tell me how to do this? i was used Rest WebService explorer, but i want to know how to create a client and call the methods ?
Please help ?
Since REST is talking HTTP and is language-agnostic, you can use most any language/tooling available. Of course the simplest test bed available to you is the browser itself.
Have a look at these tools:
http://code.google.com/p/rest-client/
https://github.com/cloudhead/http-console
https://tcpmon.dev.java.net/ (proxying is helpful for debugging)
You can also use Resty, which should make accessing your webservices very easy.
https://github.com/beders/Resty
(see Readme for examples)
Related
I am trying to create a RESTful web service that accepts JSON arguments and gives out a JSON response.
What I want is to accept HTTP requests made to my URL endpoint.
Something like,
POST /the/endpoint HTTP/1.1
Host: mywebsite.com
{"name":"yourname", "department":"your_department"}
Do a DB read at the backend and give relevant parameters like, say Manager name, salary etc as a JSON object, as the response.
What's the best way to go about it? I was thinking of using Java servlets for this? Is there a better way?
PS - I am just getting started so detailed answers or links to tutorials as to how to implement it would be much appreciated.
Thanks.
Yes you can easily do this with Servlets and some Json Libs for Marshalling /unmarshalling the Json Object to Java Object.
You can make use of Json libs like
Jackson ,
Gson etc
But you must know that REST application doesnt end with just handling the request and response , but it needs to take care of other non-functional requirements like
Authentication
Authorization
Security etc
Building this from a scratch from a Servlet is overkill and waste of time when there are ready made frameworks that these things for you
My favorite is Spring MVC 3.0
Check their project site for more details
Just to show you how easy to set up one in Spring MVC , check this below tutorial
Spring 3 REST Tutorial
Pls rate the post if it helps , Cheers.
If you want to go with Java, I suggest that you take a look at JAX-RS... And since REST is a complex topic, here is a url with tons of informations on it. http://code.google.com/p/implementing-rest/
As a complete beginner, I believe the best way to implement a (nearly) RESTful API without having to read a lot is simply to implement the API just using HTML pages and HTML forms with the back-end processing to handle them.
The rules are:
Use <a> tags to provide links to related resources. (navigation)
Use <form> tags to initiate any kind of processing operation on the server. (actions)
You can then make it properly RESTful by using progressive enhancement to add Javascript AJAX requests that perform PUT, PATCH, and DELETE instead of using POST for those three (of course, keeping POST for creating resources where the client doesn't know the resultant URI).
You can then click around and test the API in a web browser! Tools like Selenium can automate this.
If you need to provide JSON, this can be added after the API has been designed and tested, although libraries exist to process HTML or XHTML responses too, so JSON isn't necessarily required for machine readability.
if you are using php with symfony try:https://github.com/FriendsOfSymfony/FOSRestBundle this lets you create a real REST full servicer very quick.
Vogella made my day very easy when i started Web services with an super example here with eclipse screen shots ..Have a look here.
I am facing a challenge to upload & download data, to and from the server using RESTful web services.
Is it possible to use a RESTful service client, if possible any way to achieve that in an iOS app to send data to the service.
#Ajay: As Claus mentioned there are number of public frameworks/wrappers are there, you can use them for RESTful service interaction from your code. The one I frequently use is ASIHttpRequest, quite handy and easy to use. There are enough examples out there with ASIHttpRequestyou can use it as reference.
Let me know if that helps.
You question is not clear. Do you need to push data from the server to the iOS app using a REST service?
If so, REST does not provide an interface for push. (It only provides a client->server Create/Read/Update/Delete API).
Take a look at ASIHTTPRequest or use RestKit for some more advanced stuff!
RestKit works really nice!
i want to read and write data to a website (server on web) and don't have any information about webservices and other things that related to it
Does anybody have any idea about how to start it (mean offer complete books,papers,tutorials,websites,… or what should i learn at first mean is it necessary to learn xml,soap,... and other things)
Thank you
I've used Google App Engine with great success. You would format your data to output as JSON and use an iPhone library to read it. I've used this one (though Touch JSON seems to be more popular).
Read about REST, ROA and AtomPub. Thats got me started. I'm about to implement some webservices in WCF (WCF now acts like a RESTFul webservice, but you can also use plain old SOAP). Before I got to WCF, I experimented with RoR. RoR uses REST "out-of-the-box".
Hi i am new in iphone development. i have task to develop the application to get the web service.
I try to find source but i found some source but it cant give me any output.
So please help me and provide any example if it is possible.
I use ASIHTTPRequest for most network needs. However, it does not directly support SOAP. I don't know of any iPhone library that does. If you can address your web service without the overhead of SOAP then ASIHTTPRequest will make it simple for XML or JSON. If you really have no choice but to use SOAP then the following may help
http://devmylife.com/?p=111
I am writing an application using GWT on Windows that needs to do some network calls.
I know that if these aren't to the same machine I'm developing on I need to setup a proxy, right?
I was just wondering if anyone could help with what my GWT code would look like?
What proxy should I use on Windows?
Thanks!
If you're simply requesting data from a RESTful service from a different domain, you can use JSONP (http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html).
If you're trying to post data, you'd have to perform the network calls on the server side. (There are some hackish ways to try to submit via a hidden iframe, but they're non-standard). What this means is that you simply invoke a method on your server which does the network call (see http://code.google.com/webtoolkit/tutorials/1.6/RPC.html).
If you mean Google Web Toolkit, and you're trying to evade cross-domain scripting restrictions, check out Yahoo's how-to guide. There's even PHP sample code.
Why not perform the network calls in server side? That way you are not restricted to cross domain restrictions.
I think this is what you are looking for:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3131