472,328 Members | 1,199 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

POST data by HttpWebRequest - very strange sytuation

Hi,

I have very strange situation but first description ;)
I have:
1) project in VB.NET, in this f.e. 1 function:

Public Function Login(ByVal UserName As String, ByVal UserPassword As
String, Optional ByVal ConnectionParamList As String = Nothing) As
String

this function use HttpWebRequest to connect to asp site on the server:

httpRequest = HttpWebRequest.Create(url)
httpRequest.Method = "POST"
httpRequest.AllowWriteStreamBuffering = True
httpRequest.Timeout = 6000000
httpRequest.SendChunked = True
httpRequest.ContentLength = Content.Length
httpRequest.Credentials =
System.Net.CredentialCache.DefaultCredentials
....
input = httpRequest.GetRequestStream()

Try
If input.CanWrite Then
If Content.Length 0 Then
input.Write(Content, 0, Content.Length)
End If
input.Flush()
End If
Finally
input.Close()
End Try

'communication
httpResponse = httpRequest.GetResponse()
... (next StringBuilder and return result)

2) i have project in C#, where i call this Login(...)

result = myObject.Login("loginName", "password",
"some_parameters_as_URL_etc");

3) i have COM+ project in VB6 where i call Login function too (with the
same parameters like in project 2):

rv = myObject.Login(ExternalUserName, ExternalPassword,
ConnectionParams)

And now something strange:

when i call Login from project 2), the communication betwen server with
asp site look like this:

--- START ---

POST /ddd/odbc.asp HTTP/1.1
Content-Length: 133
Expect: 100-continue
Connection: Keep-Alive
Host: 192.168.1.48
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.1
Date: Sat, 26 Aug 2006 16:00:46 GMT
X-Powered-By: ASP.NET

<TRANSMISION><ACTION>Login</ACTION><PARAMS><LOGIN>John</LOGIN><PASSWORD>Smith</PASSWORD><DBNAME>Northwind</DBNAME></PARAMS></TRANSMISION>HTTP/1.1
200 OK

Server: Microsoft-IIS/5.1
Date: Sat, 26 Aug 2006 16:00:46 GMT
X-Powered-By: ASP.NET
Content-Length: 19
Content-Type: text/xml; Charset=utf-8
Set-Cookie: ASPSESSIONIDCACBDCBR=AABBPADAGMPPMBKBBCFMFOON; path=/
Cache-control: No-cache

<RESULT>OK</RESULT>

--- END ---

<TRANSMISIONand <RESULTis data whith i sending and receiving and
this is OK

but when i call Login from project described in 3), communication looks
like this:

--- START ---

POST /ddd/odbc.asp HTTP/1.1
Host: 192.168.1.48
Transfer-Encoding: chunked
Expect: 100-continue
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.1
Date: Sat, 26 Aug 2006 15:15:45 GMT
X-Powered-By: ASP.NET

85
<TRANSMISION><ACTION>Login</ACTION><PARAMS><LOGIN>John</LOGIN><PASSWORD>Smith</PASSWORD><DBNAME>Northwind</DBNAME></PARAMS></TRANSMISION>
0

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Sat, 26 Aug 2006 15:15:45 GMT
X-Powered-By: ASP.NET
Content-Length: 46
Content-Type: text/xml; Charset=utf-8
Set-Cookie: ASPSESSIONIDCACBDCBR=OPABPADAJOABBJAFDLFNJAHE; path=/
Cache-control: No-cache

<RESULT>ERROR: invalid XML in request</RESULT>

--- END ---

Question is:
WHAT IS THIS "85" before sendet XML and "0" after it !?

i search internet and found nothing :/

if someone know something or had similar situation, pleas help me ;)

Best regards,
Peter

Aug 26 '06 #1
2 4020
OK, i resolve this problem.
if i comment line:
httpRequest.SendChunked = True
everything works fine.

Why ? i dont know ;)

Regards,
Peter

Aug 28 '06 #2
Question is:
WHAT IS THIS "85" before sendet XML and "0" after it !?
You're using chunked-encoding.

Chunked is used when you want to send data between a client and a server
and the receiver wants to start consuming the data before it's all been
sent. Chunked allows the sender to send the data without knowing how
large it is, so the sender doesn't need to calculate the data's size
then set the Content-Length header.

The '85' before the data says: "The size of the next chunk is 85(hex)
bytes. The '0' indicates there is no more data being sent, i.e. this was
the last chunk.

See the HTTP RFC for more details (http://rfc.net/rfc2616.html)

Kevin Jones
Aug 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: TJO | last post by:
Can someone at MS please reply to this. I am trying to post data so a web form via ssl with the following code. I keep getting this error: "The...
3
by: ME | last post by:
Hi; I am getting "Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (401) Unauthorized." when I am trying...
4
by: supster | last post by:
Hello, I am trying to use HttpWebRequest to simulate sending some POST data from a form to a PHP script. I have accomplished this using: ...
5
by: Tammy | last post by:
Hi, I have an aspx app which needs to post data to a form and read the response. I am confused on whether I should be using the get_url using...
6
by: someone | last post by:
I am in a situation where I need to package some information from Page1, submit it via POST to another server which will process the information...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST"...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not...
6
by: cethie | last post by:
In the code below, DoGet is working very stable. But DoPost throws an uncatcheable InvalidOperationException randomly. I am lost. Any pointers will...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.