Hi,
I am developing a
jsp webservice client which calls a microsoft web service.
I am using IBM WSAD for development & debug purpose and consequently using
the provided packages (which i believe are based on apache) for development.
I keep getting a SOAPException stating that the response type is "text/html"
but the expected response type should be "text/xml". This exception is
thrown on calling the call.invoke() method. the failure occurs at an
internal method call.getEnvelopeString()
I used the internal debugger to get a stacktrace upto the exact point of
failure and this is what i found
Thread [Servlet.Engine.Transports : 0] (Suspended (exception
org.apache.soap.SOAPException))
org.apache.soap.rpc.Call.getEnvelopeString(org.apache.soap.transport.SOAPTra
nsport) line: not available [local variables unavailable]
org.apache.soap.rpc.Call.invoke(java.net.URL, java.lang.String) line: not
available proxy.soap.HecaOnlineProxy.CalculateResults(org.w3c.dom.Element,
org.w3c.dom.Element) line: 77 /TestWebService/sample/HecaOnline/Result.jsp
line:181
org.apache.jsp._Result(com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase).serv
ice(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 84
...............................
................
..........
....
( the small code dealing with the
soap part )
String targetObjectURI = "http://tempuri.org/message/";
String SOAPActionURI =
"http://tempuri.org/action/ProcessRes.CalculateResults";
call.setMethodName("CalculateResults");
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
call.setTargetObjectURI(targetObjectURI);
Vector params = new Vector();
Parameter listinputParam = new Parameter("listinput",
org.w3c.dom.Element.class, listinput, Constants.NS_URI_LITERAL_XML);
params.addElement(listinputParam);
Parameter listoutputParam = new Parameter("listoutput",
org.w3c.dom.Element.class, listoutput, Constants.NS_URI_LITERAL_XML);
params.addElement(listoutputParam);
call.setParams(params);
QName qname = new QName("", "listoutput");
StringDeserializer sd = new StringDeserializer();
SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
smr.mapTypes(org.apache.soap.Constants.NS_URI_LITERAL_XML, qname, null,
null, sd);
call.setSOAPMappingRegistry(smr);
System.out.println(call.toString());
Response resp = null;
try {
resp = call.invoke(getURL(), SOAPActionURI);
} catch (MalformedURLException e) {
System.out.println("MalformedURLexception = "+e);
} catch (SOAPException e) {
System.out.println("SOAPException = "+e);
} catch (Exception e) {
System.out.println("Exception = "+e);
}
return("nothing");
I have no clue as to why should the soap envelope be causing this error
specially since there is no direct manipulation of the envelope in the code.
I have run out of ideas as to what could be going wrong and what should i
look at.
Any help would be appreciated.
regards,
satish.