0
我有一個應用程序必須使用AVAYA ACE webservice,它們不會幫助我。AVAYA Web服務返回錯誤「預期的元素」
我有web服務正在運行,我可以使用SOAP UI來使用它,但是當我想使用PHP時,它會得到錯誤。
我有這個在我的SOAPUI工作正常:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loc="http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local">
<soapenv:Header/>
<soapenv:Body>
<loc:makeCall>
<loc:callingParty>tel:1781</loc:callingParty>
<loc:calledParty>tel:901134625154789</loc:calledParty>
</loc:makeCall>
</soapenv:Body>
</soapenv:Envelope>
我有這個在我的PHP文件中消耗:
<!doctype html>
<?php
require_once '../config/clases/nusoap_avaya/lib/nusoap.php';
$client = new nusoap_client("https://user:[email protected]:9443/RaptorWeb/services/ThirdPartyCall", false);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
exit();
}
$params =array(
"callingParty" => "tel:1781",
"calledParty" => "tel:901134625154789"
);
$result = $client->call('makeCall',$params,'http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local');
if ($client->fault) {
echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
?>
這裏是錯誤:
Array
(
[faultcode] => soapenv:Server
[faultstring] => AgileCE service exception
[detail] => Array
(
[ServiceException] => Array
(
[messageId] => SVC0002
[text] => Expected element '[email protected]://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' instead of 'callingParty' here in element [email protected]p://www.csapi.org/schema/parlayx/third_party_call/v2_3/local
Expected element '[email protected]://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' instead of 'calledParty' here in element [email protected]://www.csapi.org/schema/parlayx/third_party_call/v2_3/local
Expected element '[email protected]://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' before the end of the content in element [email protected]://www.csapi.org/schema/parlayx/third_party_call/v2_3/local
)
)
)