tags:

views:

39

answers:

1

I want to know the advantages and trade-off while using Java/PHP bridge and XML-RPC for communication?

How does the performance vary between the two?

Thanks in advance for the community support. - Aditya Macherla

A: 

Neither. Use a low-latency messaging system that they both can use:

  • Encode data in JSON (readable and writable by both Java and PHP (and most other languages)),
  • Store and read from a shared medium (memcached preferably, mysql/postgres/db in general next, flat-file next),
  • Use REST over XML-RPC anyday.

There is no plausible use case where using the above will be worse than using either XML-RPC or a java/php bridge.

hopeseekr
Thanks for your Inputs. I have a situation where the organisation already has a set of services as part of an existing architecture set up in Java, it is usually straightforward to consume them on the PHP client side.Right now I am looking for suggestions among Java/PHP Bridge or XMLRPC for communication. Any inputs on them would be highly appreciated.
Macherla
Are you saying that it's easier in Java to call a PHP XML-RPC function and parse the resulting xml than it is to grab all the data from a PHP page that outputs nothing but simple JSON and then decodes it into native Java variables using a very simple function?
hopeseekr
No, I am almost a beginner to this field. I really appreciate your inputs. A developed application has Java @ server and @ client. Due to some limitations @frontend they want to convert the front end into php(using Drupal). They are already using XML for communication between client and server. So, I was thinking it can be an over head to encode and decode the xml files.
Macherla
If they already have a robust XML-RPC setup between Java client and server, then your best bet is to use something like this: http://phpxmlrpc.sourceforge.net/
hopeseekr
For all new tie-ins with the java server/client and PHP, however, i would definitely recommend my answer of using JSON via memcached or SQL.
hopeseekr
Thanks a lot for inputs.
Macherla
Check the answer checkmark ;-)
hopeseekr