I'm trying to integrate with a third party API and their API accpets only SOAP requests. They have this sample in their documentation. All I need is to replace the agentcode and mpin. Pls I need some one to help me write a PHP code to send the below format to this link http://202.140.50.116/EstelServices/services/EstelServices?wsdl using SOAP request
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://services.estel.com"
xmlns:bal="http://balance.support.services.estel.com">
<soapenv:Header/>
<soapenv:Body>
<ser:getBalance>
<ser:balanceRequest>
<bal:agentCode>TPR_CM</bal:agentCode>
<bal:mpin>EE17F932B3C311E8877F999DD7865E11</bal:mpin>
</ser:balanceRequest>
</ser:getBalance>
</soapenv:Body>
</soapenv:Envelope>
Heres what I have tried so far
$xml = '<?xml version="1.0" encoding="utf-8"?>'.
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.estel.com" xmlns:bal="http://balance.support.services.estel.com">'.
'<soapenv:Header/>'.
'<soapenv:Body>'.
'<ser:getBalance>'.
'<ser:balanceRequest>'.
'<bal:agentCode>TPR_CM</bal:agentCode>'.
'<bal:mpin>EE17F932B3C311E8877F999DD7865E11</bal:mpin>'.
'</ser:balanceRequest>'.
'</ser:getBalance>'.
'</soapenv:Body>'.
'</soapenv:Envelope>';
$url = "http://balance.support.services.estel.com";
$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_POSTFIELDS, $xml);
$result = curl_exec($soap_do);
$err = curl_error($soap_do);
var_dump($result);