对于这里的专业人士来说,这应该很容易。我正在使用soapClient php 库进行简单调用(参见下面的代码)。
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$url = "http://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL";
$client = new SoapClient($url, array("trace" => 1, "exception" => 0));
var_dump($client->__getFunctions());
$SOAPCall = "CelciusToFahrenheit";
$SoapCallParameters = "30";
$obj = $client->CelciusToFahrenheit($SoapCallParameters);
var_dump($obj);
var_dump($client->getLastRequest());
?>
</body>
当我执行我得到以下错误。我查看了 Apache 错误日志,我看到了同样的错误。
Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in C:\wamp\www\phpSandbox\index.php:16 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://webservi...', '', 1, 0) #1 C:\wamp\www\phpSandbox\index.php(16): SoapClient->__call('CelciusToFahren...', Array) #2 C:\wamp\www\phpSandbox\index.php(16): SoapClient->CelciusToFahrenheit('30') #3 {main} thrown in C:\wamp\www\phpSandbox\index.php on line 16
我还阅读了一些面临类似问题但无法找到解决方案的人。
我确定soapClient库已激活,因为以下代码有效
var_dump($client->__getFunctions());
输出:
array (size=4)
0 => string 'CelciusToFahrenheitResponse CelciusToFahrenheit(CelciusToFahrenheit $parameters)' (length=80)
1 => string 'FahrenheitToCelciusResponse FahrenheitToCelcius(FahrenheitToCelcius $parameters)' (length=80)
2 => string 'WindChillInCelciusResponse WindChillInCelcius(WindChillInCelcius $parameters)' (length=77)
3 => string 'WindChillInFahrenheitResponse WindChillInFahrenheit(WindChillInFahrenheit $parameters)' (length=86)
解决此错误的任何帮助以及对该错误的可能解释都会很棒。