我想将 XML 数据从 Web 服务客户端提交到 WSDL 服务器。这是 WSDL 文件: http: //www.nemsis.org/v3/downloads/NEMSIS_V3_12_core.wsdl 我正在调用函数“SubmitData”,但它给出了错误::stdClass Object ([requestType] => SubmitData [requestHandle] => 服务器致命错误 #11。SOAP 消息中没有有效负载。请确保 SOAP 消息已正确编译。[statusCode] => -101 )
这是我写的代码::
<?php
$xml = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/test/nemsis/data.xml');
try{
$sClient = new SoapClient('https://www.nemsis.org/NemsisV3Validator/NemsisWsService?wsdl');
$parameters->username = "******";
$parameters->password = "*********";
$parameters->organization = "Organisation";
$parameters->requestType = "SubmitData";
$parameters->submitPayload = $xml;
$parameters->requestDataSchema = "62";
$parameters->schemaVersion = "3.2.6";
$parameters->additionalInfo = "Hakuna matata";
$response = $sClient->SubmitData($parameters);
print_r($response);
}
catch(SoapFault $e)
{
var_dump($e);
}
?>