Helper method to construct the appropriate SOAP-body to call a
        FritzBox-Service.
979266
def _body_builder(self, kwargs):
        
        p = {
            'action_name': self.name,
            'service_type': self.service_type,
            'arguments': '',
            }
        if kwargs:
            arguments = [
                self.argument_template % {'name': k, 'value': v}
                for k, v in kwargs.items()
            ]
            p['arguments'] = ''.join(arguments)
        body = self.body_template.strip() % p
        return body
328920
def on_complete(env)
      env[:body] = Nori.new(
        strip_namespaces: true,
        convert_tags_to: ->(tag) { tag.snakecase.to_sym }
      ).parse(env[:body])

      raise SOAPError, "Invalid SOAP response" if env[:body].empty?

      env[:body] = env[:body][:envelope][:body]
      env[:body] = find_key_in_hash(env[:body], @key)
    end
1368385
def soap_action(self, service, action, payloadbody):
        
        payload = self.soapenvelope.format(body=payloadbody).encode('utf-8')
        headers = ['SOAPAction: ' + action,
                   'Content-Type: application/soap+xml; charset=UTF-8',
                   'Content-Length: ' + str(len(payload))]

        try:
            curl = pycurl.Curl()
            curl.setopt(pycurl.SSL_CIPHER_LIST, "AES256-SHA")
            curl.setopt(pycurl.SSLVERSION, pycurl.SSLVERSION_TLSv1_0)
    #        self.curl.setopt(pycurl.CAINFO,'ihc.crt')
            curl.setopt(pycurl.SSL_VERIFYPEER, 0)
            curl.setopt(pycurl.SSL_VERIFYHOST, 0)
            curl.setopt(pycurl.POST, 1)
            curl.setopt(pycurl.HEADERFUNCTION, IHCCurlConnection._write_header)

            curl.setopt(pycurl.HTTPHEADER, headers)
            inbuffer = BytesIO(payload)
            curl.setopt(pycurl.READDATA, inbuffer)
            buffer = BytesIO()
            curl.setopt(pycurl.WRITEDATA, buffer)
            curl.setopt(pycurl.URL, self.url + service)
            curl.setopt(pycurl.COOKIE, IHCCurlConnection.cookies)
    #        curl.setopt(pycurl.VERBOSE,1)
            curl.perform()
            body = buffer.getvalue().decode('utf-8')
            code = curl.getinfo(pycurl.HTTP_CODE)
            curl.close()
        except Exception as exp:
            return False
        if code != 200:
            return False
        try:
            xdoc = xml.etree.ElementTree.fromstring(body)
        except xml.etree.ElementTree.ParseError:
            return False
        return xdoc
1192283
public static CPOptionCategory toModel(CPOptionCategorySoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CPOptionCategory model = new CPOptionCategoryImpl();

		model.setUuid(soapModel.getUuid());
		model.setCPOptionCategoryId(soapModel.getCPOptionCategoryId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setTitle(soapModel.getTitle());
		model.setDescription(soapModel.getDescription());
		model.setPriority(soapModel.getPriority());
		model.setKey(soapModel.getKey());
		model.setLastPublishDate(soapModel.getLastPublishDate());

		return model;
	}
1078580
public SoapClient setHeader(QName name) {
		return setHeader(name, null, null, null, null);
	}
1110473
public function buildCurlClient()
    {
        //
        // Use PHP Native cURL because the various Soap clients (BeSimple,
        // PHP native SoapClient) can't handle the WSDL file.
        //
        $this->curl = curl_init($this->getEndPoint());

        $sslCertificate = $this->getSslCertificate();
        $sslKey         = $this->getSslKey();
        $sslKeyPassword = $this->getSslKeyPassword();
        $userName       = $this->getUsername();
        $password       = $this->getPassword();
        $headers        = $this->getHeaders();

        // configuring cURL not to verify the server certificate
        curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);

        // setting the path where cURL can find the client certificate
        curl_setopt($this->curl, CURLOPT_SSLCERT, $sslCertificate);

        // setting the path where cURL can find the client certificate’s
        // private key
        curl_setopt($this->curl, CURLOPT_SSLKEY, $sslKey);

        // setting the key password
        curl_setopt($this->curl, CURLOPT_SSLKEYPASSWD, $sslKeyPassword);

        // setting the request type to POST
        curl_setopt($this->curl, CURLOPT_POST, 1);

        // setting the content type
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);

        // setting the authorization method to BASIC
        curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

        // supplying your credentials
        curl_setopt($this->curl, CURLOPT_USERPWD, $userName . ':' . $password);

        // telling cURL to return the HTTP response body as operation result
        // value when calling curl_exec
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);

        return $this->curl;
    }
