My Oracle Support Banner

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 OCTOBER 09, 2020

Applies to:

Oracle WebLogic Server - Version 10.3 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:

NOTE: The WebLogic Server names and port numbers; WebService application/schema/package names; other attributes used in this article represent a fictitious sample names that made up as example. Any similarity to actual code, is purely coincidental and not intended in any other manner.

 

For example:
Sample code of jws
===================
public class FxWebServiceImpl {
WebMethod()
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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.