Invokes zimbra soap request.
12694
def invoke(self, ns, request_name, params, auth_token, simplify=False):
        
        ZimbraClientTransport.invoke(self,
                                     ns,
                                     request_name,
                                     params,
                                     auth_token,
                                     simplify)

        headers = SOAPpy.Types.headerType()

        if auth_token.token != None:
            data={sconstant.E_AUTH_TOKEN: auth_token.token,
                  sconstant.E_SESSION_ID: auth_token.session_id}
            context = SOAPpy.Types.structType(data=data, name=sconstant.CONTEXT)
            context._validURIs = []
            context._ns = (zconstant.SOAP_DEFAULT_PREFIX, zconstant.NS_ZIMBRA_URL)
            headers.context = context

        proxy = SOAPpy.SOAPProxy(self.soap_url,
                                 ns,
                                 header=headers,
                                 noroot=1,
                                 simplify_objects=simplify)
        proxy.config.debug = self.log.isEnabledFor(logging.DEBUG)
        proxy.config.strictNamespaces = 0
        proxy.config.buildWithNamespacePrefix = 0
        proxy.transport = self.http_transport

        _parseSOAP = SOAPpy.Parser._parseSOAP
        SOAPpy.Parser._parseSOAP = parseSOAP
        try:
            m = proxy.__getattr__(request_name)
            return m.__call__(**params)
        finally:
            SOAPpy.Parser._parseSOAP = _parseSOAP
677709
public SoapServerRequestActionBuilder receive() {
        SoapServerRequestActionBuilder soapServerRequestActionBuilder = new SoapServerRequestActionBuilder(action, soapServer)
                .withApplicationContext(applicationContext);
        return soapServerRequestActionBuilder;
    }
216669
public void requestCompleted (T result)
    {
        if (_chain != null) {
            _chain.requestCompleted(result);

        } else if (_invChain instanceof InvocationService.ResultListener) {
            ((InvocationService.ResultListener)_invChain).requestProcessed(result);

        } else if (_invChain instanceof InvocationService.ConfirmListener) {
            ((InvocationService.ConfirmListener)_invChain).requestProcessed();
        }
    }
602991
public SoapClientRequestActionBuilder send() {
        SoapClientRequestActionBuilder soapClientRequestActionBuilder;
        if (soapClient != null) {
            soapClientRequestActionBuilder = new SoapClientRequestActionBuilder(action, soapClient);
        } else {
            soapClientRequestActionBuilder = new SoapClientRequestActionBuilder(action, soapClientUri);
        }

        soapClientRequestActionBuilder.withApplicationContext(applicationContext);

        return soapClientRequestActionBuilder;
    }
145815
public function activate(): void
    {
        if ($this->stopBuffering) {
            $this->buffering = false;
        }
        if (!$this->handler instanceof HandlerInterface) {
            $record = end($this->buffer) ?: null;

            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }
        $this->handler->handleBatch($this->buffer);
        $this->buffer = [];
    }
212702
public String invokeService(Long processId, String ownerType,
            Long ownerId, String masterRequestId, String masterRequest,
            Map<String,String> parameters, String responseVarName, Map<String,String> headers) throws Exception {
        return invokeService(processId, ownerType, ownerId, masterRequestId, masterRequest, parameters, responseVarName, 0, null, null, headers);
    }
529415
private void invoke(final Request<?> marshalledRequest, final Bootstrap b, final PutMediaResponseHandler responseHandler) throws InterruptedException {
        b.connect().addListener(new GenericFutureListener<ChannelFuture>() {
            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
                try {
                    Channel channel = future.channel();

                    HttpRequest request = RequestAdapter.adapt(marshalledRequest);

                    // Send request
                    channel.writeAndFlush(request);

                    // Send chunked content
                    channel.writeAndFlush(new HttpChunkedInput(new ChunkedStream(marshalledRequest.getContent())));
                } catch (Exception e) {
                    responseHandler.onFailure(e);
                }
            }
        });
    }
1327831
def send_using_soap(self, request, destination, headers=None, sign=False):
        

        # _response = self.server.post(soap_message, headers, path=path)
        try:
            args = self.use_soap(request, destination, headers, sign)
            args["headers"] = dict(args["headers"])
            response = self.send(**args)
        except Exception as exc:
            logger.info("HTTPClient exception: %s", exc)
            raise

        if response.status_code == 200:
            logger.info("SOAP response: %s", response.text)
            return response
        else:
            raise HTTPError("%d:%s" % (response.status_code, response.content))
150849
def _send_request(self):
        
        
        # Generate the hash variable and parameters
        self._generate_hash()
        params = self._get_params()
        
        # Make the SOAP request
        try:
            resp = self._endpoint(**params)
            logger.debug(resp)
        except WebFault, e:
            logger.exception('An error occurred while making the SOAP request.')
            return None
        
        # Convert XML response into a dictionary
        self.response = XmlDictConfig(ElementTree.XML(smart_str(resp)))
        
        # Normalize dictionary values
        self.response = normalize_dictionary_values(self.response)
        
        # Log all non OK status codes
        if self.response['status']['errorCode'] != 'OK':
            logger.error(resp)
        
        return self.response
630960
public SoapServerFaultResponseActionBuilder sendFault() {
        SoapServerFaultResponseActionBuilder soapServerResponseActionBuilder = new SoapServerFaultResponseActionBuilder(action, soapServer)
                .withApplicationContext(applicationContext);
        return soapServerResponseActionBuilder;
    }
