File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Sending some values from PHP to Java using HttpClient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sending some values from PHP to Java using HttpClient" Watch "Sending some values from PHP to Java using HttpClient" New topic
Author

Sending some values from PHP to Java using HttpClient

srinivas srini
Greenhorn

Joined: Feb 03, 2004
Posts: 23
Hi ,
I want to return some values from the PHP files to the invoking Java class, and I am invoking the PHP from java like this...



I want to how to set values in the response and know how to capture those values at the java side, a code snippet would be of great help.
Also let me know what are the options i have for passing values from php to java.
I have tried at PHP code by setting to body of httpresponse but it did not worked.

HttpResponse::setBody("somekey", "somevalue");

Thanks in advance


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
Check out into the JSON format. It's probably the most common way to transfer data over HTTP these days, and there are libraries available for just about any language certainly for Java and PHP there are, so both sides of your call should be covered.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending some values from PHP to Java using HttpClient
 
Similar Threads
Postmethod
how to submit and receive the responce of XML through java
Using PostMethod to post from a servlet without capturing the response body
get parameter from ApacheHttpClient in servlet
SSLHandshake Error while connection to remote server