本文整理汇总了Python中simplexml.SimpleXMLElement.get_namespace_uri方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleXMLElement.get_namespace_uri方法的具体用法?Python SimpleXMLElement.get_namespace_uri怎么用?Python SimpleXMLElement.get_namespace_uri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simplexml.SimpleXMLElement
的用法示例。
在下文中一共展示了SimpleXMLElement.get_namespace_uri方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wsdl_parse
# 需要导入模块: from simplexml import SimpleXMLElement [as 别名]
# 或者: from simplexml.SimpleXMLElement import get_namespace_uri [as 别名]
#.........这里部分代码省略.........
if action:
d["action"] = action
# check axis2 namespace at schema types attributes
self.namespace = dict(wsdl.types("schema", ns=xsd_uri)[:]).get("targetNamespace", self.namespace)
imported_schemas = {}
# process current wsdl schema:
for schema in wsdl.types("schema", ns=xsd_uri):
preprocess_schema(
schema,
imported_schemas,
elements,
xsd_uri,
self.__soap_server,
self.http,
cache,
force_download,
self.wsdl_basedir,
)
postprocess_element(elements)
for message in wsdl.message:
log.debug("Processing message %s" % message["name"])
for part in message("part", error=False) or []:
element = {}
element_name = part["element"]
if not element_name:
# some implementations (axis) uses type instead
element_name = part["type"]
type_ns = get_namespace_prefix(element_name)
type_uri = wsdl.get_namespace_uri(type_ns)
if type_uri == xsd_uri:
element_name = get_local_name(element_name)
fn = REVERSE_TYPE_MAP.get(unicode(element_name), None)
element = {part["name"]: fn}
# emulate a true Element (complexType)
messages.setdefault((message["name"], None), {message["name"]: OrderedDict()}).values()[0].update(
element
)
else:
element_name = get_local_name(element_name)
fn = elements.get(make_key(element_name, "element"))
if not fn:
# some axis servers uses complexType for part messages
fn = elements.get(make_key(element_name, "complexType"))
element = {message["name"]: {part["name"]: fn}}
else:
element = {element_name: fn}
messages[(message["name"], part["name"])] = element
for port_type in wsdl.portType:
port_type_name = port_type["name"]
log.debug("Processing port type %s" % port_type_name)
for binding in port_type_bindings[port_type_name]:
for operation in port_type.operation:
op_name = operation["name"]
op = operations[str(binding["name"])][op_name]
op["documentation"] = unicode(operation("documentation", error=False) or "")
if binding["soap_ver"]:
# TODO: separe operation_binding from operation (non SOAP?)
if operation("input", error=False):
input_msg = get_local_name(operation.input["message"])