File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes how to decode xml special character coming from soap web service value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "how to decode xml special character coming from soap web service value" Watch "how to decode xml special character coming from soap web service value" New topic
Author

how to decode xml special character coming from soap web service value

vijayakumar durai
Ranch Hand

Joined: Aug 18, 2008
Posts: 153
can any body tell how to decode the xml special character like <>" coming from web service value ? I want to parse the value so i have to replace



Thanks
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
XML strongly suggests using UTF-8. The Basic Profile Version 1.0 says -


The Profile consistently requires either UTF-8 or UTF-16 encoding for both SOAP and WSDL (see also R1012).

R4003 A DESCRIPTION MUST use either UTF-8 or UTF-16 encoding.


What's the special character we are talking about?

Regards,
Dan

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Either wrap the element value that contains the "<" and/or ">" characters in a CDATA section. Reference: http://www.w3schools.com/XML/xml_cdata.asp
...or use the characters "& lt;" (without the space after the ampersand) instead of "<" and "& gt;" (again without the space after the ampersand) instead of ">".
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Right, Ivan is right, please look at Predefined entities in XML.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to decode xml special character coming from soap web service value
 
Similar Threads
Java for log in authentication? (looking for tutorial that applies to situation)
special character in xml
XML Escape Newline Characters
Special Characters
Struts2 variable inside javascript