4 //echo 'Curl: ', function_exists('curl_version') ? 'Enabled' : 'Disabled';
6 //Data, connection, auth
7 //$dataFromTheForm = $_POST['fieldName']; // request data from the form
8 $soapUrl = "http://secureuat.decisionsystems.co.za/AISConvergedB2BService/AISConvergedB2BService.svc?singleWsdl"; // asmx URL of WSDL
9 // $soapUser = "username"; // username
10 // $soapPassword = "password"; // password
14 $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
15 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:tran="http://schemas.datacontract.org/2004/07/Transunion.Auto.Convergence.B2B.BusinessModels">
16 <tem:GetConvergedData>
20 <tran:ClientReference>Test002</tran:ClientReference>
22 <tran:Colour>KINETIC BLUE</tran:Colour>
24 <tran:Condition>FAIR</tran:Condition>
26 <tran:CustomerProductId>0</tran:CustomerProductId>
28 <tran:EngineNumber>DR20169</tran:EngineNumber>
30 <tran:GuideMonth>1</tran:GuideMonth>
32 <tran:GuideYear>2013</tran:GuideYear>
34 <tran:LoginId>181306</tran:LoginId>
36 <tran:OptionCodeNew>0</tran:OptionCodeNew>
38 <tran:OptionCodeUsed>0</tran:OptionCodeUsed>
40 <tran:Password>PW181306#</tran:Password>
42 <tran:RegistrationNumber>CR08RTGP</tran:RegistrationNumber>
43 <tran:RegistrationYear>2005</tran:RegistrationYear>
45 <tran:RequestorPerson>ANDRE</tran:RequestorPerson>
47 <tran:RequestorTelNumber>0</tran:RequestorTelNumber>
49 <tran:VehicleCode>22020110</tran:VehicleCode>
50 <tran:VehicleMileage>0</tran:VehicleMileage>
52 <tran:VinOrChasisNumber>MAJ1XXMRJ1DR20169</tran:VinOrChasisNumber>
54 </tem:GetConvergedData>
55 </soap:Envelope>'; // data from the form, e.g. some ID number
58 "Content-type: text/xml;charset=\"utf-8\"",
60 "Cache-Control: no-cache",
62 "SOAPAction: http://tempuri.org/IAISConvergedB2BService/GetConvergedData",
63 "Content-length: ".strlen($xml_post_string),
64 ); //SOAPAction: your op URL
68 // PHP cURL for https connection with auth
70 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
71 curl_setopt($ch, CURLOPT_URL, $url);
72 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
73 // curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
74 // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
75 curl_setopt($ch, CURLOPT_TIMEOUT, 10);
76 curl_setopt($ch, CURLOPT_POST, true);
77 curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
78 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
81 $response = curl_exec($ch);
84 print_r ( $response );
86 $response1 = str_replace("<soap:Body>","",$response);
87 $response2 = str_replace("</soap:Body>","",$response1);
90 $parser = simplexml_load_string($response2);
91 // user $parser to get your data out of XML response and to display it.