346044
def add_operations(self, root, definitions):
        
        dsop = Element('operation', ns=soapns)
        for c in root.getChildren('operation'):
            op = Facade('Operation')
            op.name = c.get('name')
            sop = c.getChild('operation', default=dsop)
            soap = Facade('soap')
            soap.action = '"%s"' % sop.get('soapAction', default='')
            soap.style = sop.get('style', default=self.soap.style)
            soap.input = Facade('Input')
            soap.input.body = Facade('Body')
            soap.input.headers = []
            soap.output = Facade('Output')
            soap.output.body = Facade('Body')
            soap.output.headers = []
            op.soap = soap
            input = c.getChild('input')
            if input is None:
                input = Element('input', ns=wsdlns)
            body = input.getChild('body')
            self.body(definitions, soap.input.body, body)
            for header in input.getChildren('header'):
                self.header(definitions, soap.input, header)
            output = c.getChild('output')
            if output is None:
                output = Element('output', ns=wsdlns)
            body = output.getChild('body')
            self.body(definitions, soap.output.body, body)
            for header in output.getChildren('header'):
                self.header(definitions, soap.output, header)
            faults = []
            for fault in c.getChildren('fault'):
                sf = fault.getChild('fault')
                if sf is None:
                    continue
                fn = fault.get('name')
                f = Facade('Fault')
                f.name = sf.get('name', default=fn)
                f.use = sf.get('use', default='literal')
                faults.append(f)
            soap.faults = faults
            self.operations[op.name] = op
648575
@VisibleForTesting
  C createServiceClient(Object soapClient, D adsServiceDescriptor, S adsSession) {
    return adsServiceClientFactory.create(soapClient, adsServiceDescriptor, adsSession);
  }
998060
def processRequest(cls, ps, **kw):
        
        resource = kw['resource']
        request = kw['request']
        method =  getattr(resource, 'soap_%s' %
                           _get_element_nsuri_name(ps.body_root)[-1])
                                              
        try:
            req_pyobj,rsp_pyobj = method(ps, request=request)
        except TypeError, ex:
            log.err(
                'ERROR: service %s is broken, method MUST return request, response'\
                    % cls.__name__
            )
            raise
        except Exception, ex:
            log.err('failure when calling bound method')
            raise
        
        return rsp_pyobj
1174931
def call_webservice(method_name, arguments, schema_url, service_path)

      # Perform the call to the webservice and returns the result
      Operations::WebserviceCall.new(@rforce_binding, method_name, arguments, schema_url, service_path).run()

    end
331593
def soaproot(self):
        """"""
        for ns in (soapns, soap12ns):
            sr = self.root.getChild("binding", ns=ns)
            if sr is not None:
                return sr
1279033
def get_service(service_symbol, options, unwrap_bool)
		    raise "No SOAP client instantiated" unless @client

			request_options = build_request(options)

			raise "No SourceCredentials supplied" if !@src_creds || !request_options[SRC_CREDS] #Just checking for :source_credentials does not 
			#check all possiblities as "SourceCredentials", 
			response = @client.request Mb::Meta::NS, service_symbol do
				soap.body = 
				{	
					"Request" => request_options
				}
		    end	
			if unwrap_bool
				#Unwrap response to hash array underneath)
			    plural = service_symbol.to_s.gsub("get_", "")
				singular =plural[0..-2] #Remove last
			   	r = response.to_hash
				basify = lambda {|enda| (service_symbol.to_s + "_" + enda).to_sym }  
				r = r[basify.call('response')][basify.call('result')]
				return [] if r[:result_count] == "0"
				r = r[plural.to_sym][singular.to_sym]

				return r	 
			end
			
			response
		end
815379
public String getMessageCode(BaseMessage externalMessage)
    {
        if (!(externalMessage.getExternalMessage() instanceof SoapTrxMessageIn))
            return null;
        SOAPMessage message = (SOAPMessage)((SoapTrxMessageIn)externalMessage.getExternalMessage()).getRawData();
        try {
            // Message creation takes care of creating the SOAPPart - a
            // required part of the message as per the SOAP 1.1
            // specification.
            SOAPPart sp = message.getSOAPPart();
            
            // Retrieve the envelope from the soap part to start building
            // the soap message.
            SOAPEnvelope envelope = sp.getEnvelope();
            
            // Create a soap header from the envelope.
            //?SOAPHeader hdr = envelope.getHeader();
            
            // Get the body
            SOAPBody body = envelope.getBody();
            SOAPElement element = this.getElement(body, null);
            if (element != null)
                return element.getElementName().getLocalName();   // The operation            
        } catch(Throwable ex) {
            ex.printStackTrace();
        }
        return null;    // No type found.
    }
1134449
public SoapServerActionBuilder server(WebServiceServer soapServer) {
		SoapServerActionBuilder serverAction = new SoapServerActionBuilder(action, soapServer)
				.withApplicationContext(applicationContext);
		return serverAction;
	}
