开发者

Apache Axis 1.x xml payload

开发者 https://www.devze.com 2022-12-19 06:42 出处:网络
I\'m using apache axis to consume a few SOAP operations. The web service I\'m talking to takes XML as one of the payload in开发者_JAVA技巧puts. I noticed that Axis is encoding the non xml friendly cha

I'm using apache axis to consume a few SOAP operations. The web service I'm talking to takes XML as one of the payload in开发者_JAVA技巧puts. I noticed that Axis is encoding the non xml friendly characters. IE < > to &alt; etc.. etc..

How can I tell apache Axis to allow my payload to go over un-encoded?


I had exactly this problem and the only way that I was able to solve it was by overriding the XMLEncoder which ships with Apache Axis 1.4.

I used Jad to decompile the com.org.apache.axis.components.encoding.UTF8Encoder, copied the code into my own class and commented out the &, ", < and > case statements.

To configure Axis to use this new Encoder you also have to create a

META-INF/services/org.apache.axis.components.encoding.XMLEncoder

file containing just the FQDN of your new class.

0

精彩评论

暂无评论...
验证码 换一张
取 消