Hi, All

 

I am unable to get the posted xml data from a dotnet application using the
following code in my jsp/servlet.

While if I tried to get the same posted data in cgi pearl and asp.net
thought the stream it picks the data,

The application sending the xml data is not under my control hence can not
change the way its working.

 

DotNet Code for sending XML

 

       Dim txtURN As String

       Dim sentXML As String    

 

             txtURN = "http://tomcatserver:8080/dsl/ShowStreamInput.jsp";

 

            ' Comments : Creating XML dom

            sentXML = "<?xml version=""1.0""?><palindrome>Hello
Bilal</palindrome>"

            uidoc.document.txtSent = sentXML

            With objSendXMLDOM

                        .async = False

                        .loadXML sentXML

            End With

            

            ' Comments : Now Sending the XML

            With objXMLHTTP

                        .open "POST", txtURN, False

                        .send objSendXMLDOM

            End With

 

 

 

 

ShowStreamInput.jsp

 

<%@ page import="java.io.*"%>

 

<%

        InputStream in = request.getInputStream();

        StringBuffer input = new StringBuffer();

        while(true)

        {

                System.out.println("its running");

            int ch = in.read();

            if(ch==-1)

                break;

                System.out.println((char)ch);

            input.append(((char)ch));

        }

 

        System.out.println("inputStream: "+input.toString());

 

%><%=input.toString()%>

 

 

 

ASP.net code which is picking the data

 

        Try

            Dim fso As New System.IO.BinaryReader(Request.InputStream)

 

            fso.ReadString()

 

         Catch ex As Exception

 

        End Try

 

 

CGI Perl code which is picking the data

 

#!/opt/portal/6.2/bin/perl

 

require 'pin_webutils.pl';

 

print "Content-type: text/html\n\n";

 

&pin_process_form_data ();

 

print "<br><br>";

 

foreach $key (keys(%FORM))

        {

        $val = $FORM{"$key"};

        print "<br>*** $key = $val\n";

}

 

 

 

 

 

Regards,

M. Owais Ansari

Reply via email to