请教webservice
本帖最后由 boy_wh520 于 2013-03-11 14:08:59 编辑
http://121.33.201.180:6005/RegMember.asmx?WSDL
这个是.net写的webservice服务端
需要调用其中InsertMember方法
<br />
$client_reg = new SoapClient("http://121.33.201.180:6005/RegMember.asmx?WSDL");<br />
$functions = $client_reg->__getFunctions();<br />
//print_r($functions);<br />
$types = $client_reg->__getTypes();<br />
//print_r($types);<br />
$client_reg->soap_defencoding = 'utf-8';<br />
$client_reg->xml_encoding = 'utf-8'; //<br />
$param_reg = array('CInsertMember' => array('Name'=>"你好",'Identity'=>"230105198311202013",'Mobile'=>"15014689527",'IsWap'=>true),'fellowID'=>$value,'sCardNum'=>"",'InsertMemberResult'=>"");<br />
$p_reg = $client_reg->__soapCall("InsertMember",array('parameters' => $param_reg));<br />
/*<br />
$param_reg = array(<br />
'CInsertMember'=>'',<br />
'Name'=>"你好",<br />
'Identity'=>"230105198311202013",<br />
'Mobile'=>"15014689527",<br />
'IsWap'=>True,<br />
'fellowID'=>$value,<br />
'sCardNum'=>"",<br />
'InsertMemberResult'=>"");<br />
$p_reg = $client_reg->__soapCall('InsertMember',array('parameters' => $param_reg));<br />
*/<br />
print_r($p_reg);<br />
$array1 = get_object_vars($p_reg); <br />
foreach ($array1 as $key1 => $value1) { <br />
echo $key1.": ".$value1."<br />"; <br />
}<br />
Nach dem Login kopieren
正常应该有返回值
但是我的返回值为空
我现在怀疑就是由于服务端定义了一个自定义方法 我用
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' => '',
)
这样的数组,你的好像不是