mazaka Posted July 30, 2007 Share Posted July 30, 2007 Hi all Our core app is built in java. I need to connect a PHP app (interface) to it in the best way possible. By connecting, I mean the PHP is requesting data from the Java a fair amount of times during one user's session. I looked at HessianPHP as a possible solution, but that project seems a bit deserted. Are there any better options than XML-RPC /NuSOAP / SOAP? Anyone has as any experiences? thanks! Pelle Quote Link to comment Share on other sites More sharing options...
trq Posted July 30, 2007 Share Posted July 30, 2007 Maybe this will help. Quote Link to comment Share on other sites More sharing options...
Buyocat Posted July 31, 2007 Share Posted July 31, 2007 Facebook recently released a platform called Thrift which acts as a bridge between multiple languages. They boast it being very fast and easy to use. I think that probably the best way is to make a web service. For instance you might have Java running as a backend web service with access to the databases. It would expose a set of methods to read and write to the database. Then your front end servers would run PHP. They would make calls to the back end server retrieve data (serialized, in XML most likely, think SOAP) and then do whatever was needed to present the data to the client. By going this route you make it relatively easy to add more servers to the application, so it will scale well. By using XML you leave open the option to switch your backend or frontend implementations to other languages in the future, or expose the services for public consumption as an API. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted July 31, 2007 Share Posted July 31, 2007 I am currently working on a similar issue. I found an open-source eclipse based reporting software that I'm hoping I can use to quickly build reports for our clients. It's Java-based so my initial plan is to install a Tomcat server for the reporting and request reports through PHP. However, I think I'm running into memory constraints on our VPS so I'm not sure how it's going to turn out. I'd be curious to hear how you go about solving this issue or what anyone else has to offer. Quote Link to comment Share on other sites More sharing options...
mazaka Posted July 31, 2007 Author Share Posted July 31, 2007 Thanks everyone for quick and great replies! + I looked at the http://us3.php.net/java initiative. It seems like its firing up a java VM for every request? I may be wrong but if im not, it sounds kind of costly. + I totally forgot about Thrift. Havent seen the code til today so I need to look some more at it. + We are leaning towards using something like XML-RPC or SOAP at the moment. Just found out about CodeIgniter and its XMLRPC plug: http://codeigniter.com/user_guide/libraries/xmlrpc.html - Could be a potential combo since we dont have a framework chosen for PHP just yet. Anyone had any experience with it? We will be making a lot of RPC calls. Not casual stock quote lookups.. + The Zend SOAP library looks interesting if we take the SOAP path. Written in C, compared to others. http://devzone.zend.com/node/view/id/689#Heading3 While looking robust and rigorous, SOAP to me still feels a bit complex and the word overkill comes to mind. I will prioritize agility over being WorldWar3 proof. Any thoughts on SOAP and its complexity? Quote Link to comment Share on other sites More sharing options...
Buyocat Posted July 31, 2007 Share Posted July 31, 2007 I think the common complaint against SOAP is that it is too verbose. You could take a look at REST and see if that protocol can fit into what you're doing. In the worst case you could simply not use an established protocol at all and write your own. The benefit would be it fits your needs perfectly, the drawback would be it is unlikely to work with other services, but that may not be a bad trade off depending on your goals. I haven't used code ignitor, though I've heard good things about it. I've also heard good things about the Zend framework. Frankly, I think so long as you're comfortable working within their environments any framework will do. Roopurt if you're just tryig to draw graphs I'm not sure why you're making a remote service. Given the fact that graphs are usually outputed as images or flash it would seems very costly to send them over the wire. There is a good PHP-flash graph drawing package you could use. http://www.maani.us/charts/index.php If you're using the java package because it queries the databases for the right combinations of data, and you're running into problems deploying the java server, then I would just look over the source code to determine what dimensions it's fetching from the DB and then port that over to PHP. All of that said I may be misunderstanding you, so why don't you start a new thread on the issue? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.