984952
def _CreateMethod(self, method_name):
    
    soap_service_method = getattr(self.suds_client.service, method_name)

    def MakeSoapRequest(*args):
      """Perform a SOAP call."""
      AddToUtilityRegistry('suds')
      self.SetHeaders(
          self._header_handler.GetSOAPHeaders(self.CreateSoapElementForType),
          self._header_handler.GetHTTPHeaders())

      try:
        return soap_service_method(
            *[_PackForSuds(arg, self.suds_client.factory,
                           self._packer) for arg in args])
      except suds.WebFault as e:
        if _logger.isEnabledFor(logging.WARNING):
          _logger.warning('Response summary - %s',
                          _ExtractResponseSummaryFields(e.document))

        _logger.debug('SOAP response:\n%s', e.document.str())

        if not hasattr(e.fault, 'detail'):
          exc = (googleads.errors.
                 GoogleAdsServerFault(e.document, message=e.fault.faultstring))
          raise exc  # Done this way for 2to3

        # Before re-throwing the WebFault exception, an error object needs to be
        # wrapped in a list for safe iteration.
        fault = e.fault.detail.ApiExceptionFault
        if not hasattr(fault, 'errors') or fault.errors is None:
          exc = (googleads.errors.
                 GoogleAdsServerFault(e.document, message=e.fault.faultstring))
          raise exc  # Done this way for 2to3

        obj = fault.errors
        if not isinstance(obj, list):
          fault.errors = [obj]

        exc = googleads.errors.GoogleAdsServerFault(e.document, fault.errors,
                                                    message=e.fault.faultstring)
        raise exc  # Done this way for 2to3

    return MakeSoapRequest
502500
def _call(self, name, soapheaders):
        
        
        def call_closure(*args, **kwargs):
            """Call the named remote web service method."""
            if len(args) and len(kwargs):
                raise TypeError, 'Use positional or keyword argument only.'
                
            if len(args) > 0:
                raise TypeError, 'Not supporting SOAPENC:Arrays or XSD:List'
            
            if len(kwargs): 
                args = kwargs

            callinfo = getattr(self, name).callinfo
    
            # go through the list of defined methods, and look for the one with
            # the same number of arguments as what was passed.  this is a weak
            # check that should probably be improved in the future to check the
            # types of the arguments to allow for polymorphism
            for method in self._methods[name]:
                if len(method.callinfo.inparams) == len(kwargs):
                    callinfo = method.callinfo
    
            binding = _Binding(url=self._url or callinfo.location,
                              soapaction=callinfo.soapAction,
                              **self._kw)
    
            kw = dict(unique=True)
            if callinfo.use == 'encoded':
                kw['unique'] = False
    
            if callinfo.style == 'rpc':
                request = TC.Struct(None, ofwhat=[], 
                                 pname=(callinfo.namespace, name), **kw)
                
                response = TC.Struct(None, ofwhat=[], 
                                 pname=(callinfo.namespace, name+"Response"), **kw)
                
                if len(callinfo.getInParameters()) != len(args):
                    raise RuntimeError('expecting "%s" parts, got %s' %(
                           str(callinfo.getInParameters(), str(args))))
                
                for msg,pms in ((request,callinfo.getInParameters()), 
                                (response,callinfo.getOutParameters())):
                    msg.ofwhat = []
                    for part in pms:
                        klass = GTD(*part.type)
                        if klass is None:
                            if part.type:
                                klass = filter(lambda gt: part.type==gt.type,TC.TYPES)
                                if len(klass) == 0:
                                    klass = filter(lambda gt: part.type[1]==gt.type[1],TC.TYPES)
                                    if not len(klass):klass = [TC.Any]
                                if len(klass) > 1: #Enumerations, XMLString, etc
                                    klass = filter(lambda i: i.__dict__.has_key('type'), klass)
                                klass = klass[0]
                            else:
                                klass = TC.Any
                    
                        msg.ofwhat.append(klass(part.name))
                        
                    msg.ofwhat = tuple(msg.ofwhat)
                if not args: args = {}
            else:
                # Grab <part element> attribute
                ipart,opart = callinfo.getInParameters(),callinfo.getOutParameters()
                if ( len(ipart) != 1 or not ipart[0].element_type or 
                    ipart[0].type is None ):
                    raise RuntimeError, 'Bad Input Message "%s"' %callinfo.name
        
                if ( len(opart) not in (0,1) or not opart[0].element_type or 
                    opart[0].type is None ):
                    raise RuntimeError, 'Bad Output Message "%s"' %callinfo.name
                
#                if ( len(args) > 1 ):
#                    raise RuntimeError, 'Message has only one part:  %s' %str(args)
                
                ipart = ipart[0]
                request,response = GED(*ipart.type),None
                if opart: response = GED(*opart[0].type)
    
            msg = args
            if self._asdict: 
                if not msg: msg = dict()
                self._nullpyclass(request)
            elif request.pyclass is not None:
                if type(args) is dict:
                    msg = request.pyclass()
                    msg.__dict__.update(args)
                elif type(args) is list and len(args) == 1: 
                    msg = request.pyclass(args[0])
                else: 
                    msg = request.pyclass()
                    
            binding.Send(None, None, msg,
                         requesttypecode=request,
                         soapheaders=soapheaders,
                         encodingStyle=callinfo.encodingStyle)
            
            if response is None: 
                return None
            
            if self._asdict: self._nullpyclass(response)
            return binding.Receive(replytype=response,
                         encodingStyle=callinfo.encodingStyle)
            
        return call_closure
104116
def generateHeader(self, sObjectType):
    '''
    
    '''
    try:
      return self._sforce.factory.create(sObjectType)
    except:
      print 'There is not a SOAP header of type %s' % sObjectType