-
Soap call from vb.net to java application
Hi,
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:
"response.setContentType("text/xml");
ServletOutputStream sos = response.getOutputStream();
sos.print(1);
sos.flush();
sos.close();"
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
Reader.Load(Connector.OutputStream)
...
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?
Thank you,
Lily
-
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>";
resp.setContentType("text/xml");
ServletOutputStream sos = resp.getOutputStream();
sos.print(s);
sos.flush();
sos.close();
Any ideas?
Thanks, Lily
-
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
"<SOAP-ENV:encodingStyle="SOAP-ENV">"
--------------------------^
What does that mean?
Thanks,
Lily
-
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."
Thanks,
Lily
-
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks