0

我有一个必须使用 AVAYA ACE 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:pass@ip: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 'callingParty@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' instead of 'callingParty' here in element makeCall@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local
Expected element 'callingParty@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' instead of 'calledParty' here in element makeCall@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local
Expected element 'callingParty@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local' before the end of the content in element makeCall@http://www.csapi.org/schema/parlayx/third_party_call/v2_3/local

                )

        )

)
4

1 回答 1

0

我已经解决了我的问题。

这是一种解决方案。我在 nusoap 客户端中创建了一个 xml 代码。然后我使用 send() 方法。

$result=$client->send($msg, $endpoint);

如果有人需要有关 xml 的帮助,可以在这里发表评论,我会尝试发送代码。我无法粘贴代码,因为它充满了 url,我得到了错误....

再见

于 2013-09-20T12:04:10.967 回答