PHP中具有复杂类型的SOAP请求

时间:2011-08-31 06:34:24

标签: php soap complextype

我想创建一个复杂类型的SOAP请求......我有两个不同的变量:

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

<xsd:deviceId xsi:type="xsd1:LogicalDeviceId" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">           
         <xsd1:id>234</xsd1:id>
</xsd:deviceId>

任何人都知道如何创建这两个变量?

由于

1 个答案:

答案 0 :(得分:2)

您可以使用PHP SoapClient创建复杂类型,例如:

$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);

在PHP文档中查看有关SoapVar的更多详细信息:

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

相关问题