2017-02-28 38 views
1

WSDL的部分:当wsdl文件生成时如何获取字节数组?

<complexType name="Example"> 
        <sequence> 
         <element maxOccurs="unbounded" minOccurs="0" name="base64bytes" type="xsd:byte"/> 
         <element name="fileName" nillable="true" type="xsd:string"/> 
        </sequence> 
       </complexType> 

后一代与JAXWS-Maven的插件intellijIDEA:

@XmlElement(name = "base64bytes", type = Byte.class) 
    protected List<Byte> base64Bytes; 

我应该如何改变我的WSDL文件或WS,我得到的字节数组,而不是字节的名单后,世代?

回答

0

你应该试试这个:

xsd:base64Binary

,而不是xsd:byte。 类型xsd:base64Binary将二进制数据表示为二进制八位字节序列,因此它将作为字节数组生成。

此外,您应该删除maxOccurs="unbounded",因为此属性会生成一个字节数组列表。

+0

使用本次交易对其进行修改 @XmlElement(name =“base64bytes”) protected List base64Bytes; – Porty

+0

我认为你不需要maxOccurs =“unbounded”属性,你应该删除它。 – user6904265

+0

感谢你的工作!) – Porty