duan32342 2013-08-30 08:14
浏览 42

AVAYA Web服务返回错误“预期元素”

I have an application that must consume AVAYA ACE webservice and they will not help me.

I have the webservice running and I can consume it using SOAP UI, but when I want to consume with PHP it gets errors.

I have this in my SOAPUI that works fine:

<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>

I have this in my php file to consume:

<!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>';
?>

And here is the error:

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

                )

        )

)
  • 写回答

1条回答 默认 最新

  • duanping2695 2013-09-20 12:04
    关注

    I've solved my problem.

    Here is one solution. I've created a xml code in nusoap client. I use then the send() method.

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

    If anybody needs help with the xml can comment here and I'll try to send the code. I can't paste the code because it is full of url and I get errors....

    Bye

    评论

报告相同问题?

悬赏问题

  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角