duandian8251 2018-02-28 20:49
浏览 61

SoapClient __do请求返回NULL

I have this request and I need to get response from the server but getting NULL

$XML = "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:esh="http://eshop.gf.lt/">
   <soapenv:Header/>
   <soapenv:Body>
      <esh:StartDealSession_v2>
         <product>EL</product>
         <merchantId>some_id</merchantId>
         <orderNo>123</orderNo>
         <totalAmount>790.90</totalAmount>
         <totalAmountCurrency>EUR</totalAmountCurrency>
         <totalAmountCurrRate>1.00</totalAmountCurrRate>
         <loanAdvance>0</loanAdvance>
         <sKey>password</sKey>
         <basket>
            <!--1 or more repetitions:-->
            <item>
               <code>1112</code>
               <type>KIT</type>
               <title>TEST</title>
               <category>KIT</category>
               <service>GDT</service>
               <sum>790.90</sum>
               <amount>1</amount>
               <currency>EUR</currency>
               <rate>1.00</rate>
            </item>
         </basket>
         <returnUrl>www.myshop.com/callback</returnUrl>
      </esh:StartDealSession_v2>
   </soapenv:Body>
</soapenv:Envelope>";

I'm creating new soap client:

$soap = new SoapClient($soapclient_link_wsdl, array('trace' => 1));

and do request:

   try {
            $result = $soap->__doRequest($XML, $soaprequest_link, 'StartDealSession_v2', 0);
            if (!$result) {
            return $result;
        } else {
            return false;
        }

    } catch (Exception $e) {
        $e = 0;
        return $e;
     } 

Response should be:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:StartDealSession_v2Response xmlns:ns2="http://eshop.gf.lt/">
         <return>
            <dealSessionId>D5C5123F30C20509E043C476A8C03B13</dealSessionId>
            <resultCode>1</resultCode>
         </return>
      </ns2:StartDealSession_v2Response>
   </S:Body>
</S:Envelope>

But $result receiving NULL. This I need to use in Virtuemart (JOOMLA)custom payment module

Can anybody help to solve this problem? What wrong in my code?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C++使用Gunplot
    • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
    • ¥15 matlab数字图像处理频率域滤波
    • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
    • ¥15 ELGamal和paillier计算效率谁快?
    • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
    • ¥15 Arcgis相交分析无法绘制一个或多个图形
    • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
    • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
    • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)