I have written a simple web service which takes string as an argument and returns a String as output.
The service is something like this :
@WebService(name = "MyWebService", serviceName = "MyWebService", portName = "WS")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public class MyWebService {
@WebMethod(action = "inputString")
@WebResult(name = "resultString")
public String serviceMethod(
@WebParam(mode = WebParam.Mode.IN, name = "inputString") String inputString) {
resultString ="<?xml version='1.0' encoding='UTF-8'?><Element><InnerElement>ElementValue</InnerElement></<Element>"
System.out.println(resultString);
return resultString;
}
}
At the client Side I am getting:
<?xml version='1.0' encoding='UTF-8'?><Element><InnerElement>ElementValue</InnerElement></<Element>
This input is used in the third party parser which tries to find < or > and my application breaks.
Has any one come across this issue? What might be the issue and work around? Suggestions are highly welcome.