验证 SOAP 消息 [英] Validating SOAP messages

查看:51
本文介绍了验证 SOAP 消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将任何 SOAP 消息验证为有效的 XML.例如,我从 Wikipedia 中取出了下面的 SOAP 消息,但它没有通过 Validome 验证器.是验证器错误还是 SOAP 文件中存在错误?如果验证器错了,你能建议另一个吗?它应该考虑模式.例如,W3C 表示 这个 xml 是格式良好的,但正如 Validome 正确指出的那样,它实际上是非常无效的.

I can't get any SOAP messages to validate as valid XML. For example, I took the SOAP message below off of Wikipedia and it failed the Validome validator. Is the validator wrong or is there a mistake in the SOAP file? If the validator is wrong can you suggest another? It should take schemas into account. For example, W3C says that this xml is well-formed, but it actually is horribly invalid as Validome correctly points out.

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
  <soapenv:Header>
    <wsa:ReplyTo>
      <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:From>
      <wsa:Address>http://localhost:8080/axis2/services/MyService</wsa:Address>
    </wsa:From>
    <wsa:MessageID>ECE5B3F187F29D28BC11433905662036</wsa:MessageID>
  </soapenv:Header>
  <soapenv:Body>
    <req:echo xmlns:req="http://localhost:8080/axis2/services/MyService/">
      <req:category>classifieds</req:category>
    </req:echo>
  </soapenv:Body>
</soapenv:Envelope>

推荐答案

您发布的 XML 可能完全有效 - 如果您指定了用于验证它的架构的位置.

The XML you posted might be perfectly valid - if you had specified the location of the schemas with which to validate it.

XML 术语中的有效"表示根据一组 XML 模式有效".在没有任何模式的情况下,有效性的概念毫无意义.

"Valid" in XML terms means "valid according to a set of XML Schemas". In the absence of any schemas, the concept of validity makes no sense.

这篇关于验证 SOAP 消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