On Tuesday, June 14, 2011 9:48:13 AM Per Andersson wrote:
> Hi!
> Sorry, I somehow missed your answer. I tried it now, and it works just like
> I want. Thanks! :)
> 
> Two related questions:
> * The interceptor should live immediately after StaxoutIntereptor, but it
> seems that the factory.getOutInterceptors() list is empty, so I just added
> my interceptor to that list. Is that correct? 

Yep.  That's fine.

> * My interceptor extends
> org.apache.cxf.phase.AbstractPhaseInterceptor<Message>, which means that I
> must provide a phase when the interceptor should be executed. I'm using
> Phase.WRITE which seems to work. But is it the right one?

That would likely just "format" the data parts and not things like the soap 
headers and the soap envelope and such.   You could move it up to PRE_PROTOCOL 
phase to get more of it formatted if needed.  


Dan




> 
> //Per
> 
> -----Ursprungligt meddelande-----
> Från: Daniel Kulp [mailto:[email protected]]
> Skickat: den 13 juni 2011 22:59
> Till: [email protected]
> Kopia: Per Andersson
> Ämne: Re: SV: "Pretty print" request messages?
> 
> On Monday, June 13, 2011 8:37:51 AM Per Andersson wrote:
> > Hi again!
> > No one that know if this is possible at all?
> 
> Just the response I sent last week:
> 
> http://cxf.547215.n5.nabble.com/quot-Pretty-print-quot-request-messages-td44
> 69066.html
> 
> Dan
> 
> > //Per
> > 
> > -----Ursprungligt meddelande-----
> > Från: Per Andersson [mailto:[email protected]]
> > Skickat: den 8 juni 2011 12:10
> > Till: [email protected]
> > Ämne: "Pretty print" request messages?
> > 
> > Hi!
> > This is kind of a strange question I guess, but anyway: Are there any
> > possibilities to force cxf to "pretty print"/indent the request message
> > it sends away?
> > 
> > Scenario: We have a server application that simply creates text files
> > containing the requests it get's through a web service. When we send
> > requests to this server using CXF on the client side (code example
> > below)
> > the creates text file has all content on one single line. If we use
> > Soap-UI to send the same request, the created file contains line breaks
> > and white spaces (which makes it "human readable"). We want the same
> > behavior when we use CXF, is is possible?
> > 
> > CXF code on the client:
> >             JaxWsProxyFactoryBean factory = new
> >             JaxWsProxyFactoryBean();
> >             Map<String, Object> properties = new
> >             HashMap<String, Object>(); if (useMtom)
> >             {
> >             
> >                 properties.put("mtom-enabled",
> >                 Boolean.TRUE);
> >             
> >             }
> >             factory.setProperties(properties);
> >             factory.setServiceClass(MyCustomPortType.class);
> >             factory.setAddress(url);
> >             service = (MyCustomPortType) factory.create();
> >             service.sendMessage(myMessage);
> > 
> > The resulting file when sending the request with soap-UI:
> > <dummy>
> > 
> >   <dummy2>
> >   
> >     <dummy3>value</dummy3>
> >   
> >   </dummy2>
> > 
> > </dummy>
> > 
> > The resulting file when sending the same request with soup-UI:
> > <dummy><dummy2><dummy3>value</dummy3></dummy2></dummy>
> > 
> > //Per
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to