Home > Backend Development > PHP Tutorial > php soap对象数组

php soap对象数组

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:34:13
Original
1242 people have browsed it

在实现某个soap的时候遇到了点麻烦,实在无解,求问:

soap要求参数格式

<code><fieldlist>
    <keyvalue>
        <key>string</key>
        <value>string</value>
    </keyvalue>
    <keyvalue>
        <key>string</key>
        <value>string</value>
    </keyvalue>
</fieldlist>
</code>
Copy after login
Copy after login

实际PHP需要这样实现:

<code>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' 
            ) 
    )

);
</code>
Copy after login
Copy after login

当然我也构建了 obj版

<code>array('listfiled'=>array (
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' )
));
</code>
Copy after login
Copy after login

obj版本服务器无法识别,求解

回复内容:

在实现某个soap的时候遇到了点麻烦,实在无解,求问:

soap要求参数格式

<code><fieldlist>
    <keyvalue>
        <key>string</key>
        <value>string</value>
    </keyvalue>
    <keyvalue>
        <key>string</key>
        <value>string</value>
    </keyvalue>
</fieldlist>
</code>
Copy after login
Copy after login

实际PHP需要这样实现:

<code>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' 
            ) 
    )

);
</code>
Copy after login
Copy after login

当然我也构建了 obj版

<code>array('listfiled'=>array (
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' ),
            new KeyValue ( 'asd', 'ccccc' )
));
</code>
Copy after login
Copy after login

obj版本服务器无法识别,求解

生成xml格式

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template