Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

java - How to Customzie JAXB MTOM Marshaller

Guying I'm trying to customize the JAXB Marshaller having mtom enable true.

below is jAXB Marshaller Bean

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

Current output of above marsheller is

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

Expected output is

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

This is how im attaching the mtom using javax.activation.DataHandler

new DataHandler(re.getLaglFileContent().getBytes(), MediaType.APPLICATION_OCTET_STREAM_VALUE));
question from:https://stackoverflow.com/questions/65871043/how-to-customzie-jaxb-mtom-marshaller

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...