Problem to return XML structured WebMethod response
Hello All.
I have Java WebProject with WebService interface. (build by NetBeans, running under TomCat 6.0)
There is method with String Output type defined in Java Wrapper.
@WebMethod(operationName = "MyMethod")
public String MyMethod(@WebParam(name = "STARTLAT")
double STARTLAT, @WebParam(name = "STARTLON")
double STARTLON, @WebParam(name = "ENDLAT")
double ENDLAT, @WebParam(name = "ENDLON")
double ENDLON) {
try
{
MyBaseClass ts = new MyBaseClass();
String path= ts.GetPath(STARTLAT, STARTLON, ENDLAT, ENDLON);
return(path);
}
catch (Exception e) {
return ("<Error>"+ e.getMessage()+"</Error>");
}
}
Method is always returns XML formatted string, but on client side I receives it changed a little bit.:(
Instead sent "<roadlength>0</roadlength>" string it looks like
<ns2:MyMethodResponse xmlns:ns2="http://TrackIt.com/">
<return><roadlength>0.0</roadlength></return>
</ns2:MyMethod<Response>
Sometimes response is embedded within <![CDATA[
<return><![CDATA[<roadlength>9.6</roadlength><Segments>...</Segments>]]></return>
What I need to specify within Java Web Service Wrapper or WSDL in order to get "fresh" XML between <return></return>, without < and <![CDATA[