在实现某个soap的时候遇到了点麻烦,实在无解,求问:
soap要求参数格式
<fieldList>
    <KeyValue>
        <Key>string</Key>
        <Value>string</Value>
    </KeyValue>
    <KeyValue>
        <Key>string</Key>
        <Value>string</Value>
    </KeyValue>
</fieldList>
实际PHP需要这样实现:
array (
    'filedlit' => array (
            'keyvalue' => array (
                    'key' => 'a1sd',
                    'value' => 'asd' 
            ),
            'keyvalue' => array (
                    'key' => 'as2d',
                    'value' => 'asd' 
            ),
            'keyvalue' => array (
                    'key' => 'as3d',
                    'value' => 'asd' 
            ),
            'keyvalue' => array (
                    'key' => 'as4d',
                    'value' => 'asd' 
            ),
            'keyvalue' => array (
                    'key' => 'asd',
                    'value' => 'asd' 
            ),
            'keyvalue' => array (
                    'key' => 'asd',
                    'value' => 'asd' 
            ) 
    )
);
当然我也构建了 obj版
array('listfiled'=>array (
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' )
));
obj版本服务器无法识别,求解
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
生成xml格式