You are here

function soapclient::getProxy in Salesforce Suite 5

Same name and namespace in other branches
  1. 5.2 includes/nusoap.orig.php \soapclient::getProxy()

* dynamically creates an instance of a proxy class, * allowing user to directly call methods from wsdl * *

Return value

object soap_proxy object * @access public

File

includes/nusoap.orig.php, line 6968

Class

soapclient
soapclient higher level class for easy usage.

Code

function getProxy() {
  $r = rand();
  $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;
}