Simple example below:
<?php
/* Method GetCTProductGroups
<GetCTProductGroups xmlns="http://www.ct4partners.com/B2B"> <== 1. method
<username>string</username> <=== 2. param
<password>string</password> <=== 2. param
</GetCTProductGroups>
*/
$urlToWsdl = 'https://www.ct4partners.com/ws/ctproductsinstock.asmx?wsdl';
$client = new SoapClient($urlToWsdl);
$request = array(
'username' => 'login', //2. param
'password' => 'pass' //2. param
);
$client->GetCTProductGroups($request); //1. call method
$xml = $client->__getLastResponse(); // Get XML
//if response not empty (You must provide real login details / real data param)
if(isset($xml))
{
$dom = new DOMDocument;
$dom->preserveWhiteSpace = FALSE;
$dom->loadXML(
$xml,
LIBXML_HTML_NOIMPLIED |
LIBXML_HTML_NODEFDTD |
LIBXML_NOERROR |
LIBXML_NOWARNING
);
//Save XML as a file
$dom->save('response.xml');
}