我在本地计算机上创建了SOAP Web服务之一。我通过some.wsdl
文件与SOAP客户端通话,工作正常。但是我尝试使用完整的主机URL http://flow.local/soap/some.wsdl
index.php(带有SOAP)客户端:
<?php
//Here change the client to 'some wsdl' / 'http://flow.local/soap/some.wsdl'
$client = new SoapClient("http://flow.local/soap/some.wsdl",
array('soap_version' => SOAP_1_2,'trace' => 1 ));
var_dump($client->__getFunctions());
$return = $client->__soapCall("hello",array("World"));
echo("\nReturning value: ".$return);
这是soap.php
<?php
function hello($someone)
{
return "Hello " . $someone . "! - With WSDL";
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("http://flow.local/soap/some.wsdl",
array('soap_version' => SOAP_1_2));
$server->addFunction("hello");
$server->handle();
当然,我有一个wsdl模式文件。
当我使用完整的URL http://flow.local/soap/some.wsdl
时返回:
“致命错误:未捕获的SoapFault异常:[VersionMismatch]版本错误!”
其他工作正常。
Win10Pro,WAMP服务器,PHP版本7.2.18。