SOAP,碰到VersionMismatch,求解決

來源:互聯網
上載者:User
SOAP,遇到VersionMismatch,求解決
先貼代碼出來
header("Content-Type: text/html;charset=utf-8");  
try{
$client = new SOAPClient(null,
array('location' =>"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 ();
}
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.