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:
> 
> Oh yes, forgot to mention, another way would be with JAXB is to add an
> interceptor and process the stream before the StaxInInterceptor does.
> 
> eg:
> 
> <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>
> 
> 
> csaban wrote:
>> 
>> Probably this is late now, but I was facing the same issue. (Sharepoint,
>> NTLMv2, List[null])
>> 
>> Using JAXB GetList always returned null, but switching to XMLBEANS I do
>> get the xml content of the getList response.
>> 
>> Hope this helps someone.
>> 
>> --
>> Csaba
>> 
>> 
>> mmule wrote:
>>> 
>>> Hello,
>>> 
>>> Do you have a solution for this yet? I am facing a similar issue. The
>>> CXF is returning null.
>>> 
>>> Please share if you have the solution.
>>> 
>>> Thanks
>>> M
>>> 
>> 
>> 
> 
> 

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

Reply via email to