Index: class.em_soap.php
===================================================================
--- class.em_soap.php	(revision 1860)
+++ class.em_soap.php	(working copy)
@@ -27,6 +27,12 @@
 ***************************************************************/
 /* $Id$ */
 
+// make sure some SOAP implementation is available
+if (!defined('SOAP_1_2'))	{
+	// if no native SOAP support is available we use nusoap (bundled)
+	require_once('class.nusoap.php');		
+}
+
 /**
  * Enter description here...
  *
@@ -100,7 +106,6 @@
 		switch ($this->options['implementation']) {
 			case 'nusoap':
 				$this->client =& new soapclient($this->options['wsdl'], true);
-				$this->client->getProxy();
 				break;
 			case 'pearsoap':
 				$this->client =& new SOAP_Client($this->options['wsdl'], true);
Index: class.em_terconnection.php
===================================================================
--- class.em_terconnection.php	(revision 1860)
+++ class.em_terconnection.php	(working copy)
@@ -27,10 +27,6 @@
 ***************************************************************/
 
 
-if (!defined('SOAP_1_2'))	{
-	require_once('class.nusoap.php');
-#	require_once('/usr/share/php/SOAP/Client.php');
-}
 require_once('class.em_soap.php');
 
 /**
Index: class.nusoap.php
===================================================================
--- class.nusoap.php	(revision 1860)
+++ class.nusoap.php	(working copy)
@@ -1713,21 +1713,21 @@
 	if($typeDef = $this->getTypeDef($type)){
 		$str .= '<'.$type;
 	    if(is_array($typeDef['attrs'])){
-		foreach($attrs as $attName => $data){
-		    $str .= " $attName=\"{type = ".$data['type']."}\"";
-		}
+			foreach($typeDef['attrs'] as $attName => $data){
+			    $str .= " $attName=\"{type = ".$data['type']."}\"";
+			}
 	    }
 	    $str .= " xmlns=\"".$this->schema['targetNamespace']."\"";
 	    if(count($typeDef['elements']) > 0){
-		$str .= ">";
-		foreach($typeDef['elements'] as $element => $eData){
-		    $str .= $this->serializeTypeDef($element);
-		}
-		$str .= "</$type>";
+			$str .= ">";
+			foreach($typeDef['elements'] as $element => $eData){
+			    $str .= $this->serializeTypeDef($element);
+			}
+			$str .= "</$type>";
 	    } elseif($typeDef['typeClass'] == 'element') {
-		$str .= "></$type>";
+			$str .= "></$type>";
 	    } else {
-		$str .= "/>";
+			$str .= "/>";
 	    }
 			return $str;
 	}
@@ -5921,32 +5921,37 @@
 		$evalStr = $this->_getProxyClassCode($r);
 		//$this->debug("proxy class: $evalStr";
 		// eval the class
-		eval($evalStr);
-		// instantiate proxy object
-		eval("\$proxy = new soap_proxy_$r('');");
-		// transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
-		$proxy->endpointType = 'wsdl';
-		$proxy->wsdlFile = $this->wsdlFile;
-		$proxy->wsdl = $this->wsdl;
-		$proxy->operations = $this->operations;
-		$proxy->defaultRpcParams = $this->defaultRpcParams;
-		// transfer other state
-		$proxy->username = $this->username;
-		$proxy->password = $this->password;
-		$proxy->authtype = $this->authtype;
-		$proxy->proxyhost = $this->proxyhost;
-		$proxy->proxyport = $this->proxyport;
-		$proxy->proxyusername = $this->proxyusername;
-		$proxy->proxypassword = $this->proxypassword;
-		$proxy->timeout = $this->timeout;
-		$proxy->response_timeout = $this->response_timeout;
-		$proxy->http_encoding = $this->http_encoding;
-		$proxy->persistentConnection = $this->persistentConnection;
-		$proxy->requestHeaders = $this->requestHeaders;
-		$proxy->soap_defencoding = $this->soap_defencoding;
-		$proxy->endpoint = $this->endpoint;
-		$proxy->forceEndpoint = $this->forceEndpoint;
-		return $proxy;
+		if(!$this->getError()) {
+			eval($evalStr);
+			// instantiate proxy object
+			if(class_exists('soap_proxy_'.$r)) {
+				eval("\$proxy = new soap_proxy_$r('');");
+				// transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
+				$proxy->endpointType = 'wsdl';
+				$proxy->wsdlFile = $this->wsdlFile;
+				$proxy->wsdl = $this->wsdl;
+				$proxy->operations = $this->operations;
+				$proxy->defaultRpcParams = $this->defaultRpcParams;
+				// transfer other state
+				$proxy->username = $this->username;
+				$proxy->password = $this->password;
+				$proxy->authtype = $this->authtype;
+				$proxy->proxyhost = $this->proxyhost;
+				$proxy->proxyport = $this->proxyport;
+				$proxy->proxyusername = $this->proxyusername;
+				$proxy->proxypassword = $this->proxypassword;
+				$proxy->timeout = $this->timeout;
+				$proxy->response_timeout = $this->response_timeout;
+				$proxy->http_encoding = $this->http_encoding;
+				$proxy->persistentConnection = $this->persistentConnection;
+				$proxy->requestHeaders = $this->requestHeaders;
+				$proxy->soap_defencoding = $this->soap_defencoding;
+				$proxy->endpoint = $this->endpoint;
+				$proxy->forceEndpoint = $this->forceEndpoint;
+				return $proxy;
+			}
+		}
+		return $this->getError();
 	}
 
 	/**
