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-plugin intellijIDEA 生成后:
@XmlElement(name = "base64bytes", type = Byte.class)
protected List<Byte> base64Bytes;
我应该如何更改我的 wsdl 文件或在生成后获得字节数组而不是字节列表?
最佳答案
你应该尝试这个:
而不是xsd:byte
。
类型 xsd:base64Binary
将二进制数据表示为二进制八位组序列,因此它将生成为字节数组。
此外,您应该删除maxOccurs="unbounded"
,因为该属性生成字节数组的List。
关于java - wsdl文件生成时如何获取字节数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42506846/