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
Hello Anurag,
I copied a few integration reps to help address your code. Although, you may find this video helpful as well.
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>
Let's work together to reach your goals. Contact us at the links below and a representative will be in touch.
We are here to help you and your business. Contact us using the button below.
Learn more©2020 FIS. Advancing the way the world pays, banks and invests™