aspose 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply 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: 1123
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
Bartender

Joined: Oct 04, 2006
Posts: 2193
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: 1123
Right, Ivan is right, please look at Predefined entities in XML.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to decode xml special character coming from soap web service value
 
Similar Threads
XML Escape Newline Characters
Special Characters
Java for log in authentication? (looking for tutorial that applies to situation)
special character in xml
Struts2 variable inside javascript