aspose file tools*
The moose likes Web Services and the fly likes How to suppress Axis body content encoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to suppress Axis body content encoding" Watch "How to suppress Axis body content encoding" New topic
Author

How to suppress Axis body content encoding

Eric Ma
Greenhorn

Joined: Nov 21, 2001
Posts: 16
I have a stateless session bean method that returns well-formed XML. This method is then turned into a Web Services method using Axis. Using an Java Axis client, there is no problem processing the XML returned. However, with a VB6 client which uses MSXML DOM parser, it complains the XML is not well-formed. The reason is that Axis encoded the < and > characters in XML into < and >, and MS XML parser does not automatically decode these. I would like to know whether it is possible to turn off such encoding in Axis so that I don't incur overhead with conversion?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I assume you're "returning" the XML as a String, right? If that's the case, Axis will always encode your XML as text instead of XML. If you want to create a document-style web service which returns a custom XML structure, you need to use org.w3c.dom.Element as the method argument and return type in your web service class.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to suppress Axis body content encoding