Reading data with Zend_Soap_Client
===

I am new to Zend_Soap_Client. I have the following code as an example, and I try to understand what is behind it. Do I understand correctly that it connects to remote server and reads specified data? Finally, as far as I understand, it is supposed to save these data in `test.txt`. 

I tried to run this code (I have necessary certificate). The problem is that no data is saved to `test.txt`. So, could someone please explain me this technology or give me a link to a good tutorial on similar topic? In particular, I'm very interested in how to save necessary data to loca XML file or array.

P.S. I apologize if I used some incorrect definitions, because as I mentioned at the beginning I'm new to Zend_Soap_Client and related technology. 

	$wsdl = 'tttest.wsdl';

	$options = array(
		'local_cert' => 'certificate.pem',
		'soap_version' => SOAP_1_1
	);

    $client = new Zend_Soap_Client($wsdl, $options);
    
    	$p = array(
    		'endUserId' => 'demo',
    		'sendTime' => array('value' => date("Y-m-d H:i:s")),
    		'eaupId' => array('chainDate' => array('value' => $chaindate), 'sequenceNumber' => 1)
    	);
    	$webServices = $client->retrieveEAUPCDRs($p);
    
    	$line = $client->getLastResponse();
    	$line = substr($line, 110);
    	$line = substr($line, 0, -22);
    	$xml = simplexml_load_string($line);
    
    	$result = $xml->xpath('//@ns3:title | //ns2:beginPosition | //ns2:endPosition | //ns4:upperLimit | //ns4:lowerLimit | //ns8:conditionalRouteType');
    
    	$filename = 'test.txt';
    	if ($fh = fopen($filename, "r")) {
    		while (!feof($fh)) {
    			$line = fgets($fh);
    			if (strlen($line) != 0) {
    				$chars = explode(";", $line, 5);
    				$np[$chars[0]] = "$chars[3],$chars[2]";
    			}
    		}
    		fclose($fh);
    	}; 