By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,994 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,994 IT Pros & Developers. It's quick & easy.

Request received well, returning it results in loss of data!

P: n/a
I'm doing a simple test, about 100 lines of data of ~200 bytes each.
I'm using WebRequest() and HttpWebResponse() calling a generic handler.

What i pass to the webserver (tried local as not local) i return directly
using Response.Write() per line.
The server receives the data 100% ok.

Both client as server use application/x-www-form-urlencoded.
The data is sent as POST and is ASCII encoded.
item1=data.... etc..

In the handler a loop for each item is used and sent with Response.Write().
Each item is seprated using &
Using 2 local VWD projects results in having up to item #52 being correct.
The rest is gone.
The non-local webserver return only 8 items!!

The oddity is that Response.flush results in no items.
Is this a timing issue?
Dec 30 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello Edwin,
I'm doing a simple test, about 100 lines of data of ~200 bytes each.
I'm using WebRequest() and HttpWebResponse() calling a generic
handler.

What i pass to the webserver (tried local as not local) i return
directly
using Response.Write() per line.
The server receives the data 100% ok.
Both client as server use application/x-www-form-urlencoded. The data
is sent as POST and is ASCII encoded. item1=data.... etc..

In the handler a loop for each item is used and sent with
Response.Write().
Each item is seprated using &
Using 2 local VWD projects results in having up to item #52 being
correct.
The rest is gone.
The non-local webserver return only 8 items!!
The oddity is that Response.flush results in no items. Is this a
timing issue?


Can you post your code?

--
Joerg Jooss
ne********@joergjooss.de
Jan 1 '06 #2

P: n/a
That would be difficult at this time.
However, these are two apps using urlencoding (item=data...) etc
I use a generic handler and return the same date immediately.

If you insist on code.. i have to make something i can release then.

:)
"Joerg Jooss" <ne********@joergjooss.de> schreef in bericht
news:94*************************@msnews.microsoft. com...
Hello Edwin,
I'm doing a simple test, about 100 lines of data of ~200 bytes each.
I'm using WebRequest() and HttpWebResponse() calling a generic
handler.

What i pass to the webserver (tried local as not local) i return
directly
using Response.Write() per line.
The server receives the data 100% ok.
Both client as server use application/x-www-form-urlencoded. The data
is sent as POST and is ASCII encoded. item1=data.... etc..

In the handler a loop for each item is used and sent with
Response.Write().
Each item is seprated using &
Using 2 local VWD projects results in having up to item #52 being
correct.
The rest is gone.
The non-local webserver return only 8 items!!
The oddity is that Response.flush results in no items. Is this a
timing issue?


Can you post your code?

--
Joerg Jooss
ne********@joergjooss.de

Jan 1 '06 #3

P: n/a
Hello Edwin,
That would be difficult at this time.
However, these are two apps using urlencoding (item=data...) etc
I use a generic handler and return the same date immediately.
If you insist on code.. i have to make something i can release then.


Well, "insisting" is a pretty strong term, but I'd rather not blindly guess
;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jan 2 '06 #4

P: n/a

Back again, i could manage a smaller fragment which obtains the response
data.
It should be enough to understand the problem imo.

We *respond* with "application/x-www-form-urlencoded"
In the ashx file i respond with: (the StrDup is not used, i tried sending a
byte array later on)

T = Microsoft.VisualBasic.Strings.StrDup(60000, "A")
.Response.Write("item1=len(T): " &
T.Length.ToString)
'.Response.Write("&item2=" & T)

Dim b(99999) As Byte
For nItem As Int32 = 0 To b.Length - 1
b(nItem) = 65
Next
.Response.Write("&item2=")
.Response.BinaryWrite(b)
ContentLength is: 100026
Dim nLen As Int32 = oHTTPResponse.ContentLength
If nLen > 0 Then

ReDim data(nLen - 1)
oStream = oHTTPResponse.GetResponseStream()
oStream.Read(data, 0, nLen)
oStream.Close()
oStream.Dispose()
oStream = Nothing

Dim a As Int32
Dim nItem As Int32

For nItem = 0 To data.Length - 1
If data(nItem) = 0 Then
Stop
Exit For
End If

Next
The for/next loop stops at: 8760

As you see it's no a decoding issue, i guess the data is chunked internally
and due some reason char 0 is inserted or so.

"Joerg Jooss" <ne********@joergjooss.de> schreef in bericht
news:94*************************@msnews.microsoft. com...
Hello Edwin,
That would be difficult at this time.
However, these are two apps using urlencoding (item=data...) etc
I use a generic handler and return the same date immediately.
If you insist on code.. i have to make something i can release then.


Well, "insisting" is a pretty strong term, but I'd rather not blindly
guess ;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de

Jan 6 '06 #5

P: n/a
Hmm, i just rewrote it to:

http://66.249.93.104/search?q=cache:...ASP..NET&hl=nl

And it seems to work as intended :)
Testing...
"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...

Back again, i could manage a smaller fragment which obtains the response
data.
It should be enough to understand the problem imo.

We *respond* with "application/x-www-form-urlencoded"
In the ashx file i respond with: (the StrDup is not used, i tried sending
a byte array later on)

T = Microsoft.VisualBasic.Strings.StrDup(60000,
"A")
.Response.Write("item1=len(T): " &
T.Length.ToString)
'.Response.Write("&item2=" & T)

Dim b(99999) As Byte
For nItem As Int32 = 0 To b.Length - 1
b(nItem) = 65
Next
.Response.Write("&item2=")
.Response.BinaryWrite(b)
ContentLength is: 100026
Dim nLen As Int32 = oHTTPResponse.ContentLength
If nLen > 0 Then

ReDim data(nLen - 1)
oStream = oHTTPResponse.GetResponseStream()
oStream.Read(data, 0, nLen)
oStream.Close()
oStream.Dispose()
oStream = Nothing

Dim a As Int32
Dim nItem As Int32

For nItem = 0 To data.Length - 1
If data(nItem) = 0 Then
Stop
Exit For
End If

Next
The for/next loop stops at: 8760

As you see it's no a decoding issue, i guess the data is chunked
internally and due some reason char 0 is inserted or so.

"Joerg Jooss" <ne********@joergjooss.de> schreef in bericht
news:94*************************@msnews.microsoft. com...
Hello Edwin,
That would be difficult at this time.
However, these are two apps using urlencoding (item=data...) etc
I use a generic handler and return the same date immediately.
If you insist on code.. i have to make something i can release then.


Well, "insisting" is a pretty strong term, but I'd rather not blindly
guess ;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de


Jan 6 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.