From Worldpay solutions to FIS banking capabilities, find answers, ask questions, and connect with our community of developers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Welcome to the FIS Developer Community.

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

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

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

Comments

Hello Anurag,

I copied a few integration reps to help address your code. Although, you may find this video helpful as well.

Video Link : 1147

douradajeff.gross

I've adjusted your SOAP request slightly (see below).  When you use your own test credentials, you should get a valid response.  Note, though, that our general recommendation would be to use the XML interface directly, as we are no longer enhancing/updating the SOAP interface.

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

Version history
Revision #:
1 of 1
Last update:
‎06-28-2017 05:19 AM
Updated by:
 
Contributors