我正在尝试从WSDL文件创建SOAP客户端,但我总是得到这个错误。
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'https://..../CreateQuote?xsd=createQuote_datamodel.xsd', namespace must not match the enclosing schema 'targetNamespace' in C:\xampp\htdocs\kfz\test.php:23 Stack trace: #0 C:\xampp\htdocs\kfz\test.php(23): SoapClient->SoapClient('https://testws1...', Array) #1 {main} thrown in C:\xampp\htdocs\kfz\test.php on line 23
这是我的代码:
$xml = file_get_contents("out.xml");
$soapOptions = array(
'soap_version' => SOAP_1_1,
'exceptions' => true,
'trace' => 1,
'wsdl_local_copy' => false,
'keep_alive' => true,
);
$soapClient = new SoapClient($wsdlUrl, $soapOptions);
$soapClient->CreateQuote($xml);
有人能帮帮我吗? 我也尝试过非WSDL模式,但它仍然无法正常工作