soap,遇到versionmismatch,求解决
先贴代码出来
http://v2.shanxitele.com/service/outwebservice?wsdl,'uri' => http://127.0.0.1/));
$servicename = 'oauth';
$servid = 'xxx';
$secretkey = 'xxx';
$xmlinfo = 'fc4fa30c444400b701446c540230244eyixinbaselcoalhost/index.php';
$result = $client->callservice($servicename, $servid, $secretkey, $xmlinfo);
var_dump($result);
}catch(soapfault $e){
echo error: ,$e->faultcode,, string: ,$e->faultstring;
}
?>
记过错误代码error: versionmismatch, string: wrong version
求解决。
------解决方案--------------------
提供的方法
array
(
[0] => callserviceresponse callservice(callservice $parameters)
)
相关的数据结构
array
(
[0] => struct callservice {
string in0;
string in1;
string in2;
string in3;
}
[1] => struct callserviceresponse {
string out;
}
)
你总得按规矩来吧?
------解决方案--------------------
按照我这个来
try {
$xml='xml数据';
//地址
$soap = new soapclient ( http://mp.vservice.com.cn/service/outwebservice?wsdl );
//请求参数 根据你的参数调整
$param = array ('username' => '*****', 'pwd' => '****', 'businesstype' => 'salehouses', 'xmlcontent' => $xml );
//调用服务器端的方法 根据你的方法调整 我这里import是方法名称
$result = $soap->__soapcall ( 'import', array ('parameters' => $param ) );
print_r ( $result );
} catch ( soapfault $e ) {
echo $e->getmessage ();
} catch ( exception $e ) {
echo $e->getmessage ();
}