rest

REST service with binary data

Hi I want to create Restful service which can accept binary data. I've implemented javax.xml.ws.Provider interface, but i can't get content of request. If I use javax.xml.ws.Dispatch then its send only XML data, but I need transfer binary data. Please give some solution, but I don't prefer to use JAX-RS or Restlets. Thanks. ...

How to generate RESTful client in JAVA for REST defined in WSDL

Hello everybody! I know that WSDL is for defining SOAP based web services but in most of the WSDLs I saw on net, in the WSDL is defined also RESTful "web service"-http:binding. To generate client for the SOAP I used wsimport tool from JAX-WS (it also generates client classes for the REST but it doesnt work). So the question is, how to...

RESTful API: How to handle translated textfields in representations?

I am designing a RESTful API for a booking application. There are accommodations that you can request a list or the details. As the application targets a multi-language audience, the descriptions are (sometimes) available in different languages. Now I'm not sure how to handle these translations in the representation of an accommodation...

HTTP Response 412 - can you include content?

I am building a RESTful data store and leveraging Conditional GET and PUT. During a conditional PUT the client can include the Etag from a previous GET on the resource and if the current representation doesn't match the server will return the HTTP status code of 412 (Precondition Failed). Note this is an Atom based server/protocol. My...

Designing router & controllers in RESTful architecture

Simple examples of controllers in a RESTful architecture suggest four actions per controller -- index, create, update, delete -- corresponding with the GET, POST, PUT, and DELETE. But beyond that I still find a dozen little decisions: Do you have a different controller for resource collections (example.com/things) than you do for an i...

Generating PDF's via Delayed Job while maintaing a RESTful pattern.

Hi, currently I am running a Rails app on Heroku, and everything is working great with exception of generating PDF documents that sometimes contain thousands of records. Heroku has a built-in timeout of 30 seconds, so if the request takes more than 30 seconds, it's abandoned. That's fine, since they offer delayed_job support built-in. ...

Easiest RPC client method in PHP

I've been asked to help a friend's company to bring up a web application. I have very limited time and I reluctantly accepted the request, at one condition. As most of the logic goes on in the back-end, I suggested that I would finish the complete back-end only, allowing a front-end developer to simply interface with my backend. I pl...

Should I separate RESTful API controllers from "regular" controllers?

This seems like an elementary question, but after a lot of searching around I can't seem to find a straightforward explanation: If I'm building a web application that is going to be accessed largely through a web browser, but that will also support some API requests in a RESTful way, should there be a large degree of separation between ...

which service response is good for iphone development?

I have to create a web service for iPhone. So I would like to know which web response is the best for iPhone app developement(SOAP vs REST vs XML vs JSON vs ... any other). Is there any good example to access webservice for the best web response? ...

How to send XML and other post parameters via cURL in PHP

Hello. I've used code below to send XML to my REST API. $xml_string_data contains proper XML, and it is passed well to mypi.php: //set POST variables $url = 'http://www.server.cu/mypi.php'; $fields = array( 'data'=>urlencode($xml_string_data) ); //url-ify the data for the POST $fields_st...

Real world example wcf with rest and soap end points

Hi guys I've been looking around for good wcf samples which expose both WCF and REST endpoints with end to end examples and I am having a bit of trouble finding anything concrete. There are a lot of samples which say you can do this or you could do that, but nothing that really seems to bring it all together. For instance, I'm looking...

How do I access a REST API on the iPhone?

So I'm brand new to rest's API and have never used an API ever before. I'm ok with Objective-C and Cocoa Touch but just have no clue where to start when accessing the API and how to in general. Can someone help me get started with some code that will access titles in rest or just how to access a REST API in general with authentication. T...

How to access a web service behind a NAT?

We have a product we are deploying to some small businesses. It is basically a RESTful API over SSL using Tomcat. This is installed on the server in the small business and is accessed via an iPhone or other device portable device. So, the devices connecting to the server could come from any number of IP addresses. The problem comes wit...

UriTemplateTable not distinguishing verbs

I have trying to design a REST service in .NET 3.5 with WCF REST Contrib. My service is nearly working fine, but I am facing a bizarre error. Basically, I have two methods: [WebInvoke(UriTemplate = "/books?id={identity}", Method = "PUT")] public string InsertBook(string identity, Book book) { // snipped } and [WebInvoke(UriTemplate...

How to validate HTTP request headers before receiving request body using WCF

I'm implementing a REST service using WCF which will be used to upload very large files. The HTTP headers in this request will communicate information which will be validated prior to allowing the upload to proceed (things like permissions, available disk space, etc). It's possible this validation will fail resulting in an error respon...

Return <bar>foo</bar> instead of <string>foo</string> in WCF rest method

I have a REST web method in .NET 3.5: [OperationContract] [WebInvoke(UriTemplate = "", Method = Verbs.Get)] public string GetBar() { return "foo"; } The response gets formatted as <string>foo</string> while I would prefer <bar>foo</bar> instead. Does anyone know how to do that? I feel I am missing something obvious. ...

Java REST implementation: Jersey vs CXF

What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML. I also would like to know what library is most supported by the community e.g. tutorials, documentation. ...

Follow an user in twitter via Rest API

Hello. How using the twitter rest api can i follow a user in something like this format: http://myuser:mypassword@urloftwitterapi/follow?user=useriwannafollow There is a very simple method like this? Thanks ...

Routing trouble for RESTful API - Rails

I'm building out an API for web app that I've been working on for some time. I've started with the User model. The user portion of the API will allow remote clients to a) retrieve user data, b) update user information and c) create new users. I've gotten all of this to work, but it doesn't seem like its setup correctly. Here are my q...

Config for WCF with multiple endpoints

Hi guys I'm new to WCF and am trying to get some ideas I have off the ground. Basically I have a web WCF Application project with the following in its web.config: <system.serviceModel> <services> <service name="WcfService1.ServiceContract.IDirectorySearchService" behaviorConfiguration="defaultServiceBehavior"> ...