ID: 34449 Updated by: [EMAIL PROTECTED] Reported By: trsnoozy at avstgroup dot com -Status: Open +Status: Assigned -Bug Type: SOAP related +Bug Type: Feature/Change Request PHP Version: 5.1.0RC1 -Assigned To: +Assigned To: dmitry
Previous Comments: ------------------------------------------------------------------------ [2005-09-09 21:19:54] trsnoozy at avstgroup dot com Description: ------------ To the best of my knowledge, I should be able to pass a raw XML document (fragment) into the SOAP payload (i.e., XML Schema's anyXml). SoapVar -can- do this, however, the constant that activates this functionality (XSD_ANYXML) is not exported by the extension, nor is it documented in the help. Reproduce code: --------------- <?php $location = "http://www.example.org/example_service"; $uri = "http://www.example.org/schemas/example_service"; $my_xml = "<array><item/><item/><item/></array>"; $client = new SoapClient(null, array('location' => $location, 'uri' => $uri); $var = new SoapVar($my_xml, XSD_ANYXML); $param = new SoapParam($var, "XMLData"); $client->AnyFunction($param); ?> Expected result: ---------------- The SOAP call should contain the non-escaped, literal text of $my_xml. This behavior will occur if XSD_ANYXML is define()'d to 147. If you have netcat, you can set the $location value appropriately to point at a port (like http://localhost:1234) then set up netcat to listen on that port (nc -l -p 1234). This will show that the literal XML is, in fact, passed through as it should be. Actual result: -------------- The script will blow up with an warning about XSD_ANYXML being undefined, followed by an error stating that it's an invalid value for SoapVar. The problem is easily solved by registering the XSD_ANYXML #define as a PHP constant in the ext/soap/soap.c file. Naturally, adding this constant to the help files would be nice, too :). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34449&edit=1