开发者

SOAP request with complex type in PHP

开发者 https://www.devze.com 2023-03-31 18:18 出处:网络
I would like to make a SOAP request with complex types... I have two different variables: <!--type: string-->

I would like to make a SOAP request with complex types... I have two different variables:

<!--type: string-->               
        <xsd:type>PC</xsd:type><xsd:property>
<!--type: string-->            

and:

<xsd:deviceId xsi:type="xsd1:LogicalDeviceId" xmln开发者_运维问答s:xsi="http://www.w3.org/2001/XMLSchema-instance">           
         <xsd1:id>234</xsd1:id>
</xsd:deviceId>

Anyone has an idea how to create these two variables?

Thanks


You can use the PHP SoapClient to create the complex types, for example:

$deviceId = new SoapVar(array("xsd1:id" => 1234), XSD_ANYTYPE, "xsd1:LogicalDeviceId", "http://www.w3.org/2001/XMLSchema-instance", "deviceId");


$soapClient = new SoapClient("http://yoursoaptarget");
$soapClient->yourSoapMethod($deviceId, <other params);

See more details on SoapVar in the PHP documentation:

http://www.php.net/manual/en/soapvar.soapvar.php

0

精彩评论

暂无评论...
验证码 换一张
取 消