Matthew Weier O'Phinney wrote:
-- Ian Warner <[EMAIL PROTECTED]> wrote
(on Wednesday, 13 June 2007, 11:51 PM +0100):
Hi
I want to send the following XMl through HTTP Client as a POST
$XMLDATA = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$XMLDATA .= '<ResponseService Version="2.3">';
$XMLDATA .= "<Header>";
$XMLDATA .= "<Partner>test</Partner>";
$XMLDATA .= "<Password>test</Password>";
$XMLDATA .= "<Company>test</Company>";
$XMLDATA .= "</Header>";
$XMLDATA .= "<ResponseList>";
$XMLDATA .= "<Response>";
$XMLDATA .= "<TransactionID>99</TransactionID>";
$XMLDATA .= "<OriginatingNumber>12345</OriginatingNumber>";
$XMLDATA .= "<Time>" . date('YmdHi') . "</Time>";
$XMLDATA .= "<Data>" . $message . "</Data>";
$XMLDATA .= "<Destination>" . $destination . "</Destination>";
$XMLDATA .= "<Operator>23433</Operator>";
$XMLDATA .= "</Response>";
$XMLDATA .= "</ResponseList>";
$XMLDATA .= "</ResponseService>";
$client->setParameterPost(array('XMLDATA' => $XMLDATA));
On the other end I SIMPLE XML this
but I get load of errors due to HTTP client urlencoding and addingslashes.
If it is urlencoding why does it need to addslashes?
anyway to get round this ?
Send it as a RAW POST:
$clent->setRawData($XMLDATA);
and read the raw post on the server side. This is the typical way XML is
transmitted via HTTP (XML-RPC and SOAP both use it, and it's the
recommended way to POST or PUT data to REST).
Hi Thanks thats all well and good but it relies on clients to do that
also - this is a test for what real world clients will be posting into
an API so I just wanted to do the same is there a way I can stop HTTP
Client adding slashes - if indeed it is anyway.
Or is it the Zend FW controller / action that is doing this interpretation
Anyway somewhere down the tunnel something is happening that is
unexpected and I think should be a config in this module
Cheers
Ian