I am starting a web project in which I would like to have a RESTful Java back-end and a PHP front-end that consumes it (its my first time using REST, although I have a lot of experience with Java and PHP). I have found a few frameworks for this, namely the Guzzle PHP framework, and the Restlet Java framework. Now my question is whether or not I am on the right track. Are there any other technologies you would recommend for this system, or anything else I should take a look at? I’m thinking I wanna use Jetty or Tomcat as the server running the restlet, and normal Apache for the PHP.
Lastly, I would like to know what the advantages/disadvantages of each of the transfer protocols are when it comes to REST. I’m torn between XML and JSON. Any thoughts/links would be appreciated. Thanks!
For the webservice you can use SOAP and REST. Rest is recently more trendy and easier so it is a good start. You can choose a number of providers for REST
The first three are all using the same Jax-RS standard If you dont like the implementation you can easily switch to an another one. We use CXF extensively and never had a problem with it. Spring is different but also nice if you would use spring anyways.
For the server Jetty and Tomcat are the two main lightweight containers. Jetty is lighter, but to be honest there isnt much performance difference especially with a simple webapp
JSon or XML doesnt matter that much either if you use PHP and Java. Probably JSON is more compact therefore the network traffic will be less, but not significantly. All the above REST providers support both out of the box.