rest

json_decode in PHP to set a cookie..

Hi All, I want to decode Json returned from the WebService, And it should set a cookie, that i want to use to call next WebService API. I am not sure how to set a cookie, and decode this json. I tried decoding it, but get the error. I need to extract sessionId. You can use the WebService.. I have put this on Internet. Here is my code s...

How to set Json.Net as the default serializer for WCF REST service

Is it possible to override the default WCF DataContractSerializer behaviour when Serialize/DeSerialize entities and use JSON.NET instead? I have the following service contract for handling the City entity. For design reasons the City entity has IsReference=true, and therefore the default DataContractSerializer raise errors. For the "GE...

How can I prevent Ext JS from including an entity body in DELETE requests using a restful store?

When Ext JS issues a DELETE request from a restful store, it includes an entity body. Although this doesn't seem to be forbidden by the HTTP spec, Google App Engine doesn't accept such requests. So I'd like to know if there is a way to prevent a restful store from including a redundant entity body on DELETE requests. Details: Using thi...

WCF Rest Mutliple DataContracts Wrapped

So I am calling a wcf webservice using Rest WebHttp. I also have set up a second binding mex for testing. My method is working but when I try to test through fiddler or straight httppost through a client app I get a 400 Bad request error. I am passing mutliple datacontracts to the method. It forces me to use the BodyStyle of wrapped ...

Stick to my REST guns or break statelessness? Advice needed

Dear Abby, I wrote a RESTful servlet, and the UI developer wants to save the logged-in state on the server. He made this strange claim: "I haven't encountered a production REST implementation that is pure REST. The ones I've seen all have had the server maintain a session." I find this difficult to accept. First there's the technic...

How to handle REST Exceptions?

Hi All, We are in the middle of a ongoing discussion about how to handle REST exceptions. Response Content type : JSON Two solutions we have: 1) Throw all the unchecked exceptions as a JSON response. 2) Send Request Invalid Response code. Arguments: When its a error, why return JSON? Just send a invalid response code. Counter Argu...

What are my options for creating an iPhone app from an existing PHP website?

I have an existing PHP/MySQL website that relies hugely on form POSTs for things like signing up, logging in, searching etc. I now need to create a native iPhone app for it. The business requires a native app for marketing reasons, I can't get away with a mobile optimized website. I'm looking for suggestions from someone who has already...

REST idiom for a sub-collection?

My understanding of REST (admittedly limited to pretty much the wikipedia page) is that idiom for GETing a collection is ../resource/ and an item is ../resource/itemId. Is there a standard idiom for GETing for a sub-collection? For example, if the items in the collection have some state toggle (say states A, B, C, D), and I want to be ...

How to totally control json serialization in WCF

I need to totally control the json serialization process in my Rest WCF service. I need to substitute the serialization result, that is something similar to: { foo: 42, bar: 43 } with: myFunc( { foo: 42, bar: 43 } ); any ideas? thanks m. ...

how to expose a service as secure?

hi friends , in a project i want to expose a service to clients for giving a xml file to them. i use web service and soapHeader for authentication. is the way secure? what is foible of it? what is the other Techniques for this aim? i read something about REST. is it for this? ...

REST: post vs posts & new vs create

When you design URL schema for your application, which rules you use? example.com/post/ or example.com/posts/ for list of posts example.com/post/new/ or example.com/post/create/ for new post example.com/posts/ + example.com/post/23/ or example.com/post/ + example.com/post/23/ for list and detail of post? example.com/post/23 or example....

REST resource with a List property

I'd like some feedback on my current architecture. I have a "Person" resource that is available through GET and PUT requests to: /users/people/{key}. The resource produces and accepts "Person" objects in JSON format. This is an example of the JSON that GET /users/people/{key} might return: { "age":29, "firstName":"Chiquita", "phon...

Best practices in terms of replacing a web service?

So we have a busy legacy web service that needs to be replaced by a new one. The legacy web service was deployed using a WAR file on an apache tomcat server. That is it was copied over into the web apps folder under tomcat and all went well. I have been delegated with the task to replace it and would like to do it ensuring I have a ba...

How to manipulate SQL Azure database through pure REST calls

I am an iPhone developer. For one of my clients I am supposed to access their database stored in SQL Azure. I know that there is an Objective C SDK. I have downloaded it and ran the NetFilx example successfully. But of course my client's account is password protected. Also as of now the Objective C SDK seems to provide only read support...

redirect a http request using selenium

This is quite a straight forward question that I can't seem to find a comprehensive answer for. When using Selenium and Selenium proxy, how I can make the proxy catch outgoing xhr requests to specific uri's and modify the destination to a pre-mocked alternative. I found this example form googling, http://www.sonatype.com/people/2009/10/s...

JavaEE6+REST: How do I get all REST resources at runtime?

Hello, everyone! Is there a possibility to get a list of all registered REST resources at runtime? With REST resources I mean: either classes which have annotations such as @Path(...) and are considered by the server at runtime (so traversing all classes using reflection would not do), or URIs of all paths (REST class can have mult...

Is my web service RESTFUL?

I have a REST web service which exposes 2 methods- [POST method] Client will supply a list of objects in the form of an XML. My web service method will insert/update the list of objects based on one attribute in the object [mode = insert/update], and will return an XML with the list of objects and their status[whether insert/update was...

Multiple Insert/Update business objects in REST

I have a requirement where I will receive multiple business objects from the client and my service has to insert/update all of them. Can I implement a REST webservice which will have a POST method and will accept a list of business objects and will update/insert all of them into the system? I have read that we should use a POST method t...

RESTful Zend Framework API

I'm developing a Zend Framework based application and I found myself writing a skeleton for the API module. I read a bit on the web and I started writing the skeleton based on Zend_Rest_Controller. Turned out ok, key login required to use the API. The questions started when a colleague of mine started implementing the skeleton in a prop...

Architecting from scratch in Python: what to use?

I'm lucky enough to have full control over the architecture of my company's app, and I've decided to scrap our prototype written in Ruby/Rails and start afresh in Python. This is for a few reasons: I want to learn Python, I prefer the syntax and I've basically said "F**k it, let's do it." So, baring in mind this is going to be a pretty ...