.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sending multiple HTTP requests asynchronously using .NET

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :ASP.Net


  Is it possible to send multiple HTTP requests asynchronously to an ASP.NET web site or any other web server using .NET ? And, then. collect responses from those requests as they come using .NET asynchronous paradigm ? Is it possible ? Or would there still be limit of max 2 HTTP connections from .NET using HTTP ?

Thanks in advance and regards



View Complete Post

More Related Resource Links

multiple web service requests to an SSL secured service (HTTP CONNECT)


I'm working on an app which makes multiple SSL requests to a web service. The service has the certificate, there are no client certificates in use. If I look at the messages in Fiddler, it looks like there is an HTTP CONNECT for every request, which gets the servers public key and then makes the actual SSL request. 

Do I need to do something in the client proxy code to cache the servers certificate to avoid the HTTP CONNECT call every time?

Thanks, casey

ASP.NET: Intercept, Monitor, and Modify Web Requests with HTTP Filters in ISAPI and ASP.NET


There can be many reasons to reroute incoming Web requests. For instance, sometimes it's necessary to redirect a browser to a page based on user criteria without passing long lists of parameters in the URL. In the past, the only way to intercept such page requests and send them elsewhere was with ISAPI. Now, in ASP.NET, the IHttpModule interface provides notification of server requests, and lets you easily reroute them based on criteria other than browser type or version. Here the author demonstrates the use of IHttpModule for interception and explains the use of ISAPI filters for anyone who isn't yet using ASP.NET.

Panos Kougiouris

MSDN Magazine August 2002

WCF Basic Http Binding - Two server requests per method call

We have a service that uses BasicHttpBinding/Transport Security/Windows Authentication and is hosted in IIS. I have created a unit-test application in VSTS and whenever we test a WCF method, Fiddler records two calls. 1st call - No authorization token is sent. The WCF service returns a 401 error - Unauthorized: Access is denied. Http headers as sent in the request given below. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Host: localhost Content-Length: 243 Expect: 100-continue Connection: Keep-Alive 2nd call - Authorization token is sent and the WCF service returns the expected response. POST http://localhost/AccountScreen.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "IAccountScreen/RetrieveAccountDetails" Authorization: Negotiate Host: localhost Content-Length: 243 Expect: 100-continue I am not able to figure out why there are two calls made to the server in the first place and what is the significance of the first call. Any thoughts?

WCF webservice: HTTP/1.1 400 Bad Request while sending large input

I am connecting to a WCF based webservice. For certain methods, the input contains a list of objects/structures. When the number of items in this list increases beyond a certain number, the service fails with HTTP/1.1 400 Bad Request when I try to test the same using SOAPUI. I tried changing the web.config file with the following changes: <httpRuntime maxRequestLength="2097151" /> <binding name="basicHTTP" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" maxReceivedMessageSize="4194304" maxBufferSize="98547" maxBufferPoolSize="258547"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding>   Kangkan

Sending a Mail Message to Multiple Addresses Using System.Net.Mail

 VWD 2008 Express.  Visual Basic. I use the following routine (XXXXX have replaced sensitive data) to try to send an email message to mutiple email addresses.  It only sends to the first email address in the comma-delimited list.  How can I send the message to multiple email addresses?  Thanks for the help. Protected Sub SendButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendButton.Click 'Send the message to all users who have emails. Dim smtpClient As SmtpClient = New SmtpClient() Dim message As MailMessage = New MailMessage() Dim Success As Boolean, I As Integer, strTO As String = "" Try 'Gather all user email addresses Dim strSQL = "SELECT EMail from aspnet_membership where Email<>''" Dim MyDataset As DataSet = GetDataSet(strSQL, Success) I = 0 For Each dr As DataRow In MyDataset.Tables(0).Rows If I = MyDataset.Tables(0).Rows.Count - 1 Then strTO = strTO + dr("Email") Else strTO = strTO + dr("Email") + "," End If I = I + 1 Next Dim toAddress As New MailAddress(strTO, "To All Users") 'Ga

error sending SOAP data to http://localhost/myWCFService/MyWCFService.svc


I am a beginner with WCF services, trying to learn. I created a WCF service where MyWCFServiceInterface has service and data contracts. MyWCFService class implements this interface and has two methods that connect to sqlServer DB to run Sprocs to fetch data. I am hosting this WCFService using IIS6.0. I created a webclient to test the service, which works fine. When I call the service using soap request I get the following error: Could not POST file MyWCFService/MyWCFService.svc on server localhost(415). error sending SOAP data to http://localhost/MyWCFService/MyWCFService.svc


Please check the following wsdl and the soap request and suggest corrections. I greatly appreciate your help. Thanks.



<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12=&q

ewa refresh succeeds, but fails with multiple concurrent requests


we have about 30 excel web access web parts spread across 6 pages.  they all connect to ssas using windows authentication, and they all work fine.

we have a user that wants to set his browser to open the 6 pages on 6 tabs as his "home" tab arrangement.  so when he launches his browser, all 6 pages open simultaneously.  all of the ewa web parts give the error:

"An error has occurred trying to perform the requested action. Please try again."

when i check the logs, i don't see any exceptions.  i just see the messages below. i have set the "maximum concurrent queries per session" for the trusted file location to 1000.  i've tried changing various other settings in the excel services config.  i have no idea what else to try based on this information:



10/03/2010 19:19:30.98 	w3wp.exe (0x0AB0)            	0x1160	Excel Services Application  	Excel Calculation Services  	6v6o	Assert 	(0): location: (0) condition:  StackTrace: at Microsoft.Office.Server.Native.dll: (sig=35b73ac2-5d4b-41d9-b101-286fc6f53dd5|2|microsoft.office.server.native.pdb, offset=203FD) at Microsoft.Office.Server.Native.dll: (offset=20959) at xlsrv.dll: (sig=ae42e7c5-84bd-429e-bec2-0fdd9dad3ee7|2|xlsrv.pdb, offset=4C58E8) at xlsrv.dll: (offset=33

sending SMS over HTTP/HTTPS in vb.net


i want to send sms by using http/https,can nay one tell me hoe can i do this ?

Send Email with HTTP file attachment - Workflow is sending garbage in attachment



I'm having an issue with a customized workflow when I send an email with an attachment. I am using the "send email with http file attachment" that I have downloaded from CodePlex. Unfortunately all attachments that come through are full of garbage. This includes .jpg, .pdf, and .txt. From what I can tell with the .txt file is that its contents has been replaced with what appears to be the html of the list page. Both the .jpg and .pdf fail to open complaining about corrupt documents. All documents can be opened fine from within sharepoint. 

Can anyone of you guide me in this regard, as rest of my  workflow logic is working fine but this attachment issue is ruining the end result.


ScriptManager does not execute all script blocks registered when making multiple asynchronous HTTP r


I have found a bug in the ScriptManager.  I am executing Javascript in multiple Update Panels.  I have EnablePartialRendering mode set to true and and the UpdatePanels have update mode set to conditional.

Each UpdatePanel is in a ascx control, and these controls are added to he page programtically using Page.LoadControl().

When the client performs some UI actions in the browser, I am calling __doPostBack().  Each .ascx control will register client script block to be executed in it's UpdatePanel using ScriptManager.RegisterClientScriptBlock(), and each .ascx control uses a unique key when registering the script block.

Everything works as advertised when there is only one _doPostBack() being called at a time, (one HTTP Request).  The problem only occurs when __doPostBack is called before the previous __doPostBack causes the JavaScript registered in the ScriptManager is executed.  When there are multiple, simultaneous, asyncrhonous HTTP Requests to the same page with the same session, only the most recent JavaScript is executed that was registered with ScriptManager.RegisterClientScriptBlock().

I have tested this with both .NET 2.0 and .NET 3.5.  I can produce a VS 2008 solution that demonstrates this problem.  The only way for me to resolve this issue is to prevent multiple calls to __doPostBac

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

ASP.NET Architecture - ASP.NET Worker Process - HTTP Pipleline - Http Modules and Handlers

"ASP.NET is a powerful platform for building Web applications, that provides a tremendous amount of flexibility and power for building just about any kind of Web application. Most people are familiar only with the high level frameworks like WebForms and WebServices which sit at the very top level of the ASP.NET hierarchy. In this article I'll describe the lower level aspects of ASP.NET and explain how requests move from Web Server to the ASP.NET runtime and then through the ASP.NET Http Pipeline to process requests.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend