首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解析WSDL文件以提取特定节点的内容

如何解析WSDL文件以提取特定节点的内容
EN

Stack Overflow用户
提问于 2013-02-27 01:18:16
回答 1查看 5.8K关注 0票数 2

下面是我的wsdl文件的一部分:

代码语言:javascript
复制
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
- <s:element name="BinaryConversion">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="Binary" type="s:string" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:element name="BinaryConversionResponse">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="BinaryConversionResult" type="s:string" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:element name="Qos">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="1" maxOccurs="1" name="Availabilty_10" type="s:int" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:element name="QosResponse">
  <s:complexType /> 
  </s:element>
- <s:element name="GetQosParameters">
  <s:complexType /> 
  </s:element>
- <s:element name="GetQosParametersResponse">
- <s:complexType>
- <s:sequence>
  <s:element minOccurs="1" maxOccurs="1" name="GetQosParametersResult" type="tns:QoSParameters" /> 
  </s:sequence>
  </s:complexType>
  </s:element>
- <s:complexType name="QoSParameters">
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="1" name="Availability" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Accuracy" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Accessibility" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Latency" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Reliability" type="s:string" /> 
  </s:sequence>
  </s:complexType>
  </s:schema>
  </wsdl:types>

现在我想提取名字的可用性,准确性,延迟etc.How,我做这件事。我使用Document进行解析,但我只能提取wsdl:操作,而不能提取wsdl:type。

EN

回答 1

Stack Overflow用户

发布于 2013-02-27 01:25:05

这里有一个很好的Java/XML教程(许多教程之一):

  • http://www.vogella.com/articles/JavaXML/article.html

向下滚动到他谈论XPath的部分。这是获取子节点所需的语法(例如,( "QoSParameters")及其中的一切(例如。“可用性”、“准确性”等)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15102526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档