Enter description here...

@param string $wsdl
@param bool $forceNuSoap
@return SoapClient
346354
public static function GetService($wsdl, $forceNuSoap = false)
	{
		if (extension_loaded("soap") && !$forceNuSoap)
		{
			Debug::PrintValue("Local");
			$client = new SoapClient($wsdl);
			return $client;
		}
		else 
		{
			Debug::PrintValue("NuSoap");
			if (!SoapClientWrapper::$_readed)
			{
				//Debug::PrintValue("Read NuSoap");
		    	require_once("nusoap.php");
		    	SoapClientWrapper::$_readed = true;
			}
			$client = new nusoap_client($wsdl, 'wsdl');
			$proxy = $client->getProxy();
			return $proxy;
		}
	}
1266593
function doRequest($action, $params = [], $config = []) {
    $this->request_input = ['action' => $action, 'parameters' => $params];

    return $this->getSoapClient($config)->__soapCall($action, [$params]);
  }
1372001
public function generateClient(Wsdl $wsdl): string
    {
        return $this->twig->render('client.html', ['wsdl' => $wsdl, 'namespace' => $this->getNamespace()]);
    }
348058
public function getToken($forceNew = false)
    {
        /** @var Session $session */
        $session = $this->session;

        $token = $session->get(static::TOKEN_KEY);

        // Create a token
        if ($token === null || $forceNew) {
            $token = $this->createToken(12);

            $session->set(static::TOKEN_KEY, $token);
        }

        return $token;
    }
273292
public function soapServerAction()
    {
        try {
            $apiModel = $this->_getModelName($this->obj);
            //parametry WSDL
            $wsdlParams = [
                'module' => 'cms',
                'controller' => 'api',
                'action' => 'wsdl',
                'obj' => $this->obj,
            ];
            //prywatny serwer
            if (\Mmi\App\FrontController::getInstance()->getEnvironment()->authUser) {
                $apiModel .= 'Private';
                $auth = new \Mmi\Security\Auth;
                $auth->setModelName($apiModel);
                $auth->httpAuth('Private API', 'Access denied!');
                $wsdlParams['type'] = 'private';
            }
            //ścieżka do WSDL
            $url = $this->view->url($wsdlParams, true, true, $this->_isSsl());
            //typ odpowiedzi na application/xml
            $this->getResponse()->setTypeXml();
            //powołanie klasy serwera SOAP
            $soap = new SoapServer($url);
            $soap->setClass($apiModel);
            //obsługa żądania
            $soap->handle();
            return '';
        } catch (\Exception $e) {
            //rzuca wyjątek internal
            return $this->_internalError($e);
        }
    }
1011442
protected function getSoapClient()
    {
      if(!isset($this->wsdl))
        throw new Exception(__METHOD__ .'; No WSDL set');
        
      if(!(is_null($this->client) && $this->client instanceof SoapClient))
        $this->client = new SoapClient($this->wsdl);
          
      return $this->client;
    }
524167
@Override
  public BindingProvider createSoapClient(SoapServiceDescriptor soapServiceDescriptor)
      throws ServiceException {
    try {
      if (soapServiceDescriptor instanceof JaxWsCompatible) {
        JaxWsCompatible jaxWsCompatibleService = (JaxWsCompatible) soapServiceDescriptor;
        Object portLocator = jaxWsCompatibleService.getServiceClass()
            .getConstructor(new Class[0]).newInstance(new Object[0]);
        String interfaceClassName = soapServiceDescriptor.getInterfaceClass().getSimpleName();
        BindingProvider soapClient = (BindingProvider) portLocator.getClass()
            .getMethod("get" + interfaceClassName + "Port").invoke(portLocator);

        // Required for App Engine to avoid default 10s timeout for UrlFetch requests.
        setConnectTimeout(soapClient);

        @SuppressWarnings("rawtypes") // getHandlerChain returns a list of raw Handler.
        List<Handler> bindings = soapClient.getBinding().getHandlerChain();
        bindings.add(contextHandlerProvider.get());
        soapClient.getBinding().setHandlerChain(bindings);
        return soapClient;
      }
      throw new ServiceException(
          "Service [" + soapServiceDescriptor + "] is not compatible with JAX-WS", null);
    } catch (SecurityException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (NoSuchMethodException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (IllegalArgumentException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (IllegalAccessException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (InvocationTargetException e) {
      throw new ServiceException("Unexpected Exception.", e.getCause());
    } catch (ClassNotFoundException e) {
      throw new ServiceException("Unexpected Exception.", e);
    } catch (InstantiationException e) {
      throw new ServiceException("Unexpected Exception.", e);
    }
  }
541170
public function generateWsdl($className, $serviceUrl, $encoding='UTF-8')
	{
		$this->operations=array();
		$this->types=array();
		$this->elements=array();
		$this->messages=array();
		if($this->serviceName===null)
			$this->serviceName=$className;
		if($this->namespace===null)
			$this->namespace='urn:'.str_replace('\\','/',$className).'wsdl';

		$reflection=new ReflectionClass($className);
		foreach($reflection->getMethods() as $method)
		{
			if($method->isPublic())
				$this->processMethod($method);
		}

		$wsdl=$this->buildDOM($serviceUrl,$encoding)->saveXML();

		if(isset($_GET['makedoc']))
			$this->buildHtmlDocs();

		return $wsdl;
	}
987929
protected function createWSDL_binding()
    {
        /*
        <binding name="myServiceBinding" type="typens:myServicePort">
            <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                <operation name="hello">
                    <soap:operation soapAction="urn:myServiceAction"/>
                    <input>
                        <soap:body use="encoded" namespace="urn:myService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </input>
                    <output>
                        <soap:body use="encoded" namespace="urn:myService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </output>
            </operation>
        </binding>
        */
        $binding = $this->wsdl->createElement('binding');
        $binding->setAttribute('name', $this->wsdlclassname . 'Binding');
        $binding->setAttribute('type', 'typens:' . $this->wsdlclassname . 'Port');
        $soap_binding = $this->wsdl->createElement('soap:binding');
        $soap_binding->setAttribute('style', 'rpc');
        $soap_binding->setAttribute('transport', self::SCHEMA_SOAP_HTTP);
        $binding->appendChild($soap_binding);
        foreach ($this->wsdlStruct[$this->wsdlclassname]['method'] as $name => $vars) {
            $operation = $this->wsdl->createElement('operation');
            $operation->setAttribute('name', $name);
            $binding->appendChild($operation);
            $soap_operation = $this->wsdl->createElement('soap:operation');
            $soap_operation->setAttribute(
                'soapAction',
                'urn:'.$this->wsdlclassname.'Action'
            );
            $operation->appendChild($soap_operation);
            $input  = $this->wsdl->createElement('input');
            $output = $this->wsdl->createElement('output');
            $operation->appendChild($input);
            $operation->appendChild($output);
            $soap_body = $this->wsdl->createElement('soap:body');
            $soap_body->setAttribute('use', 'encoded');
            $soap_body->setAttribute('namespace', 'urn:'.$this->namespace);
            $soap_body->setAttribute('encodingStyle', self::SOAP_SCHEMA_ENCODING);
            $input->appendChild($soap_body);
            $soap_body = $this->wsdl->createElement('soap:body');
            $soap_body->setAttribute('use', 'encoded');
            $soap_body->setAttribute('namespace', 'urn:'.$this->namespace);
            $soap_body->setAttribute('encodingStyle', self::SOAP_SCHEMA_ENCODING);
            $output->appendChild($soap_body);
        }
        $this->wsdl_definitions->appendChild($binding);
    }
226295
public function setWsdl($wsdl)
    {
      if (!is_string($wsdl) || strlen(trim($wsdl)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid wsdl given, must be a non empty string');
        
        $this->wsdl = $wsdl;
    }
883798
function nusoap_server($wsdl=false){
		parent::nusoap_base();
		// turn on debugging?
		global $debug;
		global $HTTP_SERVER_VARS;

		if (isset($_SERVER)) {
			$this->debug("_SERVER is defined:");
			$this->appendDebug($this->varDump($_SERVER));
		} elseif (isset($HTTP_SERVER_VARS)) {
			$this->debug("HTTP_SERVER_VARS is defined:");
			$this->appendDebug($this->varDump($HTTP_SERVER_VARS));
		} else {
			$this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined.");
		}

		if (isset($debug)) {
			$this->debug("In nusoap_server, set debug_flag=$debug based on global flag");
			$this->debug_flag = $debug;
		} elseif (isset($_SERVER['QUERY_STRING'])) {
			$qs = explode('&', $_SERVER['QUERY_STRING']);
			foreach ($qs as $v) {
				if (substr($v, 0, 6) == 'debug=') {
					$this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #1");
					$this->debug_flag = substr($v, 6);
				}
			}
		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
			$qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']);
			foreach ($qs as $v) {
				if (substr($v, 0, 6) == 'debug=') {
					$this->debug("In nusoap_server, set debug_flag=" . substr($v, 6) . " based on query string #2");
					$this->debug_flag = substr($v, 6);
				}
			}
		}

		// wsdl
		if($wsdl){
			$this->debug("In nusoap_server, WSDL is specified");
			if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) {
				$this->wsdl = $wsdl;
				$this->externalWSDLURL = $this->wsdl->wsdl;
				$this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL);
			} else {
				$this->debug('Create wsdl from ' . $wsdl);
				$this->wsdl = new wsdl($wsdl);
				$this->externalWSDLURL = $wsdl;
			}
			$this->appendDebug($this->wsdl->getDebug());
			$this->wsdl->clearDebug();
			if($err = $this->wsdl->getError()){
				die('WSDL ERROR: '.$err);
			}
		}
	}
619269
function Salesforce(username, password, token, wsdl) {

    //Required NodeJS libraries
    this.q = require("q");
    this.soap = require("soap");

    //Salesforce access data
    this.username = username;
    this.password = password;
    this.token = token;
    this.wsdl = wsdl || "./node_modules/soap_salesforce/wsdl/enterprise.xml";

    //Other properties
    this.promise; //A promise will be used for returning soapClient after finishing Salesforce login
    this.soapClient; //Salesforce SOAP client instance will be stored here
}
323382
protected function soap(string $service, string $action, array $params = [])
    {
        $params["ObjectID"] = $this->id;

        if ($action === "Browse") {
            $params["Filter"] = "";
            $params["SortCriteria"] = "";
        }

        return $this->controller->soap($service, $action, $params);
    }
1298276
public function call($functionname, $params) {
        if ($this->token) {
            $this->serverurl->param('wstoken', $this->token);
        }
        $this->serverurl->param('wsdl', 1);

        $opts = array(
            'http' => array(
                'user_agent' => 'Moodle SOAP Client'
            )
        );
        $context = stream_context_create($opts);
        $this->options['stream_context'] = $context;
        $this->options['cache_wsdl'] = WSDL_CACHE_NONE;

        $client = new SoapClient($this->serverurl->out(false), $this->options);

        return $client->__soapCall($functionname, $params);
    }
571983
public function signRequest(RequestInterface $request, $forceNew = false)
    {
        try {
            // force-get a new token if it was requested, if not, the regular
            // caching mechanism will be used so the call is not necessary here.
            if (true === $forceNew) {
                $this->pool->getToken($forceNew);
            }

            // create a new request with the new uri and the token added to the headers
            $uri = Uri::resolve(
                new Uri($this->pool->getEndpointUrl()),
                $request->getUri()
            );

            return $request
                ->withUri($uri)
                ->withHeader('X-Auth-Token', $this->pool->getTokenId())
            ;
        } catch (TokenException $e) {
            throw new ClientException('Could not obtain token', $request, null, $e);
        }
    }
1045742
public function loadWSDL()
    {
        $this->debug('instantiating wsdl class with doc: ' . $this->wsdlFile);
        $this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
        $this->wsdl->setCredentials($this->username, $this->password, $this->authtype, $this->certRequest);
        $this->wsdl->fetchWSDL($this->wsdlFile);
        $this->checkWSDL();
    }
847581
public function __soapCall(
        $function_name,
        $arguments,
        $options = null,
        $input_headers = null,
        &$output_headers = null
    ) {
        $class = get_class($this);


        $service = strtr(substr($class, strrpos($class, '\\') + 1), ['ServiceService' => 'Service']);
        $this->__setCookie('timestamp', $timestamp = time());
        $this->__setCookie('nonce', $nonce = uniqid('', true));
        $this->__setCookie('signature', $this->urlEncode($this->sign(array_merge($arguments, [
            '__method' => $function_name,
            '__service' => $service,
            '__hostname' => $this->endpoint,
            '__timestamp' => $timestamp,
            '__nonce' => $nonce,

        ]))));
        return parent::__soapCall($function_name, $arguments, $options, $input_headers, $output_headers);
    }