Re: Input to PHP from Java
| From: | Marek Kilimajer | Date: | Wed, 29 Sep 2004 15:58:45 +0000 |
| Subject: | Re: Input to PHP from Java | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198201@lists.php.net to get a copy of this message | ||
Rajesh Batchu wrote:
Hi, I have a page with SSL enables as below. https://email.website.com/usrfolder/one.php For this page, my customer is posting some XML data using a java output stream as below. ( pseudo code)http://sk2.php.net/manual/en/wrappers.php.php php://input allows you to read raw POST data. It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives.URL url = new URL(_url); _httpsConnection= (HttpsURLConnection) url.openConnection();_httpsConnection.setDoInput(true); _httpsConnection.setDoOutput(true); _httpsConnection.setUseCaches(false); _httpsConnection.setRequestProperty("Connection", "Keep-Alive"); // send transaction _outputStream = new DataOutputStream(new BufferedOutputStream(_httpsConnection.getOutputStream())); _outputStream.write(xmlString.getBytes()); _outputStream.flush(); _outputStream.close();// receive response _inputStream = new DataInputStream(new BufferedInputStream(_httpsConnection.getInputStream())); BufferedReader in= new BufferedReader(new InputStreamReader(_inputStream)); String inputLine ; while ((inputLine = in.readLine()) != null){ rcvMsg = rcvMsg + inputLine; } in.close();Now the issue for me is , i need to capture the data that is posted by the java code above in my php page. I am not getting the value in any of the standard variables. Can some one suggest me how i should read the data.. Thanks in advance, Regards, Rajesh B.