小编Yva*_*TIN的帖子

SOAP-ERROR:解析WSDL:找不到<definitions>

我一直在努力解决这个问题,并最终投降寻求帮助.

所以这是我的问题:

我正在尝试从远程服务器使用SOAP Web服务,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>';
Run Code Online (Sandbox Code Playgroud)

正如标题中所述,我收到此消息作为回报:

致命错误:未捕获的SoapFault异常:[WSDL] SOAP-ERROR:解析WSDL:在C:\ Users\username\Documents\EasyPHP-DevServer-14.1VC11\data\localweb中的"WSDL文件URI"中找不到<definitions>\projects\API\index.php:30堆栈跟踪:#0 C:\ Users\username\Documents\EasyPHP-DevServer-14.1VC11\data\localweb\projects\API\index.php(30):SoapClient-> SoapClient ('WSDL文件URI',数组)在第30行的C:\ Users\username\Documents\EasyPHP-DevServer-14.1VC11\data\localweb\projects\API\index.php中抛出#1 {main}

我已经阅读了大多数有关此错误的帖子,因此在我的SOAP请求中尝试了很多变化.我还编辑了我的php.ini文件以便该行

延长= php_openssl.dll

没有";" (评论)之前我可以在这里阅读.

php soap wsdl web-services

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

php ×1

soap ×1

web-services ×1

wsdl ×1