除了此错误消息之外,这里没有什么可写的了:
SoapFault 对象 ( [message:protected] => 错误版本 [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\wamp\www\nsoap\phpclient.php [line :protected] => 10 [trace:Exception:private] => Array ([0] => Array ([file] => C:\wamp\www\nsoap\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\nsoap\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] => 错误版本 [faultcode] => VersionMismatch [faultcodens] =>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] => 错误版本 [faultcode] => VersionMismatch [faultcodens] =>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] => 错误版本 [faultcode] => VersionMismatch [faultcodens] =>233 ) ) ) ) ) [previous:Exception:private] => [faultstring] => 错误版本 [faultcode] => VersionMismatch [faultcodens] =>233 ) ) ) ) ) [previous:Exception:private] => [faultstring] => 错误版本 [faultcode] => VersionMismatch [faultcodens] =>http://schemas.xmlsoap.org/soap/envelope/ [xdebug_message] => (!) SoapFault: Wrong Version in C:\wamp\www\nsoap\phpclient.php on line 10 Call Stack #TimeMemoryFunctionLocation 10.0009674576{main} ()..\phpclient.php:0 20.0704702744SoapClient->getIMIPremium()..\phpclient.php:10)
客户端php代码中是否可能存在错误?我试过 NuSoap,但它也产生错误“调用错误:响应不是文本/xml 类型:application/wsdl+xmlHTTP/1.1 200 OK 日期:星期二,2013 年 9 月 17 日 16:55:39 GMT 服务器: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-类型:应用程序/wsdl+xml"。
你知道有什么解决办法吗?
PHP代码:
<?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);
}
?>
您可以在此处找到 wsdl(在我与 NuSOAP 相关的问题中: WSDL Client Not Working