473,491 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Receiving a web response asynchronously

With the code below, which I copied from the MSDN, I am getting only part of
the the web-page 'MyUrl' returned (this is a synchronoues access).
My hunch is that I have to use asynchronous access, which requires the use
of IAsynchResult - besides other things.
Does anyone have or can anybody point to code for this, please?!
TIA

Dim request As HttpWebRequest = CType(WebRequest.Create(MyUrl),
HttpWebRequest)
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections =12
request.MaximumResponseHeadersLength = 12
' Set credentials to use for this request.
request.Credentials = CredentialCache.DefaultCredentials
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse,True)

Nov 21 '05 #1
3 1250
August 7, 2005

I doubt that it would make a difference being Async vs Synch. My thought
is maybe the web request is timing out before the full request is filled and
the partial request is sent back. Or maybe there is something in the
HTML|Code returned that makes it think that it is done? Hope this helps and
have a great day!

--
Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23
Static IP


"PeterK" <p.*****@verizon.net> wrote in message
news:ON**************@TK2MSFTNGP14.phx.gbl...
With the code below, which I copied from the MSDN, I am getting only part
of
the the web-page 'MyUrl' returned (this is a synchronoues access).
My hunch is that I have to use asynchronous access, which requires the use
of IAsynchResult - besides other things.
Does anyone have or can anybody point to code for this, please?!
TIA

Dim request As HttpWebRequest = CType(WebRequest.Create(MyUrl),
HttpWebRequest)
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections =12
request.MaximumResponseHeadersLength = 12
' Set credentials to use for this request.
request.Credentials = CredentialCache.DefaultCredentials
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse,True)

Nov 21 '05 #2
Yes, that helped: The URL had a wrong parameter which made it get a shorter
response.
The question that remains, though, is:"If the web request (this client)
times out, how to lengthen the timeout interval?".
In which cases would an aysnchronous connection be needed?
Thank you.
"Joseph Bittman MCSD" <Ry*********@msn.com> wrote in message
news:O3**************@TK2MSFTNGP14.phx.gbl...
August 7, 2005

I doubt that it would make a difference being Async vs Synch. My thought is maybe the web request is timing out before the full request is filled and the partial request is sent back. Or maybe there is something in the
HTML|Code returned that makes it think that it is done? Hope this helps and have a great day!

--
Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23
Static IP


"PeterK" <p.*****@verizon.net> wrote in message
news:ON**************@TK2MSFTNGP14.phx.gbl...
With the code below, which I copied from the MSDN, I am getting only part of
the the web-page 'MyUrl' returned (this is a synchronoues access).
My hunch is that I have to use asynchronous access, which requires the use of IAsynchResult - besides other things.
Does anyone have or can anybody point to code for this, please?!
TIA

Dim request As HttpWebRequest = CType(WebRequest.Create(MyUrl),
HttpWebRequest)
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections =12
request.MaximumResponseHeadersLength = 12
' Set credentials to use for this request.
request.Credentials = CredentialCache.DefaultCredentials
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse,True)


Nov 21 '05 #3
> The question that remains, though, is:"If the web request (this client)
times out, how to lengthen the timeout interval?".


request.Timeout = 30000 ' 30 seconds

Nov 21 '05 #4

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

Similar topics

2
5703
by: Carter | last post by:
i have a treeview on a webform (.aspx). when the user selects an appropriate node on the tvw. and clicks on a link button, i'm downloading a corresponding file to the client (from the server). so far...
5
1810
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
0
1323
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
0
1408
by: et_ck | last post by:
Hi, We have a web services running to facilitate our clients in performing transactions. Below is the sample message flow: 1) App -> WS WS - perform transact WS - send response 2)
4
3587
by: PullWood | last post by:
Strange and curious problem I'm experiencing. I implemeted a web site asp solution IIS 5.0. The site performe long calculations. What's happening is the following: if I connect through a ADSL...
3
4340
by: Sirix42 | last post by:
Hi there, when I use Firefox to run my application (this involves sending an IFRAME request to the servlet and handling the response), there is no delay in displaying the data after each response....
1
2658
by: Subrato | last post by:
Hi, I am very new to xml and I have this piece of code which I took off a website. The situation is that on of the website, user files up a form and it is submitted. On submission, the page should...
0
3546
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
3
3517
by: Tarik Monem | last post by:
Hi Everyone, Still a newbie with FLEX, and I've passed arrays using AJAX to FLEX before, but I've never passed links to FLEX. Basically, this is the OUTPUT, which I wanted, but I'm given an...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.