【问题标题】:wsimport pass no value to an enumerated parameterwsimport 不向枚举参数传递任何值
【发布时间】:2020-07-29 10:38:46
【问题描述】:

我有一个带有枚举类型输入参数之一的 SOAP URL,如下所示。使用 SOAPUI,我只能删除 ? 标记并能够成功执行请求。 <urn:Comm_Source></urn:Comm_Source>

我使用wsimport 创建了客户端代码,并将输入法参数创建为CommSourceType 对象。如果我为此值传递 null,则 Web 服务将失败。

<xsd:element maxOccurs="1" minOccurs="0" name="Comm_Source" nillable="false" type="s0:Comm_SourceType"/>

【问题讨论】:

    标签: soap wsimport


    【解决方案1】:

    缺少完整答案的信息(例如,整个 wsdl/xsd 或什么意思:如果我为此值传递 null,则 Web 服务将失败。)。

    一般:

    1. null空字符串不同。
    2. &lt;urn:Comm_Source&gt;&lt;/urn:Comm_Source&gt; - 是一个空字符串
    3. &lt;urn:Comm_Source xsi:nil="true" /&gt; - 是 null 值 (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
    4. 指定元素&lt;xsd:element maxOccurs="1" minOccurs="0" name="Comm_Source" nillable="false" type="s0:Comm_SourceType" /&gt;不支持null,因为有nillable="false"
    5. 可以省略该元素,也可以在其中写入一个空字符串

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-24
      • 2012-10-15
      • 1970-01-01
      • 2012-07-31
      • 2012-04-18
      • 1970-01-01
      • 2011-01-04
      • 2010-09-26
      相关资源
      最近更新 更多