【问题标题】:SoapUI seems to be incorrectly saying these restrictions are invalid. What am I doing wrong?SoapUI 似乎错误地说这些限制是无效的。我究竟做错了什么?
【发布时间】:2013-12-04 16:14:11
【问题描述】:

我的 XML 架构中有以下内容:

<xsd:simpleType name="DECIMAL_TYPE">
    <xsd:restriction base="xsd:double">
        <xsd:minInclusive value="-100000"/>
        <xsd:maxInclusive value="100000"/>
    </xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="ANGLE_VALUE_TYPE">
    <xsd:restriction base="DECIMAL_TYPE">
        <xsd:minInclusive value="0"/>
        <xsd:maxInclusive value="360"/>
    </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="ANGLE_TYPE">
    <xsd:simpleContent>
         <xsd:extension base="ANGLE_VALUE_TYPE">
              <xsd:attribute name="UNITS" type="xsd:string" fixed="degrees"/>
         </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="SPECIAL_ANGLE_TYPE">
    <xsd:simpleContent>
         <xsd:restriction base="ANGLE_TYPE">
              <xsd:maxInclusive value="90" /> <!-- The source of the problem -->
         </xsd:restriction>
    </xsd:simpleContent>
</xsd:complexType>

此架构用于 WSDL,我将其用作新 SoapUI 项目的基础。但是,当我尝试导入项目时,SoapUI 会出现此错误:

  • 您尝试导入的 WSDL 有问题:
    • 来源:空
    • 错误:必须小于或等于之前的 maxInclusive

如果我将问题行中的“90”更改为“360”,则会出现相同的错误。

如果我删除带有注释的行(“问题的根源”),那么 SoapUI 会很好地导入 WSDL。该模式在 Eclipse 中成功验证,并且 WSDL2Java 在其上运行良好。

我的架构有什么问题(如果有的话),我需要做什么才能将其导入 SoapUI?谢谢!

【问题讨论】:

  • 您能否提供一个重现错误的示例 WSDL?

标签: wsdl xsd soapui


【解决方案1】:

我想知道您的问题是否与 ANGLE_TYPE 将 ANGLE_BASE_TYPE 命名为其基本类型这一事实有关,但您的架构片段没有声明这种类型。

当我将声明更改为 ANGLE_VALUE_TYPE 时,Saxon 和 Xerces 都告诉我架构文档是有效的,并且一旦添加了一些元素声明,它的行为似乎就符合预期。

【讨论】:

  • 感谢您的回复。不幸的是,事实并非如此。 ANGLE_BASE_TYPE 是我的问题中的一个错字。我已经编辑以反映实际的 XML。
猜你喜欢
  • 2014-06-15
  • 1970-01-01
  • 2013-08-06
  • 1970-01-01
  • 1970-01-01
  • 2015-06-30
  • 2016-07-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多