Generate SOAP parameters.
970330
def _get_params(self):
        
        
        params = {'accountNumber': self._service.accountNumber}
        
        # Include object variables that are in field_order
        for key, val in self.__dict__.iteritems():
            if key in self.field_order:
                
                # Turn into Unicode
                if isinstance(val, str,):
                    val = val.decode('utf8')
                
                params[key] = val
        
        # Set missing parameters as empty strings
        for key in self.field_order:
            if key not in params:
                params[key] = u''
        
        # Parameter sorting method
        def order_keys(k):
            if k[0] in self.field_order:
                return self.field_order.index(k[0])
            return len(self.field_order) + 1
        
        # Sort the ordered dictionary
        params = OrderedDict(sorted(params.items(), key=order_keys))
        
        # Add hash to dictionary if present
        if hasattr(self, 'hash') and self.hash is not None:
            params['hash'] = self.hash
        
        return params
1060927
def toDom(self, node):
        """"""
        wsdl = self.getWSDL()
        ep = ElementProxy(None, node)
        epc = ep.createAppendElement(DOM.GetWSDLUri(wsdl.version), 'part')
        epc.setAttributeNS(None, 'name', self.name)

        if self.element is not None:
            ns,name = self.element
            prefix = epc.getPrefix(ns)
            epc.setAttributeNS(None, 'element', '%s:%s'%(prefix,name))
        elif self.type is not None:
            ns,name = self.type
            prefix = epc.getPrefix(ns)
            epc.setAttributeNS(None, 'type', '%s:%s'%(prefix,name))
1227863
protected function soap() {
        if (!$this->soap instanceof SoapClient) {
            $this->soap = new SoapClient($this->url, $this->options);
            $this->soap->soap_defencoding = 'utf-8';
            $this->soap->xml_encoding = 'utf-8';
        }
        return $this->soap;
    }
878351
public SoapClient setParam(String name, Object value) {
		return setParam(name, value, true);
	}
374542
def _make_sql_params(self,kw):
        """"""
        vals = []
        for k,v in kw.iteritems():
            vals.append('%s=%s' %(k,self._conv(v)))
        return vals
1130470
def _convert_soap_method_args(*args):
    
    soap_args = []
    for arg_n, arg in enumerate(args):
        soap_args.append(('arg' + str(arg_n), arg))
    return soap_args
667542
def _create_request(headers, body):
        
        envelope = OrderedDict()
        for (namespace, alias) in Service.Namespaces.items():
            envelope['@xmlns:' + alias] = namespace
        envelope['soap:Header'] = headers
        envelope['soap:Body'] = body
        return xmltodict.unparse({'soap:Envelope': envelope}, encoding='utf-8')
502039
def generate(self):
        """"""
        for root, _, files in os.walk(self.source_dir):
            for fname in files:
                source_fpath = os.path.join(root, fname)
                self.generate_api_for_source(source_fpath)
338766
def setUp(self, item):
        '''
        '''
        assert isinstance(item, WSDLTools.Binding), \
              'expecting WSDLTools Binding instance'

        portType = item.getPortType()
        self._kwargs = KW.copy()
        self._kwargs['bind'] = NC_to_CN(item.name)
        self.operations = []
        self.rProp = portType.getResourceProperties() 
        soap_binding = item.findBinding(WSDLTools.SoapBinding)
        if soap_binding is None:
            raise Wsdl2PythonError,\
                'Binding(%s) missing WSDLTools.SoapBinding' %item.name

        for bop in item.operations:
            soap_bop = bop.findBinding(WSDLTools.SoapOperationBinding)
            if soap_bop is None:
                self.logger.warning(\
                    'Skip Binding(%s) operation(%s) no SOAP Binding Operation'\
                    %(item.name, bop.name),
                )
                continue

            #soapAction = soap_bop.soapAction
            if bop.input is not None:
                soapBodyBind = bop.input.findBinding(WSDLTools.SoapBodyBinding)
                if soapBodyBind is None:
                    self.logger.warning(\
                        'Skip Binding(%s) operation(%s) Bindings(%s) not supported'\
                        %(item.name, bop.name, bop.extensions)
                    )
                    continue
                
            op = portType.operations.get(bop.name)
            if op is None:
                raise Wsdl2PythonError,\
                    'no matching portType/Binding operation(%s)' % bop.name
                    
            c = self.operationclass(useWSA=self.useWSA, 
                    do_extended=self.do_extended)
            c.setUp(bop)
            self.operations.append(c)
700972
private function parseWsdl(): void
    {
        $this->printer->writeln('Parsing WSDL.');
        $client = new \SoapClient((string) $this->wsdl);

        foreach ($client->__getTypes() as $rawType) {
            $type = $this->parser->parseType($rawType);

            if ($type instanceof Struct) {
                $this->wsdl->addStruct($type);
            } elseif ($type instanceof Property) {
                $this->wsdl->addSimpleType($type);
            }
        }

        foreach ($client->__getFunctions() as $rawFunction) {
            $method = $this->parser->parseFunction($rawFunction);
            $this->wsdl->addMethod($method);
        }
    }
118729
def _params(sig):
        """"""
        params = []
        for p in sig.parameters:
            param = sig.parameters[p]
            optional = param.default != inspect.Signature.empty
            default = UIBuilder._safe_default(param.default) if param.default != inspect.Signature.empty else ''
            annotation = param.annotation if param.annotation != inspect.Signature.empty else ''
            type = UIBuilder._guess_type(default)

            # Create the parameter attribute dict
            p_attr = {
                "name": param.name,
                "label": param.name,
                "optional": optional,
                "default": default,
                "description": annotation,
                "hide": False,
                "type": type,
                "kinds": None,
                "choices": [],
                "id": None,
                "events": None
            }

            # Special choices handling for boolean parameters
            if isinstance(default, bool):
                p_attr['choices'] = {
                    'True': 'true',
                    'False': 'false'
                }

            # Append it to the list
            params.append(p_attr)
        return params
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
48872
def generate_xml
      values = { 
        'charset' => @options.charset,
        'files'   => gen_into(@files),
        'classes' => gen_into(@classes),
        'title'        => CGI.escapeHTML(@options.title),
      }
      
      # this method is defined in the template file
      write_extra_pages if defined? write_extra_pages

      template = TemplatePage.new(RDoc::Page::ONE_PAGE)

      if @options.op_name
        opfile = File.open(@options.op_name, "w")
      else
        opfile = $stdout
      end
      template.write_html_on(opfile, values)
    end
544324
def parameters(self, parameters):
        """"""
        # pylint: disable=attribute-defined-outside-init
        self._parameters = NocaseDict()
        if parameters:
            try:
                # This is used for iterables:
                iterator = parameters.items()
            except AttributeError:
                # This is used for dictionaries:
                iterator = parameters
            for item in iterator:
                if isinstance(item, CIMParameter):
                    key = item.name
                    value = item
                elif isinstance(item, tuple):
                    key, value = item
                else:
                    raise TypeError(
                        _format("Input object for parameters has invalid item "
                                "in iterable: {0!A}", item))
                self.parameters[key] = value
1342387
def build_parameters(request, meta, orgaMode, currentOrga):
    """"""

    postParameters = {}
    getParameters = {}
    files = {}

    def update_parameters(data):
        tmp_getParameters, tmp_postParameters, tmp_files = data

        getParameters.update(tmp_getParameters)
        postParameters.update(tmp_postParameters)
        files.update(tmp_files)

    update_parameters(build_base_parameters(request))
    update_parameters(build_user_requested_parameters(request, meta))
    update_parameters(build_orga_parameters(request, orgaMode, currentOrga))

    return (getParameters, postParameters, files)
905991
private String generateReqParams() throws UnsupportedEncodingException {

        String params = "";
        if ((m_parameterMap != null) && !m_parameterMap.isEmpty()) {
            for (Entry<String, String[]> paramEntry : m_parameterMap.entrySet()) {
                if (paramEntry.getValue() != null) {
                    for (int i = 0; i < paramEntry.getValue().length; i++) {
                        params += "&"
                            + paramEntry.getKey()
                            + "="
                            + URLEncoder.encode(paramEntry.getValue()[i], "UTF-8");
                    }
                }
            }
            params = "?" + params.substring(1);
        }
        return params;
    }
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