我如何在php中发送soapClient请求

时间:2018-09-18 11:36:25

标签: php soapui soap-client

我如何发送这样的请求soapClient

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ext="Ext.Bo.ITransService" xmlns:ext1="Ext.Svc" xmlns:naf="http://schemas.datacontract.org/2004/07/Nafis.SVC.Objects">
   <soapenv:Header/>
   <soapenv:Body>
      <ext:Report>
         <!--Optional:-->
         <ext:input>
            <!--Optional:-->
            <ext1:AuIn>
               <!--Optional:-->
               <naf:Password>?</naf:Password>
               <!--Optional:-->
               <naf:UserName>?</naf:UserName>
            </ext1:AuIn>
            <!--Optional:-->
            <ext1:GroupCode>?</ext1:GroupCode>
            <!--Optional:-->
            <ext1:FromDate>?</ext1:FromDate>
            <!--Optional:-->
            <ext1:FromRefNo>?</ext1:FromRefNo>
            <!--Optional:-->
            <ext1:MerchantCode>?</ext1:MerchantCode>
            <!--Optional:-->
            <ext1:ToDate>?</ext1:ToDate>
            <!--Optional:-->
            <ext1:ToRefNo>?</ext1:ToRefNo>
         </ext:input>
      </ext:Report>
   </soapenv:Body>
</soapenv:Envelope>

我收到了这条白色的SoapUi,但是我无法发送这条白色的SoapClient

网址:http://nafistestpublic.fanavacard.com/extsrv-svcbo/TransService.svc?wsdl

myPhpCode是=>

 error_reporting(E_ALL);
    ini_set('display_errors', 1);
    $AuIn = array("Password"=>"123","UserName"=>"neka");
    $client = new SoapClient('http://nafistestpublic.fanavacard.com/extsrv-svcbo/TransService.svc?wsdl',array('trace' => TRUE));
    $parameters = array(
        'AuIn'=> $AuIn,
        'GroupCode'=>"1453",
        'FromDate'=> "1395/05/01",
        'ToDate'=> "1395/05/03",
        "FromRefNo"=>'',
        "MerchantCode"=>'',
        "ToRefNo"=>''
    );
    $result = $client->__soapCall("Report",$parameters);

但是我得到这个错误

  

致命错误:未捕获的SoapFault异常:[a:DeserializationFailed]格式化程序在尝试反序列化消息时引发了异常:反序列化“报告”操作的请求消息正文时出错。来自名称空间“ http://schemas.xmlsoap.org/soap/envelope/”的结束元素“正文”。在名称空间“”中找到了元素“ param1”。第2行,位置148。位于/Applications/XAMPP/xamppfiles/htdocs/inkam/merchant.php:26堆栈跟踪中:#0 /Applications/XAMPP/xamppfiles/htdocs/inkam/merchant.php(26):SoapClient-> __ soapCall (“报告”,数组)在第26行的/Applications/XAMPP/xamppfiles/htdocs/inkam/merchant.php中抛出#1 {main}

在suoapUi中工作,但在php中不工作

非常感谢

0 个答案:

没有答案