解决Invalid white space character (0x …… 文件下载后可直接使用

在进行soa webservice开发时,您可能会遇到类似以下的错误信息: 
com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:509) 
Invalid white space character (0x1) in text to output 
Invalid white space character (0x2) in text to output 
…… 
Invalid white space character (0x7) in text to output 
Invalid white space character (0x8) in text to output 
…… 
Invalid white space character (0x14) in text to output 
…… 

这是因为soa webservice信息的传递是基于xml文件格式,而xml文件格式无法直接处理空白字符,如果遇到这些特殊的空白字符,则会出错。比如&在xml文件中得用&amp表示,>得用&lt表示,<得用&gt表示,不能直接在xml中写成&,>,<,当然用<!CDATA[]]>例外。 

现在修改了wstx包中的源码,凡遇到类似的特殊空白字符时就用' '替换,不会再出现以上错误。 
 

本文转载自:http://win-you-you.iteye.com/blog/623711

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值