• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python xsd.qualify函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中suds.xsd.qualify函数的典型用法代码示例。如果您正苦于以下问题:Python qualify函数的具体用法?Python qualify怎么用?Python qualify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了qualify函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: resolve

    def resolve(self, definitions):
        """
        Resolve named references to other WSDL objects.

        @param definitions: A definitions object.
        @type definitions: L{Definitions}

        """
        for op in self.operations.values():
            if op.input is None:
                op.input = Message(Element("no-input"), definitions)
            else:
                qref = qualify(op.input, self.root, definitions.tns)
                msg = definitions.messages.get(qref)
                if msg is None:
                    raise Exception("msg '%s', not-found" % (op.input,))
                op.input = msg
            if op.output is None:
                op.output = Message(Element("no-output"), definitions)
            else:
                qref = qualify(op.output, self.root, definitions.tns)
                msg = definitions.messages.get(qref)
                if msg is None:
                    raise Exception("msg '%s', not-found" % (op.output,))
                op.output = msg
            for f in op.faults:
                qref = qualify(f.message, self.root, definitions.tns)
                msg = definitions.messages.get(qref)
                if msg is None:
                    raise Exception("msg '%s', not-found" % (f.message,))
                f.message = msg
开发者ID:ovnicraft,项目名称:suds,代码行数:31,代码来源:wsdl.py


示例2: query

 def query(self, name):
     """ blindly query the schema by name """
     log.debug('searching schema for (%s)', name)
     schema = self.schema
     wsdl = self.wsdl()
     if wsdl is None:
         qref = qualify(name, schema.root, schema.tns)
     else:
         qref = qualify(name, wsdl.root, wsdl.tns)
     query = BlindQuery(qref)
     result = query.execute(schema)
     return (result, [])
开发者ID:chatoooo,项目名称:suds-ng,代码行数:12,代码来源:resolver.py


示例3: resolveheaders

    def resolveheaders(self, definitions, op):
        """
        Resolve SOAP header I{message} references.

        @param definitions: A definitions object.
        @type definitions: L{Definitions}
        @param op: An I{operation} object.
        @type op: I{operation}

        """
        soap = op.soap
        headers = soap.input.headers + soap.output.headers
        for header in headers:
            mn = header.message
            ref = qualify(mn, self.root, definitions.tns)
            message = definitions.messages.get(ref)
            if message is None:
                raise Exception("message '%s', not-found" % (mn,))
            pn = header.part
            for p in message.parts:
                if p.name == pn:
                    header.part = p
                    break
            if pn == header.part:
                raise Exception("message '%s' has not part named '%s'" % (
                    ref, pn))
开发者ID:ovnicraft,项目名称:suds,代码行数:26,代码来源:wsdl.py


示例4: __getref

 def __getref(self, a, tns):
     """ Get the qualified value of attribute named 'a'."""
     s = self.root.get(a)
     if s is None:
         return s
     else:
         return qualify(s, self.root, tns)  
开发者ID:HenryKeiter,项目名称:suds3,代码行数:7,代码来源:wsdl.py


示例5: do_resolve

    def do_resolve(self, definitions):
        """
        Resolve named references to other WSDL objects. Ports without SOAP
        bindings are discarded.

        @param definitions: A definitions object.
        @type definitions: L{Definitions}

        """
        filtered = []
        for p in self.ports:
            ref = qualify(p.binding, self.root, definitions.tns)
            binding = definitions.bindings.get(ref)
            if binding is None:
                raise Exception("binding '%s', not-found" % (p.binding,))
            if binding.soap is None:
                log.debug("binding '%s' - not a SOAP binding, discarded",
                    binding.name)
                continue
            # After we have been resolved, our caller will expect that the
            # binding we are referencing has been fully constructed, i.e.
            # resolved, as well. The only scenario where the operations binding
            # might possibly not have already resolved its references, and
            # where this explicit resolve() call is required, is if we are
            # dealing with a recursive WSDL import chain.
            binding.resolve(definitions)
            p.binding = binding
            filtered.append(p)
        self.ports = filtered
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:29,代码来源:wsdl.py


示例6: known

 def known(self, node):
     """ resolve type referenced by @xsi:type """
     ref = node.get('type', Namespace.xsins)
     if ref is None:
         return None
     qref = qualify(ref, node, node.namespace())
     query = BlindQuery(qref)
     return query.execute(self.schema)
开发者ID:chatoooo,项目名称:suds-ng,代码行数:8,代码来源:resolver.py


示例7: resolveoppolicies

 def resolveoppolicies(self, definitions, msg):
     policies = []
     for policy_name in msg.policies:
         ref = qualify(policy_name, self.root, definitions.tns)
         policy = definitions.policies.get(ref)
         if policy is None:
             raise Exception("policy '%s', not-found" % policy_name)
         else:
             policies.append(policy)
     msg.policies = policies
