Adds a new operation to the given service.

@param string operation name
@param string service name

@return domElement
511017
private function addOperation($operationName, $serviceName)
    {
        $this->addToDebug("Adding Operation: '$operationName : $serviceName'");
        $operationTag = $this->addElement('wsdl:operation', $this->portTypeTags[$serviceName]);
        $operationTag->setAttribute('name', $operationName);

        //create operation tag for binding
        $bindingOperationTag = $this->addElement('wsdl:operation', $this->bindingTags[$serviceName]);
        $bindingOperationTag->setAttribute('name', $operationName);

        //soap operation tag
        $soapOperationTag = $this->addElement('soap:operation', $bindingOperationTag);
        $soapOperationTag->setAttribute('soapAction', $this->url.'&method='.$operationName);
        $soapOperationTag->setAttribute('style', ($this->binding_style == SOAP_RPC) ? 'rpc' : 'document');

        //save references
        $this->operationTags[$serviceName][$operationName] = $operationTag;
        $this->bindingOperationTags[$serviceName][$operationName] = $bindingOperationTag;

        //and return
        return $operationTag;
    }
816015
public function create($name, ...$params) {
        if (!isset($this->services[$name])) throw new ServiceNotFoundException('Service "'.$name.'" not found.');
        try {
            return $this->services[$name]->resolve($factory=true, $params);
        }
        catch (\Exception $ex) {
            throw new ContainerException($ex->getMessage(), $ex->getCode(), $ex);
        }
    }
730197
public function addOperation(Operation $operation)
    {
        $id = $operation->getMethod() . $operation->getPath();

        if ($operation->getOperation()->getOperationId()) {
            $id = $operation->getOperation()->getOperationId();
        }

        $this[$id] = $operation;

        return $this;
    }
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;
    }
1045151
def add_operation(op, func_name, db):
    
    full_name = '{0}.{1}'.format(db, func_name)
    # TODO
    # if op.input_type is rlz.listof:
    #     translator = comp.varargs(full_name)
    # else:
    arity = len(op.signature)
    translator = comp.fixed_arity(full_name, arity)

    comp._operation_registry[op] = translator
13360
public Operation.Info create( String name , Variable var0 ) {
        Input1 func = input1.get(name);
        if( func == null )
            return null;
        return func.create(var0,managerTemp);
    }
1261875
@Nullable
  public ServerServiceDefinition addService(ServerServiceDefinition service) {
    return services.put(service.getServiceDescriptor().getName(), service);
  }
989913
public function addArgument(string $name, $value): Service
    {
        $this->arguments[$name] = $value;

        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;
  }
427556
public function set($name, $service)
    {
        if (isset($this->registry[$name])) {
            unset($this->registry[$name]);
        }
        if (isset($this->instances[$name])) {
            unset($this->instances[$name]);
        }
        if (null === $service) {
            return $this;
        }
        if (! is_string($service)) {
            $this->instances[$name] = $service;

            return $this;
        }
        $this->registry[$name] = $service;

        return $this;
    }
1046014
private function initializeService($service, $name, array $callDefinitions)
    {
        foreach ($callDefinitions as $callDefinition) {
            if (!is_array($callDefinition) || !isset($callDefinition['method'])) {
                throw new ContainerException($name.' service calls must be arrays containing a \'method\' key');
            } elseif (!is_callable([$service, $callDefinition['method']])) {
                throw new ContainerException($name.' service asks for call to uncallable method: '.$callDefinition['method']);
            }

            $arguments = isset($callDefinition['arguments']) ? $this->resolveArguments($callDefinition['arguments']) : [];

            call_user_func_array([$service, $callDefinition['method']], $arguments);
        }
    }
1251961
def service(container, name=None):
    
    def register(service):
        container.add_service(service, name)
        return service

    return register
586448
public function setService($name, $service)
    {
        $this->validate($service);
        parent::setService($name, $service);
    }
774043
public function registerService($service, $name = '') {
        if (empty($name)) {
            $name = Assist::classNameShort($service);
        }

        static::$container->offsetSet(strtolower($name), $service);
    }
849477
public static br add(nitro_service client, br resource) throws Exception
	{
		resource.validate("add");
		return ((br[]) resource.perform_operation(client, "add"))[0];
	}
834645
protected function createContainer($name)
    {
        $this->containers[$name] = new Container($this->getView(), $this->service, $name);
    }
1003288
public function createService($name, ArrayObject $config = NULL, $merge_into_config = FALSE) {
        if($merge_into_config) {
            $service_config = $this->config->offsetExists($name) ? $this->config->offsetGet($name) : new ArrayObject;

            if(is_array($service_config)) {
                $service_config = ArrayObject::fromArray($service_config);
            }

            if($config) {
                $service_config->merge($config);
            }
        }
        else {
            $service_config = $config ?: new ArrayObject;
        }

        if(!$this->hasService($name)) {
            throw new Exception("Service '$name' does not exist.");
        }

        $service = $this->services[$name];

        if(array_key_exists("classname", $service)) {
            $reflection = new ReflectionClass($service["classname"]);

            $params = new ArrayObject($service["params"]);
            $params->merge($service_config);

            if($reflection->implementsInterface("Loops\ServiceInterface")) {
                return call_user_func_array([$service["classname"], "getService" ], [ $params, $this ]);
            }
            else {
                $params->offsetSet("loops", $this);
                return Misc::reflectionInstance($service["classname"], $params);
            }
        }

        if(array_key_exists("callback", $service)) {
            $params = new ArrayObject($service["params"]);
            $params->merge($service_config);
            return call_user_func_array($service["callback"], $params->toArray());
        }

        if(array_key_exists("object", $service)) {
            return $service["object"];
        }
    }