I'm sending request to an API end point which is supposed to return a response based on the information i sent. I am getting the Acknowledgement of success, but the actual information i'm expecting is not returned.
my cURL request is on the code below, i tried changing the timeout. also checked the tcpdump on the online server : tcpdump has the expected response but still cannot display on the php page.
on localhost i used wireshark to track the request and response but on wireshark i cannot see the expected results and also not displayed on the page when i print the response
NB: response is XML that should look like this
$API_endpoint = "http://xxx.xxx.xx.xx:80/api/bill/sigqrequest";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_endpoint);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/xml',
'g-Com:default.sp.in',
'g-Code:SP172',
'Content-Length:' . strlen($payload)
));
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
$response = curl_exec($ch);
echo $response;
i Expect
<BillSubResp>
<BillTrxInf>
<BillId>MC_2019_27</BillId>
<PayCntrNum>0</PayCntrNum>
<TrxSts>GF</TrxSts>
<TrxStsCode>7223;7201</TrxStsCode>
</BillTrxInf>
</BillSubResp>
<Signature>CT3r/yvVSB9dnbD59LNare2nhwWQq2vCtamcMw==</Signature>
and I get
<BillSubReqAck>
<TrxStsCode>7101</TrxStsCode>
</BillSubReqAck>
<Signature>QxabtcSqgr08g</Signature>
which is just an acknowledgement.
What am I doing Wrong?
I want to get the Response and instead i am getting that acknowledgement from remote System. and on tcpdump on my online server i sometime see the response and still is not displayed on my page when i echo the Response