You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Pulyaev INTEGO <SP...@intego-group.com> on 2009/08/19 10:31:39 UTC

Re: Exception while marshalling

Now i have got the same situation again - after switching to version 2.2.3.
Now StaxOutInterceptor.getXMLOutputFactory always returns NULL - so i 
have no way to specify this flag anymore.

How can i setup XMLStreamWriter to

AUTOMATIC_EMPTY_ELEMENTS = OFF ?



Sergey Pulyaev wrote:
> I have found the solution:
> in one of interceptors before the WrappedOutInterceptor
> i set "auto empty elements" property of xml writer to false
>         XMLOutputFactory outputFactory =
> StaxOutInterceptor.getXMLOutputFactory(message);
>        
> if(WstxOutputFactory.class.isAssignableFrom(outputFactory.getClass())){
>             WstxOutputFactory of = (WstxOutputFactory)outputFactory;
>            
> of.getConfig().setProperty(XMLOutputFactory2.P_AUTOMATIC_EMPTY_ELEMENTS,
> false);
>         }
>
>
> Sergey Pulyaev wrote:
>   
>> Ok, i have switched to 2.0.9.
>> But now - when i use code in line 76 - i mean CachingXmlEventWriter - i
>> get invalid response text:
>> previously i get response from function with result List<Long>  like that:
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>> <soap:Body>
>> <ns1:getUserRolesResponse
>> xmlns:ns1="http://ws.pc2.takecharge.com/"></ns1:getUserRolesResponse></soap:Body>
>> </soap:Envelope>
>>
>>     
>
>   


--------
This data is for general information only and shall not be used to produce documents of any kind without same being submitted to, reviewed by, and approved by Intego in writing. All data is subject to change. User assumes all liability relating to the use of this data and agrees to release, indemnify, and hold harmless Intego from any and all claims relating said use. User is responsible to check for any viruses before use.