Soap call from vb.net to java application
I'm trying to create a vb.net soap call to java application on Websphere server. So far, I was able to send request to the java application and process it. I'm having problem with mapping the response back to the client.
I am tracing my application on the server and I can see the HttpServletRequest comming in. I am able to process it and do my logic. Now I want to assign the response to HttpServletResponse. I do so in the following way:
ServletOutputStream sos = response.getOutputStream();
However the client apparently can't read the output stream for some reason. Here is what I have on my client:
"Reader = New MSSOAPLib.SoapReader
response = Reader.RPCResult.text"
The "response" is being assigned to an empty string. And I get an error "Object reference not set to an instance of an object."
Does anybody know why this is happening and a possible solution to it?
Setting the response to text/xml only says your are planning to return xml. Not that you are. You are returning "1" which:
1. Is not valid XML
2. Is not in a SOAP envelope.
Check out Axis on http://xml.apache.org/
Well, this is what I do now and still get the same error:
String s = "<?xml version="1.0" encoding="UTF-8"standalone="no"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:encodingStyle="SOAP-ENV"><SOAP-ENV:Body> <enFilterUndeliverableEmail><result>Lily</result></enFilterUndeliverableEmail></SOAP-ENV:Body><SOAP-ENV:Envelope>";
ServletOutputStream sos = resp.getOutputStream();
If the java side requires no input then point your browser at the url and see what you get.
I get this:
"A name contained an invalid character. Error processing resource 'http://localhost:9080/3m00MailWEB_emailparser/CollectEmailDetails?recipient=a&sender=a&comment=a&subject=a&header=a&body=a'. Line 1, Position 156"
which is pointing to
What does that mean?
Oh and I forgot to mention that it also said at the top:
"The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later."
Oh my God!
I fixed it! Thanks to you!
I changed encodingStyle to="http://schemas.xmlsoap.org/soap/encoding/">
and now it works.
Thanks SOOOO MUCH!!!
good troubleshooting. Glad you got it fixed. Too bad the MS side has such poor errors. Par for the course though. I share your pain. I had the same sort of problem a few months ago.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center