简体   繁体   中英

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

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. In your case, you have given "db.wsdl" as a path, that appearantly does not exist. Confirm that "db.wsdl" is inside your script directory or default include directory (configured in PHP configs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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