SOAP,碰到VersionMismatch,求解决
程序员文章站
2022-06-05 23:01:55
...
SOAP,遇到VersionMismatch,求解决
先贴代码出来
记过错误代码Error: VersionMismatch, string: Wrong Version
求解决。
------解决方案--------------------
------解决方案--------------------
按照我这个来
先贴代码出来
header("Content-Type: text/html;charset=utf-8");
try{
$client = new SOAPClient(null,
array('location' =>"http://v2.shan*.com/service/OutWebService?wsdl",'uri' => "http://127.0.0.1/"));
$servicename = 'OAuth';
$servId = 'xxx';
$secretKey = 'xxx';
$xmlInfo = ''; fc4fa30c444400b701446c540230244e yixin base lcoalhost/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 ();
}
相关文章
相关视频