开发者

Connecting a PHP front-end to a back-end java service

开发者 https://www.devze.com 2022-12-25 19:34 出处:网络
I am currently using various back-end services and I want to use PHP to simply query these services and perform the final page construction. These services could be coded in any number of programming

I am currently using various back-end services and I want to use PHP to simply query these services and perform the final page construction. These services could be coded in any number of programming langauges such as Erlang, Java, Python etc. However I am unsure of the best way to actuall开发者_开发技巧y interface the back-end services with the web app. Requests to these services would be both synchronous and asynchronous. Would I use something like SOAP or JSON-RPC??

Any help greatly appreciated.


You might want to have a look to Thrift:

http://incubator.apache.org/thrift/


  • I think you are on the right track using JSON-RPC. I don't like SOAP at all because it is just way too complicated in my opinion
  • I would create an interface(document it properly like for example twitter) which I can easily test using cURL from the command line.
  • I think Twitter has a pretty good(not perfect) API.
  • Also ProgrammableWeb.com is a good place to look up API's(see how other people create API's).


This is a general question how to design web services and there is a hype using REST-like web services. This way you simply can call a given URL (which is even user readable). This increase the interoperability of your web service so you can mix the programming languages which use the REST interface. IMHO its easier than using a SOAP like web service as you simply calls GET on an url like http://www.example.com/user/5/ (think of it as the mod_rewrite of web services)


I'd use NuSOAP (to consume java webservices).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号