Re: Having problem sending XML over HTTP

From: Date: Sat, 16 Dec 2006 02:22:14 +0000
Subject: Re: Having problem sending XML over HTTP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245879@lists.php.net to get a copy of this message
Hello, on 12/14/2006 06:32 PM Nauman Akbar said the following: > I picked up an example from Curl section on php.net. I am able to access the > remote page fine with a custom header. Unfortunately, I am not able to > retrieve the XML I am sending at the remote end. I have tried both > $HTTP_RAW_POST_DATA and php://input but neither of them returns anything. I > am putting my code below just in case anyone can point out the problem in > there. I don't think you need to wrap your XML in a multipart/mixed container. Just send it as text/xml. That is how SOAP and other protocols work and PHP can handle it. You can also emulate submission of a form with files. That is more complicated but works better with PHP as you do not need to tweak php.ini . I use this HTTP client class that has either an example of sending a XML document like your want or using form submission emulation. Take a look in particular at examples test_http_post.php and test_http_soap.php . http://www.phpclasses.org/formsgeneration -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/

« previous php.general (#245879) next »