I am new to Soap Api and i don't know about SOAP request. I dont have any ideal about how to call api using php. Below is out api xlm parameter.
<xsd:user_id>admin@uss.com</xsd:user_id>
<xsd:password>uss</xsd:password>
<xsd:shipment>
<xsd1:courier>L</xsd1:courier>
<xsd1:delivery_address_line_1>123 MAIN ST</xsd1:delivery_address_line_1>
</xsd:shipment>
I just try to call this api by using below code
$xml_post_string = '';
$soapUrl = 'https://sandbox.loomis-express.com/axis2/services/USSBusinessService?wsdl';
$headers = array(
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"SOAPAction: $soapUrl",
"Content-length: ".strlen($xml_post_string),
); //SOAPAction: your op URL
$url = $soapUrl;
// PHP cURL for https connection with auth
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// converting
$response = curl_exec($ch);
curl_close($ch);
Thanks in advance