aspose file tools
The moose likes Web Services and the fly likes > is not replaced with > in axis2 response Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "> is not replaced with > in axis2 response" Watch "> is not replaced with > in axis2 response" New topic
Author

> is not replaced with > in axis2 response

Prakash Venk
Greenhorn

Joined: Apr 14, 2010
Posts: 2
I am using axis2 web service and i want to retun an XML as string in the response. In my response all the "<" are converted in to & lt; as expected by our client but ">" is not being converted to & gt;

Can anyone hlp me out with this. My client is expecting & gt; for >
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35220
    
    7
Axis does not change the payload on its own - your code needs to do that. Be sure to wrap this kind of data in a CDATA section.


Android appsImageJ pluginsJava web charts
Prakash Venk
Greenhorn

Joined: Apr 14, 2010
Posts: 2
If that is the case then even "<" should not be escaped, right?.

My question is why only few characters are escaped (<) and few are not (>)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35220
    
    7
Keep in mind that certain characters MUST be replaced by their logical entities, or placed in CDATA sections, in order to be transported over XML. See section 2.4 of the XML specification for more information, especially for how < and > differ from one another.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: > is not replaced with &gt; in axis2 response
 
Similar Threads
Creating a web service with Axis2 and wsdl2java / java2wsdl
sending out only mep response to client
< is replaced by &lt; in axis2 web service
Asynchronous Web services with Axis2
jax-ws client different between axis2 eclipse and wsimport.