开发者ID:evandeaubl,项目名称:suds,代码行数:10,代码来源:wsdl.py


示例8: resolveport

 def resolveport(self, definitions):
     """
     Resolve port_type reference.
     @param definitions: A definitions object.
     @type definitions: L{Definitions}
     """
     ref = qualify(self.type, self.root, definitions.tns)
     port_type = definitions.port_types.get(ref)
     if port_type is None:
         raise Exception("portType '%s', not-found" % self.type)
     else:
         self.type = port_type
开发者ID:HenryKeiter,项目名称:suds3,代码行数:12,代码来源:wsdl.py


示例9: qualify

 def qualify(self, name):
     """
     Qualify the name as either:
       - plain name
       - ns prefixed name (eg: ns0:Person)
       - fully ns qualified name (eg: {http://myns-uri}Person)
     @param name: The name of an object in the schema.
     @type name: str
     @return: A qualifed name.
     @rtype: qname
     """
     m = self.altp.match(name)
     if m is None:
         return qualify(name, self.wsdl.root, self.wsdl.tns)
     else:
         return (m.group(4), m.group(2))
开发者ID:chatoooo,项目名称:suds-ng,代码行数:16,代码来源:resolver.py


示例10: resolve

 def resolve(self, definitions):
     """
     Resolve named references to other WSDL objects.
     Ports without soap bindings are discarded.
     @param definitions: A definitions object.
     @type definitions: L{Definitions}
     """
     filtered = []
     for p in self.ports:
         ref = qualify(p.binding, self.root, definitions.tns)
         binding = definitions.bindings.get(ref)
         if binding is None:
             raise Exception("binding '%s', not-found" % p.binding)
         if binding.soap is None:
             log.debug('binding "%s" - not a soap, discarded', binding.name)
             continue
         p.binding = binding
         filtered.append(p)
     self.ports = filtered
开发者ID:HenryKeiter,项目名称:suds3,代码行数:19,代码来源:wsdl.py


示例11: qualify

 def qualify(self):
     """
     Convert attribute values, that are references to other
     objects, into I{qref}.  Qualfied using default document namespace.
     Since many wsdls are written improperly: when the document does
     not define a default namespace, the schema target namespace is used
     to qualify references.
     """
     defns = self.root.defaultNamespace()
     if Namespace.none(defns):
         defns = self.schema.tns
     for a in self.autoqualified():
         ref = getattr(self, a)
         if ref is None:
             continue
         if isqref(ref):
             continue
         qref = qualify(ref, self.root, defns)
         log.debug('%s, convert %s="%s" to %s', self.id, a, ref, qref)
         setattr(self, a, qref)
开发者ID:EquipmentShare,项目名称:suds-py3,代码行数:20,代码来源:sxbase.py


示例12: __resolveport

    def __resolveport(self, definitions):
        """
        Resolve port_type reference.

        @param definitions: A definitions object.
        @type definitions: L{Definitions}

        """
        ref = qualify(self.type, self.root, definitions.tns)
        port_type = definitions.port_types.get(ref)
        if port_type is None:
            raise Exception("portType '%s', not-found" % (self.type,))
        # Later on we will require access to the message data referenced by
        # this port_type instance, and in order for those data references to be
        # available, port_type first needs to dereference its message
        # identification string. The only scenario where the port_type might
        # possibly not have already resolved its references, and where this
        # explicit resolve() call is required, is if we are dealing with a
        # recursive WSDL import chain.
        port_type.resolve(definitions)
        self.type = port_type
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:21,代码来源:wsdl.py


示例13: find

 def find(self, name, resolved=True):
     """
     Get the definition object for the schema object by name.
     @param name: The name of a schema object.
     @type name: str
     @param resolved: A flag indicating that the fully resolved type
         should be returned.
     @type resolved: boolean
     @return: The found schema I{type}
     @rtype: L{xsd.sxbase.SchemaObject}
     """
     log.debug('searching schema for (%s)', name)
     qref = qualify(name, self.schema.root, self.schema.tns)
     query = BlindQuery(qref)
     result = query.execute(self.schema)
     if result is None:
         log.error('(%s) not-found', name)
         return None
     log.debug('found (%s) as (%s)', name, Repr(result))
     if resolved:
         result = result.resolve()
     return result
开发者ID:chatoooo,项目名称:suds-ng,代码行数:22,代码来源:resolver.py



注:本文中的suds.xsd.qualify函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python query.qualify函数代码示例发布时间:2022-05-27
下一篇:
Python http.HttpTransport类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap