|
Posted by The Grand Admiral on 10/17/79 11:27
If you want to pass an xml document node as a function parameter, your
need to create a SoapVar object with a text represention of the xml
node and the XSD_ANYXML encoding constant. However, this constant is
not exported by the extension and is not documented for some unknown
reason.
Therefore, to get this to work you must either register the XSD_ANYXML
#define as a PHP constant, or use the integer value of the constant
when creating the SoapVar, which is 147.
$soapvar = new SoapVar($xml_text, 147);
$params = array("ItemXml" => $soapvar, "PropertyView" => "blah");
$result = $this->soapclient->__soapCall("SaveItem",
array("parameters"=>$params), null, $this->soapheaders);
However, this still doesnt give the correct result. For some reason,
the ItemXml parameter node is not wrapped around the associated xml
parameter in the soap request, and the following soap is produced
(assumming '<item>blah</item>' is used as the $xml_text):
<SOAP-ENV:Envelope xmlns:SOAP-ENV="..." xmlns:ns1="...">
<SOAP-ENV:Header>...</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:SaveItem>
<item>blah</item>
<ns1:PropertyView>blah</ns1:PropertyView>
</ns1:SaveItem>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Navigation:
[Reply to this message]
|