我使用SOAP wsdl使用Java公开Web服务,并且我想使用PHP作为获取数据的前端。 我尝试以下代码:
class SoapRegisterStub
{
public $arg0;
}
try{
$username='hello';
$password='123';
$wsdl = "http://192.168.1.20:8008/svis/CmsSvng?wsdl";
$LoginResponse = array('login' => $username,'password' => $password);
$client = new SoapClient($wsdl,$LoginResponse);
$cSoapLoginStub = new SoapRegisterStub ();
$cSoapLoginStub->arg0= '000145';
die();
$response = $client->getStudentInfo(array($cSoapLoginStub));
echo $response . "<br>\n";
}catch(SoapFault $e){
var_dump($e);
}
但是我遇到了错误
object(SoapFault)#2 (9) { ["message":protected]=> string(168) "SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://192.168.1.20:8008/svis/CmsSvng?wsdl' : failed to load external entity
很抱歉,如果我的问题没有足够的信息或您对某些单词感到困惑。