cxf - Put modified xml back into the message? -


i'm using cxf send messages soap on jms.

i'm trying write cxf interceptor in post_marshall phase. want change attributes when xml generated.

i know can content message via

message.getcontent(java.io.writer.class). 

this happens in form of jmsconduit$1. - think - stringwriter (if debug code can see buf field).

i can xml in string format , make changes, problems putting in message.

i can not change jmsconduit$1 else, otherwise cxf won't send jms endpoint. (it must jmsconduit).

i can't find way put modified xml in jmsconduit, can through

message.getexchange().getconduit(); 

so, how can put modified xml message/jmsconduit?

finally found answer. used filterwriter.

public void handlemessage(message message) throws fault {     final writer writer = message.getcontent(writer.class);     message.setcontent(writer.class, new outwriter(message, writer)); }  class outwriter extends filterwriter {     @override     public void close() throws ioexception {         // modify string (in xml form).         message.setcontent(writer.class, out);     } } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -