【发布时间】:2016-06-16 09:37:41
【问题描述】:
我正在尝试使用来自远程服务器的 SOAP 网络服务,wsdl 文件位于此处http://ecolinthcm.pi-asp.de/logaserver/services/UsersService?wsdl
我一直与那里的开发人员联系,但他们一直告诉我它工作正常,所以他们没有太大帮助......
我正在用这段小代码戳熊看看它是否还活着:
$WSDL = "http://ecolinthcm.pi-asp.de/logaserver/services/UsersService?wsdl";
// the file_get_contents methods doesn't change the end result unfortunately
//$data = file_get_contents($WSDL);
//file_put_contents('./wsdl.xml',$data);
//$WSDL = './wsdl.xml';
$opts = array(
'http'=>array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$service = new SoapClient($WSDL,array('stream_context' => $context, 'cache_wsdl' => WSDL_CACHE_NONE));
$result = $service->ErmUserBean (array("UserID","Password","TargetUserID"));
print '<pre>';
var_dump($result);
print '</pre>';
正如标题中所说,我收到这条消息作为回报:
致命错误:未捕获的 SoapFault 异常:[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find in 'WSDL file URI' in C:\Users\username\Documents\EasyPHP-DevServer-14.1VC11\ data\localweb\projects\API\index.php:30 堆栈跟踪:#0 C:\Users\username\Documents\EasyPHP-DevServer-14.1VC11\data\localweb\projects\API\index.php(30): SoapClient ->SoapClient('WSDL file URI', Array) #1 {main} 在第 30 行的 C:\Users\username\Documents\EasyPHP-DevServer-14.1VC11\data\localweb\projects\API\index.php 中抛出
我已阅读有关此错误的大多数帖子,因此在我的 SOAP 请求中尝试了很多变化。我还编辑了我的 php.ini 文件,以便
extension=php_openssl.dll
出现时不带“;” (评论)之前我可以读到here。
【问题讨论】:
标签: php web-services soap wsdl