I wrote a simple web service that takes a string as an argument and returns String output.
The service looks 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; } }
On the client side, I get:
<?xml version='1.0' encoding='UTF-8'?><Element><InnerElement>ElementValue</InnerElement></<Element>
This input is used in a third-party parser that tries to find <or> and my application breaks.
Anyone facing this problem? What could be the problem and work? Suggestions are welcome.
source share