http://121.33.201.180:6005/RegMember.asmx?WSDL
这个是.net写的webservice服务端
需要调用其中InsertMember方法
$client_reg = new SoapClient("http://121.33.201.180:6005/RegMember.asmx?WSDL");
$functions = $client_reg->__getFunctions();
//print_r($functions);
$types = $client_reg->__getTypes();
//print_r($types);
$client_reg->soap_defencoding = 'utf-8';
$client_reg->xml_encoding = 'utf-8'; //
$param_reg = array('CInsertMember' => array('Name'=>"你好",'Identity'=>"230105198311202013",'Mobile'=>"15014689527",'IsWap'=>true),'fellowID'=>$value,'sCardNum'=>"",'InsertMemberResult'=>"");
$p_reg = $client_reg->__soapCall("InsertMember",array('parameters' => $param_reg));
/*
$param_reg = array(
'CInsertMember'=>'',
'Name'=>"你好",
'Identity'=>"230105198311202013",
'Mobile'=>"15014689527",
'IsWap'=>True,
'fellowID'=>$value,
'sCardNum'=>"",
'InsertMemberResult'=>"");
$p_reg = $client_reg->__soapCall('InsertMember',array('parameters' => $param_reg));
*/
print_r($p_reg);
$array1 = get_object_vars($p_reg);
foreach ($array1 as $key1 => $value1) {
echo $key1.": ".$value1."<br />";
}
正常应该有返回值
但是我的返回值为空
我现在怀疑就是由于服务端定义了一个自定义方法 我用
php服务传入参数造成
请各位大侠帮忙看看
------解决方案--------------------
由
struct InsertMember {
CInsertMember objCInsertMember;
string fellowID;
string sCardNum;
}
struct CInsertMember {
string Name;
string Identity;
string Mobile;
boolean IsWap;
}
可知 InsertMember(InsertMember $parameters)的参数应为
array(
'objCInsertMember' => array(
'Name' => '',
'Identity' => '',
'Mobile' => '',
'IsWap' => '',
),
'fellowID' => '',
'sCardNum' => '',
)
这样的数组,你的好像不是