2017-02-10 4 views
1

EzidebitにSOAP APIを使用して、リスト内のすべての顧客を取得しようとしています。私のための彼らのドキュメンテーションは非常に混乱しており、いくつかのものが欠けているようです。私には十分なスキルがないかもしれません。SOAP APIでカブを使用する

ドキュメントはここにある:https://www.getpayments.com/docs/#getcustomerlist

電流応答イム取得は次のとおりです。ここで

a:ActionNotSupportedThe message with Action 'run' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). 

は私のコードです:(IVEは、XMLの私のキーを削除し、000000000000000に置き換え)

<?php 
    $soap_request ='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:px="https://px.ezidebit.com.au/"> 
        <soapenv:Header/> 
        <soapenv:Body> 
         <px:GetCustomerList> 
         <px:DigitalKey>000000000000000</px:DigitalKey> 
         <px:CustomerStatus>ALL</px:CustomerStatus> 
         <px:OrderBy>EzidebitCustomerID</px:OrderBy> 
         <px:Order>ASC</px:Order> 
         <px:PageNumber>1</px:PageNumber> 
         </px:GetCustomerList> 
        </soapenv:Body> 
       </soapenv:Envelope>'; 

    $header = array(
    "Content-type: text/xml;charset=\"utf-8\"", 
    "Accept: text/xml", 
    "Cache-Control: no-cache", 
    "Pragma: no-cache", 
    "SOAPAction: \"run\"", 
    "Content-length: ".strlen($soap_request), 
); 

    $soap_do = curl_init(); 
    curl_setopt($soap_do, CURLOPT_URL, "https://api.ezidebit.com.au/v3-5/nonpci"); 
    curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); 
    curl_setopt($soap_do, CURLOPT_TIMEOUT,  10); 
    curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); 

    curl_setopt($soap_do, CURLOPT_POST,   true); 
    curl_setopt($soap_do, CURLOPT_POSTFIELDS,  $soap_request); 
    curl_setopt($soap_do, CURLOPT_HTTPHEADER,  $header); 
    $content = curl_exec($soap_do); 
    if(curl_exec($soap_do) === false) { 
    $err = 'Curl error: ' . curl_error($soap_do); 
    curl_close($soap_do); 
    print $err; 
    } else { 
    curl_close($soap_do); 
    print_r($content); 
    } 
?> 

"SOAPAction:\" run \ ""というヘッダーを参照しているエラーが表示されますが、その場所に何を持っているのかわかりません。

誰かが私を助けてくれることを願っています。

+0

は、なぜ私が理解したことがないあなたはこのhttp://php.net/manual/en/book.soap.php – pinoyCoder

+0

のためのPHP石鹸APIを使用してはいけませんそれは何度か試してみましたが、私の頭を包んだことはありません。 –

+0

あなたはもっと頑張ってください。また、PHPエラーメッセージを慎重に読むことをお勧めします。 – pinoyCoder

答えて

1

てみてくださいよりも何かを提案することはできません

<wsdl:operation name="GetCustomerList"><wsdl:input wsaw:Action="https://px.ezidebit.com.au/INonPCIService/GetCustomerList" 

そして今、コードを見つける:

$soap_request ='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:px="https://px.ezidebit.com.au/"> 
       <soapenv:Header/> 
       <soapenv:Body> 
        <px:GetCustomerList> 
        <px:DigitalKey>000000000000000</px:DigitalKey> 
        <px:CustomerStatus>ALL</px:CustomerStatus> 
        <px:OrderBy>EzidebitCustomerID</px:OrderBy> 
        <px:Order>ASC</px:Order> 
        <px:PageNumber>1</px:PageNumber> 
        </px:GetCustomerList> 
       </soapenv:Body> 
      </soapenv:Envelope>'; 

    $header = array(
     "Content-type: text/xml;charset=\"utf-8\"", 
     "Accept: text/xml", 
     "Cache-Control: no-cache", 
     "Pragma: no-cache", 
     "SOAPAction: \"https://px.ezidebit.com.au/INonPCIService/GetCustomerList\"", 
     "Content-length: ".strlen($soap_request), 
    ); 

    $soap_do = curl_init(); 
    curl_setopt($soap_do, CURLOPT_URL, "https://api.ezidebit.com.au/v3-5/nonpci"); 
    curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); 
    curl_setopt($soap_do, CURLOPT_TIMEOUT,  10); 
    curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); 

    curl_setopt($soap_do, CURLOPT_POST,   true); 
    curl_setopt($soap_do, CURLOPT_POSTFIELDS,  $soap_request); 
    curl_setopt($soap_do, CURLOPT_HTTPHEADER,  $header); 
    $content = curl_exec($soap_do); 
    if(curl_exec($soap_do) === false) { 
     $err = 'Curl error: ' . curl_error($soap_do); 
     curl_close($soap_do); 
     print $err; 
    } else { 
     curl_close($soap_do); 
     print_r($content); 
    } 

はエラー

無効DigitalKeyを与えます。 SoapClientと

と同じ:

$wsdl = 'https://api.demo.ezidebit.com.au/v3-5/nonpci?wsdl'; 
    $client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1, 'trace' => 1, "exceptions" => 0)); 

    $params = [ 
     'DigitalKey' => '8591BFD4-E7C8-4284-84F7-E6C419114FA8', 
     'CustomerStatus' => 'ALL', 
     'OrderBy' => 'EzidebitCustomerID', 
     'Order' => 'ASC', 
     'PageNumber' => 1 
    ]; 

    $result = $client->__soapCall('GetCustomerList', [$params]); 


    print_r($client->__getLastRequest()); 
    echo PHP_EOL; 
    print_r($result); 
+1

ありがとうKokin :)完璧に働きました。あなたが言ったようにSOAPACtionが欠けていた;) –

+0

あなたは大歓迎です。しかし、私はもう一度PHP石鹸apiを見てみることを提案します。少なくともそれはより少ない手動作業をすることができます:) –

1

ネイティブPHP SoapClientクラス(PHPでSOAPを消費する最善の方法)を使用する方法がわからない場合は、構造化されたクラスですべてのものをラップするWSDLを使用して、あなたがどこにいても間違っているのか疑問に思っているそして、エラーがある場合、それを正確に識別します。 https://px.ezidebit.com.au/INonPCIService/GetCustomerList \ "" することができます。このサービスのWSDLで

: "\ のSOAPActionを" 私は

にSOAPActionヘッダーを変更するPackageGeneratorプロジェクト

関連する問題