I tried this interceptor below.  I added some printlns and saw that the
originalXML string was being set correctly.  However, that string is not
used anywhere so I'm not sure if this is missing some code or not.  The
end result is that even though I can see that the correct data is
available in the handleMessage, using that code below, it doesn't work
still.  I still get the null List object back.  Is there additional code
beyond this that is needed to make it work?  

 

<quote author="csaban">

 

<code>

                static class MyInterceptor extends
AbstractPhaseInterceptor<Message> {

                                

                                public MyInterceptor() {

 
super(Phase.POST_STREAM);

                                                

 
getBefore().add(StaxInInterceptor.class.getName());

                                }

                                

                                public void handleMessage(Message msg)
throws org.apache.cxf.interceptor.Fault {

                                                InputStream is =
msg.getContent(InputStream.class);

                                                 assert is != null;

 


                                                try {

                                                                byte[]
byteContent = IOUtils.readBytesFromStream(is);

 
msg.setContent(InputStream.class, new
ByteArrayInputStream(byteContent));

                                                                String
encoding = (String) msg.get(Message.ENCODING);

                                                                String
originalXML = new String(byteContent,encoding);

                                                } catch(Exception e) {

                                                                //FIXME:
handle exception

 
e.printStackTrace();

                                                }

                                                

                                }

                }

</code>

 

</quote>


---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and 
is intended to be received only by persons entitled to receive such 
information. If you have received this e-mail in error, please notify the 
sender immediately. Please delete it and all attachments from any servers, hard 
drives or any other media. Other use of this e-mail by you is strictly 
prohibited.


All e-mails and attachments sent and received are subject to monitoring, 
reading and archival by Monsanto, including its subsidiaries. The recipient of 
this e-mail is solely responsible for checking for the presence of "Viruses" or 
other "Malware". Monsanto, along with its subsidiaries, accepts no liability 
for any damage caused by any such code transmitted by or accompanying this 
e-mail or any attachment.
---------------------------------------------------------------------------------------------------------

Reply via email to