Yes, you need to add additional code to parse the XML yourself.
This interceptor just allows you to capture the XML, it won't fix/change the
returned List value.

But now that you have the XML you can extract what you need to process it.


Mike SP wrote:
> 
> 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?  
> 
> 
> csaban wrote:
>> 
>> 
>> <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>
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-consume-SharePoint-Service-Response-%28Java-.NET-interop%29--tp25263932p28296456.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to