rest

SOAP or REST suitable for non-query-response communication?

We are building a proprietary system involving a client and a server linked over TCP/IP. Occasionally, the server will have some new expected or unexpected information that would be of interest to the client. My understanding is that SOAP and REST are query/response systems that require the client to request something and the server re...

ExceptionMapper issue in RESTEasy

So in my JAXRS application, I have 2 ExceptionMapper registered as @Provider public class MyExceptionMapper implements ExceptionMapper<Exception> {...} public class MyCustomRuntimeExceptionMapper implements ExceptionMapper<MyCustomRuntimeException> {...} When my application throws a new "MyCustomRuntimeException", the exception is ca...

[WCF] REST, how to send data from the client to the server using POST?

I am struggling sending data from my rest client to my rest server... I have created a rest server sending xml to the client, and that works well. However, sending data from the client to the server, I am having a hard time. Client: _httpClientRead = new HttpClient("http://127.0.0.1:8000/"); var form = new HttpUrlEncodedForm(); form.A...

Difference between WCF rest starter kit and Web Application Toolkit for REST Services

Whats the difference between http://code.msdn.microsoft.com/WebAppToolkitREST and http://www.asp.net/downloads/starter-kits/wcf-rest? ...

Using POST in Rest with .Net

I have successfully added and used a Get action in my new REST-service in .Net using WCF and the Rest-toolkit. The service is defined like this: [OperationContract] [WebGet(UriTemplate = "/{id}")] Foo GetFooById(string id); And I call it like this from the client side: public Foo GetFoo(string id) { var httpClient = new HttpCli...

How should I update a REST resource?

I'm not sure how I should go about updating individual properties of a REST resource. Consider the following example: # HTTP GET to /users/1.xml <?xml version="1.0" encoding="UTF-8" ?> <response> <user> <id>1</id> <name>John Doe</name> <email>[email protected]</email> </user> </response> How should I facilitate for ...

Interview Question - How to handle SOAP Based and REST based Exceptions

Can some one provide a very specific and to the point answer for this question ? ...

What is the best Java RESTful framework for a very simple backend server?

I need to develop a very thin shim for hadoop to be used together with Rails/Sinatra application. I'm a .Net developer and have a lot experience with Ruby. So what is the best framework to choose giving the fact it is needed for a very small project and it should provide RESTful web services. I looked at Grails and it seems to be very r...

HTTP GET REST Web Service returns XML but file_get_contents returns blank

I am using PHP to interact with a Web Service using REST and HTTP GET requests to call on the available APIs to return XML data. When testing via the address bar, I get the expected XML content. So the next step I tried was to read that XML data or store the values returned into a string. But when I use file_get_contents I don't get a...

I can't create a clear picture, why and when to use RESTful services?

Why and when to use RESTful services? I know how to create a WCF webservice. But I am not able to comprehend when to use a SOAP based service and when to use a RESTful service. I read many articles on SOAP vs REST, but still, I don't have a clear picture of why and when to use RESTful services. What are some concrete points in order to...

Spring 3.0 RESTful Controller Fails on Redirect

I am setting up a simple RESTful controller for a Todo resource with an XML representation. It all works great - until I try to redirect. For example, when I POST a new Todo and attempt to redirect to its new URL (for example /todos/5, I get the following error: Error 500 Unable to locate object to be marshalled in model: {} I do know...

ASP.NET Web Service POST/GET via REST unavailable?

I'm working with a .NET based Web Service where some of the API calls can be accessed via HTTP POST/GET but on others only SOAP 1.1/1.2 are available. The company that has developed the API have come back to me have said the following and I was wondering if he's trying to pull the wool over my eyes or whether he's speaking the truth. H...

[Python] Upload a file with rest

Hi, I created a rest api using django and piston and I need to create a script that uploads a file to that api. currently I'm using this code: import urllib import urllib2 user = 'patrick' password = 'my_password' url = 'http://localhost:8000/api/odl/' password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() password_manager.add_...

WCF wrap variable complex types for REST

Hey all, I'm implementing a lo-REST API and looking to return either XML or JSON. Building it in .NET WCF. I like the design of both Flickr and Last FM APIs which wrap their variable complex types in a simple response ala: <lfm status="ok"> <user> <name>RJ</name> <realname>Richard Jones </realname> <country>UK</countr...

curl - looking to test some Rest APIs - what is the syntax to Post xml to a rest api with basic authentication?

curl - looking to test some Rest APIs - what is the syntax to Post xml to a rest api with basic authentication? ...

PHP: How to send REST requests with XML data

Hi! I need to make a request to an API, using REST (POST method) in PHP. But the data needs to be in XML format. How can I send REST requests with XML data? Thank you! ...

How to validate the Content-MD5 header (from the actual content) in a RequestInterceptor (WCF REST Starter Kit) - REST web service

Hello, I'm implementing REST web services by means of the WCF REST Starter Kit. I get the request in a System.ServiceModel.Channels.RequestContext. Specifically: the interceptor starts this way: Public Overrides Sub ProcessRequest(ByRef requestContext As RequestContext) If the request includes the Content-MD5 header, I must validate ...

How should I handle unsupported verbs on a resource?

I am developing a RESTful framework and am deciding how to handle an unsupported verb being called against a resource. For example, someone trying to PUT to a read-only resource. My initial thought was a 404 error, but the error is not that the resource cannot be found, it exists, just the user is trying to use the resource incorrectly....

Server-side Twitter client possible with OAUTH?

Twitter'll phase out HTTP basic authentication by August 2010. In the link my scenarios are from Desktop Applications. Basically my client should tweet new posts on a website. This would be incredibly simple with HTTP basic auth, because I can store and use my account's username and password in the app to authenticate. However, with OAU...

REST best practice for accessing a resource using two attributes

Hi All I have unique RESTful resources which can only be identified in the system with two attributes. What I want to know is what is the best practice approach to do this. The resource is identified with an id attribute (which is not unique) and a name attribute (which also is not unique), however the combination of both attributes i...