内置在Soap扩展php5中传递params作为关联数组

时间:2009-09-10 17:59:38

标签: php

我有这个xml我想传递给这个Web服务函数

<UserName>myuser</UserName> 
<Password>password</Password> 
<User>
    <AddCoverCode />
    <title>sdadasdsa</title>
</User>
</CreateNewUser>','',array(),'document', 'literal');

我正在使用php5中的soap扩展buit。

这是我应该在soapcall函数中作为参数传递的吗?

array('CreateNewUser' => array(
    'UserName' =>  'sc', 
    'Password' =>  'i82372',
    'Registration' =>   array('username' =>'new','password' =>'ss'));

1 个答案:

答案 0 :(得分:0)

$client = new SoapClient($url);

$params = array( 'UserName' => 'sc', 'Password' => 'i82372', 'Registration' => array('username' =>'new','password' =>'ss' );

$res = $client->createUser($params);