Java 当wsdl文件为generetion时,如何获取字节数组?

Java 当wsdl文件为generetion时,如何获取字节数组?,java,web-services,wsdl,Java,Web Services,Wsdl,wsdl的一部分: <complexType name="Example"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="base64bytes" type="xsd:byte"/> <element name="fileName" nill

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;
@xmlement(name=“base64bytes”,type=Byte.class)
基于64字节的受保护列表;
如何在生成后更改wsdl文件或ws,以获得字节数组而不是字节列表?

您应该尝试以下方法:

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

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

您应该尝试以下操作:

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


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

通过此处理,它的retutn@xmlement(name=“base64bytes”)受保护的列表base64bytes;我认为您不需要maxOccurs=“unbounded”属性,您应该删除它;我认为您不需要maxOccurs=“unbounded”属性,应该删除它。