关于jax-ws 使用wsdl文件数组对象定义:maxOccurs=”unbounded”

本文介绍了在JAX-WS Web服务开发中,如何按照特定要求使用WSDL文件定义数组对象,特别是当maxOccurs属性设置为'unbounded'时的实现方法。参照链接中的第二种方案,成功解决了项目需求。

关于jax-ws 使用wsdl文件数组对象定义:maxOccurs=”unbounded”

在项目实际开发webservice服务端时,被强制要求以指定格式声明集合对象,如:

<s:element maxOccurs="unbounded" minOccurs="0" name="SIZE_DATA" type="tns:SIZE_DATA"/>
          <s:element maxOccurs="unbounded" minOccurs="0" name="PRODUCTAREADATAS" type="tns:PRODUCTAREADATAS"/>
          <s:element maxOccurs="unbounded" minOccurs="0" name="REMARK_DATA" type="tns:REMARK_DATA"/>
          <s:complexType name="SIZE_DATA">
        <s:sequence>
          <s:element maxOccurs="1" minOccurs="0" name="SIZE" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="EANUPC" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="ARTICLE_ID" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="WEIGHT" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="LENGTH" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="WIDTH" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="HEIGHT" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="INCASEMENT" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="VOLUME" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKA1" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKA2" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKA3" type="s:string"/>
        </s:sequence>
      </s:complexType>
      <s:complexType name="PRODUCTAREADATAS">
        <s:sequence>
          <s:element maxOccurs="1" minOccurs="0" name="PRODUCTAREACODE" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="PRODUCTAREADES" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="INITIALONMARKET" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="NEWONMARKET" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="ORDERSTART" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="ORDEREND" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKC1" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKC2" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKC3" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKC4" type="s:string"/>
        </s:sequence>
      </s:complexType>
      <s:complexType name="REMARK_DATA">
        <s:sequence>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKB1" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKB2" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKB3" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKB4" type="s:string"/>
          <s:element maxOccurs="1" minOccurs="0" name="REMARKB5" type="s:string"/>
        </s:sequence>

http://blog.youkuaiyun.com/jiandanfeng2/article/details/53439748

根据所提供链接中第二种方法,实现了这种格式。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值