Soap call from vb.net to java application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Soap call from vb.net to java application

  1. #1
    Join Date
    Aug 2004
    Posts
    9

    Smile 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

  2. #2
    Join Date
    Jun 2004
    Posts
    199
    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/

  3. #3
    Join Date
    Aug 2004
    Posts
    9
    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

  4. #4
    Join Date
    Jun 2004
    Posts
    199
    If the java side requires no input then point your browser at the url and see what you get.

  5. #5
    Join Date
    Aug 2004
    Posts
    9
    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

  6. #6
    Join Date
    Aug 2004
    Posts
    9
    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

  7. #7
    Join Date
    Aug 2004
    Posts
    9
    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!!!

  8. #8
    Join Date
    Jun 2004
    Posts
    199
    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center