You are here: Re: PHP 5 soap request with XML-string param. « PHP Programming Language « IT news, forums, messages
Re: PHP 5 soap request with XML-string param.

Posted by The Grand Admiral on 11/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация