rest

Design an XML Web Service & XML Schema for Compatibility with Various Toolkits

I'm planning an XML web service that takes an XML request and returns an XML response over HTTP. It's not SOAP, and it's not pure REST either - I think it might be best described as a POX (Plain Old XML) API. (More details towards the end of this post, if you're interested, but I'm trying to keep my main question general.) My experien...

Serialization of Entity Framework Models with .NET WCF Rest Service

I'm trying to put together a very simple REST-style interface for communicating with our partners. An example object in the API is a partner, which we'd like to have serialized like this: <partner> <id>ID</id> <name>NAME</name> </partner> This is fairly simply to achieve using the .NET 4.0 WCF REST template if we simply declar...

How to create a RESTful web service in asp.net?

Hi Guys, I simply want to create a fairly basic REST service, so that I can expose some of the data in my asp.net/SQL server application to the outside works, like this..... http://domain.com/api/offices - would return an xml set of office locations. http://domain.com/api/offices/15 - would return all the details of office 15. It's al...

Is the WCF REST Starter Kit still current?

I've been researching the possibility of building a REST service in .net and came across the WCF REST Starter Kit. It looks useful but the latest preview release came out over a year ago and there doesn't seem to be a production release. Does that mean it's not being worked on by MS any more? Has it been superseded by something better? ...

CherryPy and RESTful web api

What's the best approach of creating a RESTful web api in CherryPy? I've been looking around for a few days now and nothing seems great. For Django it seems that are lots of tools to do this, but not for CherryPy or I am not aware of them. Later edit: How should I use Cherrypy to transform a request like /getOrders?account=X&type=Y into...

How do I secure password parameters in RESTful web service URIs?

i'm a newbie to server-side programming, so please forgive me if this gets messy. i've been contracted to create a web service to allow authenticated users to access a database. users have to enter a login and password. been reading and reading about REST vs SOAP, and i thought i'd settled on a RESTful design when i came across this s...

Suggestions In Porting ASP.NET to MVC.NET - Is storing SiteConfiguration in Cache RESTful?

I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET to MVC.NET. Ideally I could use all the existing platform's configurations to determine the properties of the site that is presented. Is it RESTful to keep a SiteConfiguration object which contains all of our various page configuration data in...

Internal Java code best practice for dealing with invalid REST API parameters

My colleague wrote the following stackoverflow question: other stack overflow question on this topic The question seems to have been misinterpreted and I want to find out the answer, so I'm starting this new question... hopefully a little more clear. Basically, we have a REST API. Users of our API call our methods with parameters. Bu...

what is RESTful/REST

i am just confused with the two can anybody please provide/explain me brief with an example? ...

Should I allow sending complete structures when using PUT for updates in a REST API or not?

I am designing a REST API and I wonder what the recommended way to handle updates to resources would be. More specifically, I would allow updates through a PUT on the resource, but what should I allow in the body of the PUT request? Always the complete structure of the resource? Always the subpart (that changed) of the structure of the...

Should I use java-based rewrites instead of mod_rewrite?

I want to implement some attractive /path/to/my/app URLs for a java application. There is already an apache instance in front of the app server, with mod_rewrite installed. Do I win anything by using a java-based rewriter like UrlRewriteFilter instead? ...

Howto specify format of Restlet-response in browser?

Hello everybody, i've started to introduce myself into REST. I use as REST-framework Restlet. I have defined a resource with methods for the GET with several response formats like @Get("xml") @Get("json") I now want to test my defined response-formats with my browser, but I don't know which parameter I have to specify in my URL to ge...

REST API unauthenticated requests exception based on the User-Agent

Hi All, I am developing a REST API that supports two kinds of authentication protocols: login form authentication - for browser based clients. Simple Basic authentication - for non-browser clients. I developed a flow in which unauthenticated requests redirected to the "login form", the problem is that this is an undesired behavior f...

Jersey message body reader not found in maven-built JAR

My application uses a REST (JAX-RS Jersey) interface. When I run it in Eclipse, everything' s fine. The domain objects are annotated, I'm not using XML files for the REST mapping. Now I created a standalone JAR using the maven-assembly-plugin, which packs the application and all dependencies in a single, executable JAR file. This also s...

jersey restful + grizzly server + hibernate

I can bring jersey + grizzly server up. But some problem occur during "SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory;" error says "SEVERE: service exception: org.hibernate.HibernateException: /hibernate.cfg.xml not found .. anyone know how to make hibernate can access hibernate.cfg.xml location. ...

How to get this XmlAttribute

From the MusicBrainz REST service, I get the following xml: <artist-list offset="0" count="59"> <artist type="Person" id="xxxxx" ext:score="100"> ... Using WCF and XmlSerializationFormat, I'm able to get the type and id attributes... but How do I get the "ext:score" one? This works: public class Artist { [XmlAttribute("i...

WCF web service Data Members defaulting to null

I am new to WCF and created a simple REST service to accept an order object (series of strings from XML file), insert that data into a database, and then return an order object that contains the results. To test the service I created a small web project and send over a stream created from an xml doc. The problem is that even though all...

RESTful API: How to model JSON representation?

I am designing a RESTful API for a booking application. You can request a list of accommodations. And that's where I don't really know how to design the JSON represenation. This is my XML representation: <?xml version="1.0" encoding="utf-8"?> <accommodations> <accommodation> <name>...</name> <category>couch</category...

What is the correct response for web service?

One of my web services returns the list of ids of the the projects a person is owner of. That is, when I GET http://example.com/wsListProjects?user=eric I get back xml with the list of projects. However, when I specify user=xxx, who doesn't exist, I currently return a 404 response? Is this the correct response to return? Thanks. ...

JSONPBehaviour and multiple formats from WCF service.

Hi, I have a WCF service which I would like to product XML and JSON depending on the URI template. So in my service contract I have methods like the following [ServiceContract] public interface MultiFormatContract { [OperationContract] [WebGet(UriTemplate="/json/data", ResponseFormat = WebMessageFormat.Json)] [JSONPBehavior(callb...