• Post Reply Bookmark Topic Watch Topic
  • New Topic

REST WS Integration help

 
Markus Olsson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm very new to REST and can't quite understand how it works. But now I'm in a situation where I need to learn, I've read some about it but have quite a hard time understanding exactly what it is and how it works.

What I got is a quite large back-office system (with database and a front soap web-service) and a web-page that only uses the front web-service. What I need to do is integrate a REST web-service into this system. But I'm getting really confused by the overall documentations, as I've understood it, I need to integrate the REST system on the web-site. This is not what I want, I really want to integrate it to my own back-office system seeing I don't have any access on the web-site to database or any data at all.

So now here is some questions about REST, according to my documentation I can either use a Domain Cookie or URL Rewrite to integrate the REST system, and can I do that from my back-office or do I have to integrate from the web-site?

Is REST only meant to be used as web-site to web-site calls? What is the best way to proceed with integrating a REST web-service?

Any "REST for dummies" guide would be great to help my understand, or any simple explanation of how it works? Do I even need to approach this any differently from a "normal" web-service?

Best Regards,
Markus
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Disclaimer: The comparison of a REST web service to a database may not be entirely appropriate, but is a simplification to aid in introducing the REST concept.

If the REST web service is done properly and really adheres to the REST guidelines, then you can think of it as the different URLs of the service exposing different tables in a database.
For instance http://myserver.com/resources/employees expose the employees resource which contains all the employees of a company.
If I issue a GET request to http://myserver.com/resources/employees, then I should get a list of all the employees - compare to the SQL statement "select * from employees".
If I issue a GET request to http://myserver.com/resources/employees/123, then I should get the representation of one single employee - compare to the SQL statement "select * from employees where id=123".
If I issue a POST request to http://myserver.com/resources/employees with the representation of an employee as the payload, I create a new employee - compare to adding a row in a database table.
Etc.

REST web services can be exposed to any kind of client, not necessarily web GUI clients.
If you haven't seen it already, I recommend the Wikipedia article on rest, especially the section on constraints and guiding principles: http://en.wikipedia.org/wiki/Representational_State_Transfer

If I were to expose resources of an existing system (resources is the keyword here) as a RESTful web service then you need to enumerate the resources and find any relations between the resources.
Note that REST is NOT RPC calls using HTTP and XML and it is indeed different than SOAP web services, which tend to be functionally-oriented.

This is a too brief attempt to answer your question - I would recommend reading a book on RESTful web services and play around with some examples.
Best wishes!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!