代码之家  ›  专栏  ›  技术社区  ›  Sebastian

数组(字符串?)SOAP调用中的参数

  •  2
  • Sebastian  · 技术社区  · 8 年前

    我正在尝试对我无法控制的服务调用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>
    

    我想知道如何将数据传递到resourcesID数组(字符串?)使用服务器端语言,如PHP或node.js。

    这两个参数似乎正在等待ArrayOfstring数据:

    resourcesID: 'q28:ArrayOfstring',
    resourcesPermisions: 'q29:ArrayOfstring'
    

    谢谢

    1 回复  |  直到 8 年前
        1
  •  1
  •   Sebastian    8 年前

    纯粹是偶然,我设法找到了解决这个问题的方法。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'}
        ]
    };