如何定制jaxb mtom marshaller

3ks5zfa0  于 2021-07-24  发布在  Java
关注(0)|答案(0)|浏览(208)

guying我正在尝试定制jaxb marshaller,使mtom enable为true。
下面是jaxb marshaller bean

@Bean
public Jaxb2Marshaller getLGMarshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setMtomEnabled(true);
    marshaller.setContextPath("pk.herman.wsdl");
    return marshaller;
}

上述marsheller的电流输出为

<ns2:Attachment>
    <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:1b295245-200b-4306-a245-5d3248c3b7c0%40herman.pk"/>

预期输出为

<ns2:Attachment>cid:1b295245-200b-4306-a245-5d3248c3b7c0%40herman.pk</ns2:Attachment>
</ns2:Attachment>

这就是我使用javax.activation.datahandler连接mtom的方式

new DataHandler(re.getLaglFileContent().getBytes(), MediaType.APPLICATION_OCTET_STREAM_VALUE));

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题