cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Re: WSS4JOutInterceptor and "Invalid white space character (0x1) in text to output"
Date Mon, 07 Dec 2009 13:19:14 GMT
cxf cannot marshall u+0001 in a string.  the best it could do is throw  
sooner. it is up to the app. it is a strange feature of jax-whatever  
that string values are constrained to XML 1.0 valid chars, but there  
you are. if you have to ship chars like this, you need to push them  
around as bytes.

On Dec 7, 2009, at 7:08 AM, Pavel <pagrus@gmail.com> wrote:

> But that's not me, it is CXF that produces XML representation of that
> character. I expect CXF to take care of marshalling specifics,  
> including
> proper escaping of special characters.
>
> Moreover, as I mentioned, CXF does that work well unless/until  
> security
> interceptor comes into play.
>
> So obviously there is an XML representation for the data I want to  
> send, and
> I'm back to may question - what is/whether there is a way to make  
> security
> interceptor handle 0x1 properly?
>
> Thanks,
> Pavel
>
> On Mon, Dec 7, 2009 at 1:18 PM, Benson Margulies <bimargulies@gmail.com 
> >wrote:
>
>> XML prohibits that character. you cannot sent it in an xsd:string.
>>
>>
>> On Dec 7, 2009, at 6:10 AM, Pavel <pagrus@gmail.com> wrote:
>>
>> Hello,
>>>
>>> I'm facing an issue with CXF + WSS4JOutInterceptor.
>>> Seems like it is unable to hadle strings that contain characters  
>>> with hex
>>> code <0x20; Client fails to send request with the following  
>>> stacktrace
>>>
>>> javax.xml.ws.soap.SOAPFaultException: Problem writing SAAJ model  
>>> to stream
>>>  at
>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
>>> 146)
>>>  *at $Proxy125.isStayQualified(Unknown Source)*  << that is my  
>>> client
>>>  ...
>>> Caused by: com.ctc.wstx.exc.WstxIOException: *Invalid white space
>>> character
>>> (0x1) in text to output*
>>>  at
>>>
>>> com.ctc.wstx.sw.BaseStreamWriter.writeCharacters 
>>> (BaseStreamWriter.java:511)
>>>  at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:434)
>>>  at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:412)
>>>  at
>>>
>>> org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor 
>>> $SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:197)
>>>  at
>>>
>>> org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor 
>>> $SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:158)
>>>  at
>>>
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept 
>>> (PhaseInterceptorChain.java:236)
>>>  at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:483)
>>>  at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309)
>>>  at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261)
>>>  at org.apache.cxf.frontend.ClientProxy.invokeSync 
>>> (ClientProxy.java:73)
>>>  at
>>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
>>> 124)
>>>  ... 30 more
>>> Caused by: java.io.IOException: Invalid white space character  
>>> (0x1) in
>>> text
>>> to output
>>>  at com.ctc.wstx.sw.XmlWriter.throwInvalidChar(XmlWriter.java:545)
>>>  at
>>>
>>> com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters 
>>> (BufferingXmlWriter.java:531)
>>>  at
>>>
>>> com.ctc.wstx.sw.BaseStreamWriter.writeCharacters 
>>> (BaseStreamWriter.java:509)
>>>  ... 40 more
>>>
>>>
>>> Requests work fine though if I don't use WSS4JOutInterceptor.  
>>> Problematic
>>> chars get escaped as &#XX.
>>>
>>> I tried that with both CXF 2.2.0-fuse and 2.2.5.
>>> Is there some sort of configuration required to avoid that issue?
>>>
>>>
>>> Thanks,
>>> Pavel
>>>
>>
>
>
> -- 
> Best regards,
> Pavel

Mime
View raw message