Just tested the same scenario on JRun and successfully get the data posted
from the dotnet application. What I am thinking in my mind is tomcat is
filtering the incoming requests and filtering the data which comes without
handle i.e without name value pair, so that it can put the name value pair
in RequestParameter collection/hash.

 

If this is true there must be a way through which the tomcat allows this
type of information which is posted on to the input stream, hope this might
help gurus to get to the exact solution.

 

Regards,

M. Owais

 

  _____  

From: Muhammad Owais Ansari [mailto:[EMAIL PROTECTED] 
Sent: Saturday, December 17, 2005 12:33 PM
To: 'users@tomcat.apache.org'
Subject: Form Data

 

Hi, All

 

I am unable to get the posted xml data from a dotnet application (sending
code attached) using the ServletInputStream (code attached).

While if I tried to get the same posted data/XML in cgi pearl (code
attached) and asp.net thought the inputstream it picks the data/XML as form
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";

}

----------------------------------------------------------------------------
------------------------------------

 

Does any one have a clue; I'll be very great full for any kind help.

 

 

Regards,

M. Owais Ansari

 

  • Form Data Muhammad Owais Ansari
    • RE: Form Data Muhammad Owais Ansari

Reply via email to