简体   繁体   English

PHP中我的第一个SOAP Web服务出错

[英]error with my first SOAP Web services in PHP

I'm getting this error, any one can help me here? 我收到这个错误,任何人都可以帮助我吗?

<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>WSD</faultcode>
<faultstring>
SOAP-ERROR: Parsing WSDL: Couldn't load from 'db.wsdl' : failed to load external entity "db.wsdl"
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

here is my PHP code 这是我的PHP代码

<?php

function getRot13($pInput){
$rot = str_rot13($pInput);return($rot);
}

function getMirror($pInput){
$mirror = strrev($pInput);

return($mirror);
}

// turn off the wsdl cache
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("db.wsdl", array('soap_version' => SOAP_1_2));


$server->addFunction("getRot13");
$server->addFunction("getMirror");
$server->handle();
?>

Error says the exact problem - you are missing correct path to WSDL file. 错误说明确切的问题 - 您错过了正确的WSDL文件路径。 In your case, you have given "db.wsdl" as a path, that appearantly does not exist. 在您的情况下,您已将“db.wsdl”作为路径,但显然不存在。 Confirm that "db.wsdl" is inside your script directory or default include directory (configured in PHP configs). 确认“db.wsdl”位于脚本目录或默认包含目录(在PHP配置中配置)中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM