Init WebService Call

@param string $service server method to use

@return bool
778475
private function init($service)
    {
        //====================================================================//
        // Debug
        Splash::log()->deb('MsgWsCall');
        //====================================================================//
        // Safety Check
        if (!$this->verify()) {
            return Splash::log()->err('ErrWsInValid');
        }
        //====================================================================//
        // Clean Data Input Buffer
        $this->cleanIn();
        //====================================================================//
        // Prepare Data Output Buffer
        //====================================================================//
        // Fill buffer with Server Core infos
        $this->outputs->server = $this->getServerInfos();
        // Remote Service to call
        $this->outputs->service = $service;
        // Share Debug Flag with Server
        $this->outputs->debug = (int) SPLASH_DEBUG;

        return true;
    }
631887
public function setService($key, $service)
    {
        $this->set($key, $service);
        unset($this->instanceCache[$key]);
        return $this;
    }
1337499
public function propagate($service)
    {
        if(is_object($service) &&  ($service instanceof ServiceLocatorAwareInterface)){
            $service->setServiceLocator($this);
        }
        return $service;
    }
852624
public function addService($service)
    {
        $this->strategies[] = $service;
        $this->strategies = array_unique($this->strategies);
    }
1112992
public function setService($service)
    {
        $prefix = $this->getConfig('service_class_prefix');

        $this->service[$service] = $this->createInstance($service, $prefix, [$this->client]);
    }
1053234
protected function initServiceClient()
    {
        if ($this->httpClient === null) {
            $this->initHttpClients();
        }

        $serviceDescription = new Description($this->config->getServiceDescriptionConfig());
        $serviceClient = new GuzzleClient($this->getHttpClient(), $serviceDescription);

        foreach ($this->config->getClientDefaultsConfig() as $option => $value) {
            $serviceClient->setConfig($option, $value);
        }

        $this->description = $serviceDescription;
        $this->serviceClient = $serviceClient;
    }
1036890
public function beforeWebMethod($service)
	{
		$safeMethods=array(
			'login',
			'getContacts',
		);
		$pattern='/^('.implode('|',$safeMethods).')$/i';
		if(!Yii::app()->user->isGuest || preg_match($pattern,$service->methodName))
			return true;
		else
			throw new CException('Login required.');
	}
616452
public function initialize(Server $server)
    {
        $this->server = $server;
        $server->on('beforeMethod:*', [$this, 'beforeMethod']);
        $server->on('beforeCreateFile', [$this, 'beforeCreateFile']);
    }
47724
public static function initialize($configuration = NULL)
	{
		if($configuration) {
			self::setConfiguration($configuration);
		}

		if(!self::$configuration instanceof Configuration) {
			throw new InvalidConfigurationException("Consumerr is not properly configured.");
		}
		if(self::$enabled) {
			self::log("Multiple calls to initialize - ignore");
			return FALSE;
		}

		if (self::$configuration->isClientDisabled()) {
			self::log('Client IP is disabled by current configuration.');

			return FALSE; //nothing to do here
		}
		if (self::$configuration->isCliDisabled()) {
			self::log('CLI is disabled by current configuration.');

			return FALSE; //nothing to do here
		}
		self::$enabled = TRUE;
		self::getTime();

		$errorPage = self::$configuration->getErrorPage();
		if ($errorPage !== false) {
			ErrorHandler::register($errorPage);
		}

		if (!self::isConsole()) {
			if (self::$configuration->isAsyncEnabled()) {
				ob_start();
			}

			self::getAccess()->setUrl(
				(isset($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'off') ? 'https://' : 'http://')
				. (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''))
				. $_SERVER['REQUEST_URI']
			);

			if (isset($_SERVER['SERVER_NAME'])) {
				self::getAccess()->setServerName($_SERVER['SERVER_NAME']);
			}

			if (isset($_SERVER['REMOTE_ADDR'])) {
				self::getAccess()->setRemoteAddr($_SERVER['REMOTE_ADDR']);
			}

			if (isset($_SERVER['SCRIPT_NAME'])) {
				self::getAccess()->setName($_SERVER['SCRIPT_NAME']);
			}

			if (isset($_SERVER['REQUEST_METHOD'])) {
				self::getAccess()->setMethod($_SERVER['REQUEST_METHOD']);
			}
			
			if (function_exists('getallheaders')) {
				self::getAccess()->setHeaders(getallheaders());
			}


			if (isset($_SERVER['HTTP_USER_AGENT'])) {
				self::getAccess()->setUserAgent($_SERVER['HTTP_USER_AGENT']);
			}
		} else {
			self::getAccess()->setName(self::getCliArguments());
			self::getAccess()->setBackgroundJob(TRUE);
		}

		self::registerSenderShutdownHandler();

		return TRUE;
	}
1184128
public function service($service){

	    if(!$this->exists($service)){
	        throw new ServiceNotFoundException(sprintf('Service "%s" not found', $service));
	    }

		return new Worker($this, $service);
	}
1346490
public function handleService($service, $resource = null)
    {
        $request = new ServiceRequest();

        return $this->handleServiceRequest($request, $service, $resource);
    }
345448
public function init()
    {
        // Retrieve the default service container.
        $container = $this->getContainer();

        // Now load the additional service configurations.
        $this->loadServiceConfigurations($container);

        // Finally call the HOOKs to allow additional handling.
        $this->callHooks($container);
    }
366584
public function setService($name, $service)
    {
        $this->services[$name] = $service;
        $this->serviceConfiguration[$name]['persistent'] = true;
        return $this;
    }
1093877
private function setService($service)
    {
        try {
            $this->service = $this->adWordsServices->get($this->session, $service);
        } catch (\Exception $e) {
            throw new \Edujugon\GoogleAds\Exceptions\Service("The service '$service' is not available. Please pass a valid service");
        }

    }
230875
public function set($id, $service)
    {
        // Runs the internal initializer; used by the dumped container to include always-needed files
        if (isset($this->privates['service_container']) && $this->privates['service_container'] instanceof \Closure) {
            $initialize = $this->privates['service_container'];
            unset($this->privates['service_container']);
            $initialize();
        }

        $id = $this->normalizeId($id);

        if ('service_container' === $id) {
            throw new InvalidArgumentException('You cannot set service "service_container".');
        }

        if (isset($this->privates[$id]) || !(isset($this->fileMap[$id]) || isset($this->methodMap[$id]))) {
            if (!isset($this->privates[$id]) && !isset($this->getRemovedIds()[$id])) {
                // no-op
            } elseif (null === $service) {
                @trigger_error(sprintf('The "%s" service is private, unsetting it is deprecated since Symfony 3.2 and will fail in 4.0.', $id), E_USER_DEPRECATED);
                unset($this->privates[$id]);
            } else {
                @trigger_error(sprintf('The "%s" service is private, replacing it is deprecated since Symfony 3.2 and will fail in 4.0.', $id), E_USER_DEPRECATED);
            }
        } elseif (isset($this->services[$id])) {
            if (null === $service) {
                @trigger_error(sprintf('The "%s" service is already initialized, unsetting it is deprecated since Symfony 3.3 and will fail in 4.0.', $id), E_USER_DEPRECATED);
            } else {
                @trigger_error(sprintf('The "%s" service is already initialized, replacing it is deprecated since Symfony 3.3 and will fail in 4.0.', $id), E_USER_DEPRECATED);
            }
        }

        if (isset($this->aliases[$id])) {
            unset($this->aliases[$id]);
        }

        if (null === $service) {
            unset($this->services[$id]);

            return;
        }

        $this->services[$id] = $service;
    }
1033866
public function setService($name, $service, $parameters = null)
    {
        $name = strtolower($name);
        if ($service instanceof \Closure) {

            /**
             * Save directly the service in the
             * container.
             */
            $this->registerService($name, $service);

        } elseif (class_exists($service, true)) {

            /**
             * instantiation and initialization of
             * each service, return true on success
             * and false on error
             */
            $this->registerService($name, new $service($parameters));
        }
        return $this;
    }
1043607
public function addService(Service $service) {
    if (!in_array($service, $this->services, TRUE)) {
      $this->services[] = $service;
      
      if ($service instanceof \Psc\System\LoggerObject && $service->getLogger() instanceof \Psc\System\DispatchingLogger) {
        $this->getLogger()->listenTo($service->getLogger());
      }
    }
    return $this;
  }