Re: receiving XML stream as server via PHP

From: Date: Thu, 02 Jan 2003 15:33:09 +0000
Subject: Re: receiving XML stream as server via PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-129950@lists.php.net to get a copy of this message
Hi, I thought there was only one XML standard (1.0)? I guess my question should have been, when someone commits an HTTP POST sending me raw xml data to my PHP script, I imagine PHP would store it in some global variable. What variable is that? Thanks, Kris Jimmy Brake wrote:
depends on which xml standard you are using .... the xml-rpc is what I have been using to ACCEPT xml -- but it does have a server to accept xml http://pear.php.net/package-search.php?pkg_name=xml&bool=AND&submit=Search On Tue, 2002-12-31 at 13:20, Kristopher Yates wrote:
Hi, Using PHP with cURL, I am currently able to dynamically create XML documents and HTTP POST to a remote server, receive an XML response, and parse XML as needed. What I am having trouble finding information on is doing the reverse. Basically, I am trying to create a PHP script that acts as a server, so that a remote computer can HTTP POST XML to said script and then I parse and respond in XML. Again, I already have the reverse working using CURL - so basically I have created a client and now I need to create the server. The only part I need help understanding is how do I get the XML into an array/variable when my script is hit with someone using HTTP POST to pass XML to it. I have an idea below (vague).. I had the server guy HTTP POST some XML to a script which just had <? phpinfo(); ?> I see in the HTTP Request Headers of the phpinfo() output that it received content type text/xml but nowhere do I see what was actually received (the actual xml that was sent). I thought maybe PHP would take the stuff after the header and push it into an array/variable but no such luck (argv?). I am wondering if anyone has any helpful information. I imagine something like the following psuedo code: if($HTTP_CONTENT_TYPE=="text/xml"){ //use some php function(s) to pass incoming xml stream to an array that I can then pass to my //xml parser } I hope this gives you enough information to figure out my dilema. If someone can shed a little light on this subject it would be GREATLY appreciated. Thanks, Kris kris@2binteractive.com
.


« previous php.general (#129950) next »