1122764
def execute(self, **kwargs):
        
        headers = self.header.copy()
        headers['soapaction'] = '%s#%s' % (self.service_type, self.name)
        data = self.envelope.strip() % self._body_builder(kwargs)
        url = 'http://%s:%s%s' % (self.address, self.port, self.control_url)
        auth = None
        if self.password:
            auth=HTTPDigestAuth(self.user, self.password)
        response = requests.post(url, data=data, headers=headers, auth=auth)
        # lxml needs bytes, therefore response.content (not response.text)
        result = self.parse_response(response.content)
        return result
406945
protected function performRequest($methodName, $params, array &$endpointOptions, array $soapOptions = [], array $soapHeaders = [])
    {
        $soapClient = $this->getSoapClient($endpointOptions);
        $response = null;

        if (!$soapClient) {
            throw new \RuntimeException('SoapConfigurableProducer requires a SoapClient as a dependency');
        }

        try {
            // creates a proper set of SoapHeader objects
            $processedSoapHeaders = array_map(function ($header) {
                if (is_array($header)) {
                    $header = new \SoapHeader($header[0], $header[1], $header[2]);
                }
                if (!$header instanceof \SoapHeader) {
                    throw new \InvalidArgumentException(sprintf(
                        'Invalid soap header "%s". Expected instance of \SoapHeader or array containing 3 values representing'.
                        ' "namespace", "header name" and "header value"',
                        json_encode($header)
                    ));
                }

                return $header;
            }, $soapHeaders);

            $soapClient->setExecutionTimeout($endpointOptions[ConfigurableWebserviceProtocol::OPTION_TIMEOUT]);

            $response = $soapClient->__soapCall($methodName, $params, $soapOptions, $processedSoapHeaders);

            $lastResponseCode = $soapClient->__getLastResponseCode();
            if ($lastResponseCode >= 400 && $lastResponseCode <= 599) {
                $this->throwUnrecoverableSoapProducerException('Unrecoverable error. SOAP HTTP Response code is '.$lastResponseCode.', 200 was expected.', $soapClient);
            } elseif (200 != $lastResponseCode) {
                $this->throwRecoverableSoapProducerException('Recoverable error. SOAP HTTP Response code is '.$lastResponseCode.', 200 was expected.', $soapClient);
            }
        } catch (\Exception $ex) {
            $this->throwRecoverableSoapProducerException($ex->getMessage(), $soapClient, $this->getDisplayResponseError(), $ex->getCode(), $ex);
        }

        return $response;
    }
1344814
def send_request(req=None, method=None, requires_response=True):
    """"""
    if req is None:
        return functools.partial(send_request, method=method,
                                 requires_response=requires_response)

    @functools.wraps(req)
    def wrapper(self, *args, **kwargs):
        params = req(self, *args, **kwargs)
        _id = self.send(method, params, requires_response)
        return _id
    wrapper._sends = method
    return wrapper
420803
def callback(self, request, **kwargs):
        
        return super(ServiceTrello, self).callback(request, **kwargs)
834486
def prepare(self):
        """"""
        headers = self.prepare_headers(self.http_headers, self.soap_action)

        soap_header = self.prepare_soap_header(self.soap_header)
        soap_body = self.prepare_soap_body(
            self.method, self.parameters, self.namespace
        )
        data = self.prepare_soap_envelope(soap_header, soap_body)
        return (headers, data)
1299347
protected function initiateSubRequest()
    {
        if (!$this->controller instanceof AbstractWidgetController) {
            if (isset($this->controller)) {
                throw new MissingControllerException('initiateSubRequest() can not be called if there is no valid controller extending TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController. Got "' . get_class($this->controller) . '" in class "' . get_class($this) . '".', 1289422564);
            }
            throw new MissingControllerException('initiateSubRequest() can not be called if there is no controller inside $this->controller. Make sure to add a corresponding injectController method to your WidgetViewHelper class "' . get_class($this) . '".', 1284401632);
        }
            /** @var $subRequest \ApacheSolrForTypo3\Solr\Widget\WidgetRequest */
        $subRequest = $this->objectManager->get(SolrFluidWidgetRequest::class);
        $subRequest->setWidgetContext($this->widgetContext);

        $this->passArgumentsToSubRequest($subRequest);
        $subResponse = $this->objectManager->get(Response::class);
        $this->controller->processRequest($subRequest, $subResponse);
        return $subResponse;
    }
14307
def invoke(client, method, **kwargs):
    """"""
    try:
        # Proxy the method to the suds service
        result = getattr(client.service, method)(**kwargs)
    except AttributeError:
        logger.critical("Unknown method: %s", method)
        raise
    except URLError as e:
        logger.debug(pprint(e))
        logger.debug("A URL related error occurred while invoking the '%s' "
              "method on the VIM server, this can be caused by "
              "name resolution or connection problems.", method)
        logger.debug("The underlying error is: %s", e.reason[1])
        raise
    except suds.client.TransportError as e:
        logger.debug(pprint(e))
        logger.debug("TransportError: %s", e)
    except suds.WebFault as e:
        # Get the type of fault
        logger.critical("SUDS Fault: %s" % e.fault.faultstring)
        if len(e.fault.faultstring) > 0:
            raise

        detail = e.document.childAtPath("/Envelope/Body/Fault/detail")
        fault_type = detail.getChildren()[0].name
        fault = create(fault_type)
        if isinstance(e.fault.detail[0], list):
            for attr in e.fault.detail[0]:
                setattr(fault, attr[0], attr[1])
        else:
            fault["text"] = e.fault.detail[0]

        raise VimFault(fault)

    return result