我正在使用以下网络服务:
<s:element name="Recipients_AddOrUpdate">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="groups" type="tns:ArrayOfAnyType" />
</s:sequence>
</s:complexType>
</s:element>
我正在发送一个php请求:
$data='<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<SecHeader xmlns="http://www.inwise.com/schemas">
<username>'.$userName.'</username>
<pass>'.$password.'</pass>
</SecHeader>
</soap:Header>
<soap:Body>
<Recipients_AddOrUpdate xmlns="http://www.inwise.com/schemas">
<email>[email protected]</email>
</Recipients_AddOrUpdate>
</soap:Body>
</soap:Envelope>';
我的问题是如何初始化groups
的xml节点(tns:ArrayOfAnyType
)?
此语法不起作用:
<Recipients_AddOrUpdate xmlns="http://www.inwise.com/schemas">
<email>[email protected]</email>
<groups>15245</groups>
</Recipients_AddOrUpdate>
如果groups元素是整数ID,那么您应该将其创建为...
<groups>
<anyType xsi:type="xsd:int">15245</anyType>
</groups>
这是来自http://62.219.25.208/Email-Marketing-API/Recipients-Add-Or-Update-Php.aspx支持网站上的示例PHP代码