我试图将SOAP方法调用到我无法控制的服务,这个方法看起来像这样:
<Body>
<AddUserByWEB xmlns="http://tempuri.org/">
<token>[string?]</token>
<email>[string?]</email>
<password>[string?]</password>
<userType>[string?]</userType>
<userRole>[string?]</userRole>
<dateStart>[string?]</dateStart>
<dateEnd>[string?]</dateEnd>
<userName>[string?]</userName>
<personName>[string?]</personName>
<personSurname>[string?]</personSurname>
<phoneNumber>[string?]</phoneNumber>
<!-- Optional -->
<resourcesID>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">[string?]</string>
</resourcesID>
<!-- Optional -->
<resourcesPermisions>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">[string?]</string>
</resourcesPermisions>
</AddUserByWEB>
</Body>
我想知道如何以服务器端语言(如PHP或node.js)将数据传递到resourcesID数组(字符串?)。
似乎这两个参数正在等待ArrayOfstring数据:
resourcesID: 'q28:ArrayOfstring',
resourcesPermisions: 'q29:ArrayOfstring'
谢谢!
答案 0 :(得分:1)
我设法通过纯粹的机会找到了解决这个问题的方法。 resourcesID参数实际上需要具有密钥resourceID的数组列表:
var args = {
token: 'h38hsa0-123',
email: 'email@example.com',
password: 'test',
userType: 1,
userRole: 'User',
dateStart: '27-01-2016 00:00:00',
dateEnd: '27-01-2016 00:00:00',
userName: 'ss',
personName: 'ss',
personSurname: 'ss',
phoneNumber: '231',
resourcesID: [
{string: 1}
],
resourcesPermisions: [
{string: 'Write'}
]
};