AnsweredAssumed Answered

How to retrieve transaction information using TransactionQuery method via SOAP and PHP ?

Question asked by anurag.soni on Jun 28, 2017
Latest reply on Jul 7, 2017 by jeff.gross@vantiv.com

Hello,

 

I am trying to retrieve transaction information using TransactionQuery method via SOAP and PHP.

Here is the php code that i am using:

<?php

 

$input_xml = '<?xml version="1.0" encoding="utf-8"?>

    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

        <soap:Body>

            <TransactionQuery xmlns="https://reporting.elementexpress.com">

                <credentials>

                    <AccountID>MyAccountID</AccountID>

                    <AccountToken>MyToken</AccountToken>

                    <AcceptorID>MyAcceptorID</AcceptorID>

                </credentials>

                <Application>

                    <ApplicationID>MyApplicationID</ApplicationID>

                    <ApplicationVersion>1.0</ApplicationVersion>

                    <ApplicationName>HostedPayments.CSharp</ApplicationName>

                </Application>

                <Parameters>

                    <TransactionDateTimeBegin>2017/02/18</TransactionDateTimeBegin>

                    <TransactionDateTimeEnd>2017/02/20</TransactionDateTimeEnd>

                </Parameters>

            </TransactionQuery>   

        </soap:Body>

    </soap:Envelope>';

 

 

$url = "https://certreporting.elementexpress.com/express.asmx";

 

 

$headers = array(

"POST /express.asmx HTTP/1.1",

"Host: certtransaction.elementexpress.com",

"Content-Type: text/xml; charset=utf-8",

"SOAPAction:'https://reporting.elementexpress.com/'",

"Content-length: ".strlen($input_xml)

);

 

 

$soap_do = curl_init();

curl_setopt($soap_do, CURLOPT_URL,            $url );

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_HTTPHEADER, $headers);

curl_setopt($soap_do, CURLOPT_POSTFIELDS,    $input_xml);

 

$result = curl_exec($soap_do);

$err = curl_error($soap_do);

print_r($result);

print_r($err);

 

?>

I get following response from server:

soap:ClientServer did not recognize the value of HTTP Header SOAPAction: 'https://reporting.elementexpress.com/'.

 

Can anyone please guide / help me what changes are needed to be made in code so that i can get XML response from server.

 

Thanks & Regards

Anurag

Outcomes