• Post Reply Bookmark Topic Watch Topic
  • New Topic

internal method call.getEnvelopeString() fails. unable to identify cause of failure  RSS feed

 
satish bhatia
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds to me like the problem is on the microsoft side -- it may be returning an HTML error page rather than the response you expect.
Why don't you turn on the TCP/IP monitor and look at both the request and response and see what you have flowing over the wire? (Look in the infocenter in WSAD to find out how to turn it on -- you'll have to edit your generated proxy client to use port 8081 too -- for more information on doing this see the "Web Services Wizardry" redbook at http://www.redbooks.ibm.com).
Kyle
[ November 07, 2002: Message edited by: Kyle Brown ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!