douzhi9478 2013-09-17 16:58
浏览 96

PHP SoapClient版本不匹配[重复]

This question already has an answer here:

There is nothing too much to write here other than this error message :

SoapFault Object ( [message:protected] => Wrong Version [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\wamp\www soap\phpclient.php [line:protected] => 10 [trace:Exception:private] => Array ( [0] => Array ( [file] => C:\wamp\www soap\phpclient.php [line] => 10 [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => getIMIPremium [1] => Array ( [0] => Array ( [imiPolicy] => Array ( [expiryDate] => 23-09-2013 [imiInsured] => Array ( [item] => Array ( [item] => Array ( [age] => 23 [basicSumInsured] => 33233 [coverRageType] => 12 [dateOfBirth] => 26-09-1986 [preExistingDisease] => no ) ) ) [inceptionDate] => 12-09-2009 [noOfInsured] => 1 [partnerCode] => 2121 [stateCode] => 233 ) ) ) ) ) [1] => Array ( [file] => C:\wamp\www soap\phpclient.php [line] => 10 [function] => getIMIPremium [class] => SoapClient [type] => -> [args] => Array ( [0] => Array ( [imiPolicy] => Array ( [expiryDate] => 23-09-2013 [imiInsured] => Array ( [item] => Array ( [item] => Array ( [age] => 23 [basicSumInsured] => 33233 [coverRageType] => 12 [dateOfBirth] => 26-09-1986 [preExistingDisease] => no ) ) ) [inceptionDate] => 12-09-2009 [noOfInsured] => 1 [partnerCode] => 2121 [stateCode] => 233 ) ) ) ) ) [previous:Exception:private] => [faultstring] => Wrong Version [faultcode] => VersionMismatch [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/ [xdebug_message] => ( ! ) SoapFault: Wrong Version in C:\wamp\www soap\phpclient.php on line 10 Call Stack #TimeMemoryFunctionLocation 10.0009674576{main}( )..\phpclient.php:0 20.0704702744SoapClient->getIMIPremium( )..\phpclient.php:10 )

Is it possible that there is an error in the client php code for it ? I have tried NuSoap, but it is also generating error that "Call error: Response not of type text/xml: application/wsdl+xmlHTTP/1.1 200 OK Date: Tue, 17 Sep 2013 16:55:39 GMT Server: Apache/2.2.22 (Win64) PHP/5.3.13 Last-Modified: Tue, 17 Sep 2013 13:18:39 GMT ETag: "a0000000a818c-12e9-4e69428b54054" Accept-Ranges: bytes Content-Length: 4841 Connection: close Content-Type: application/wsdl+xml ".

Do you know any fix for it ?

PHP Code :

<?php

try{


$client = new SoapClient("http://mysite.com/nsoap/IMIPremiumWebService.wsdl");


$args= array("imiPolicy" => array("expiryDate" => "23-09-2013", "imiInsured" =>array("item" => array("item" => array("age"=>'23', "basicSumInsured"=>'33233', "coverRageType"=>'12',"dateOfBirth"=>'26-09-1986',"preExistingDisease" => 'no'))), "inceptionDate"=>"12-09-2009" ,"noOfInsured"=>'1',"partnerCode" => '2121', "stateCode" => '233'));
$something =  $client->getIMIPremium($args);
echo $client->responseData;


print_r($something);
}
catch (Exception $e)
{

    echo "*****************";
    print_r($e);
}

?>

You can find wsdl here (in my question related to NuSOAP: WSDL Client Not Working

</div>
  • 写回答

1条回答 默认 最新

  • dsbm49845 2013-09-17 22:52
    关注

    A little bit of googling with that particular error message reveals that it might be related to the Soap server answering in Soap version 1.2, while the default setting in PHP is Soap version 1.1.

    Try adding an options array to the SoapClient with array('soap_version'=> SOAP_1_2) as the second parameter (see http://de1.php.net/manual/en/soapclient.soapclient.php for details).

    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集