You can post to your server with a mimetype of "text/xml"
and in your script pickup the raw post as:

$HTTP_RAW_POST_DATA

Then just process this string as XML and return to buffer or not.

Have fun.


Timothy Hitchens (HiTCHO)
[EMAIL PROTECTED]


HiTCHO | Open Platform Web Development
Consutling - Outsourcing - Training - Support


----- Original Message ----- 
From: "Kristopher Yates" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 01, 2003 7:20 AM
Subject: [PHP] receiving XML stream as server via PHP


> 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
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to