WLS 10.3: SOAP encoding not working as expected, special characters like '>' & '<' symbols are being replaced by "&lt;" and "&gt;" (Doc ID 1179867.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle Weblogic Server - Version: 10.3 and later   [Release: and later ]
Information in this document applies to any platform.

Goal

When setting xml content inside the string object you will notice that encoding is not happening properly:

For example:
Sample code of jws
===================
public class FxWebServiceImpl {

public String requestQuote(String fixMsg) {
String xml = "<xml><string>hi</String></xml>";
return xml;
}
when the above code returns the string object, we notice that the special characters like 'greater then' & 'less then' symbols are being replaced by "&lt;" and "&gt;" respectively instead of the characters themselves.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms