【问题标题】:xsd attribute minOccurs="0" is not working for type="xsd:dateTime"xsd 属性 minOccurs="0" 不适用于 type="xsd:dateTime"
【发布时间】:2015-01-24 04:56:56
【问题描述】:

在我的 wsdl 中,我希望日期字段对于我提供的 wsdl 中的日期字段是可选的

<xsd:element maxOccurs="1" minOccurs="0" name="Date" type="xsd:dateTime" nillable="true" >
        </xsd:element>

但它不起作用。它在此字段中期望值。如何使 dateTime 字段可选?谁能帮忙

【问题讨论】:

  • minOccurs="0" 将允许整个 Date 元素不存在。这是您想要的,还是您希望Date 在出现时能够为空?

标签: datetime xsd wsdl


【解决方案1】:

尝试删除 nillable 属性,保留 minOccurs。

【讨论】:

  • 我现在尝试删除 nillable 我看到该字段是可选的,但我在该行中遇到解组错误 似乎在该字段中期望一些值
  • 请添加异常的堆栈跟踪以进一步帮助您。您是否正在生成任何 Jaxb 对象?是你的要求 xsd 吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-22
  • 2012-04-05
  • 1970-01-01
  • 2012-02-12
相关资源
最近更新 更多