C# - Disable Keep - Alive On Web Service Client Requests?

Mar 23, 2010

I have a few web servers behind an Amazon EC2 load balancer. I'm using TCP balancing on port 80 (rather than HTTP balancing). I have a client polling a Web Service (running on all web servers) for new items every few seconds. However, the client seems to stay connected to one server and polls that same server each time. I've tried using ServicePointManager to disable KeepAlive, but that didn't change anything. The outgoing connection still had its "connection: keep-alive" HTTP header, and the server kept the TCP connection open. I've also tried adding an override of GetWebRequest to the proxy class created by VS, which inherits from SoapHttpClientProtocol, but I still see the keep-alive header.

If I kill the client's process and restart, it'll connect to a new server via the load balancer, but it'll continue polling that new server forever. Is there a way to force it to connect to a random server each time? I want the load from the one client to be spread across all of the web servers. The client is written in C# (as is the server) and uses a Web Reference (not a Service Reference), which points to the load balancer.

View 1 Replies


Similar Messages:

How To Keep Session Alive Between Two Calls To A Web Service In A C# Application

Oct 5, 2010

This is quite straight forward. I'm calling a web-service (.asmx, with session enabled) from a c# application. I want each call to be with the same session key as the previous one (as opposed to creating a new session key each time).

Here's my (nothing-out-of-the-ordinary) code:

[Code].....

View 3 Replies

WCF / ASMX :: Keep Object Alive On Server In Service

Nov 19, 2010

I have to keep a datacontext alive in a WCF service. This object is created on every call to the service, by the way decreasing performance. How could I keep this object alive with WCF.

View 2 Replies

WCF / ASMX :: PowerShell In Web Service For Ajax Requests?

Dec 9, 2010

A customer wants us to create an ajax-enabled web application that can be used to manage their IT environment (Active directory, mail, file security, ...). However, as the team that will support the web application does not know anything about these IT systems, they would like to split the coding so that all interfacing with the IT environment is done via PowerShell, which is known by the administrators of these systems. This would mean that if new functionality is required, the web team can just create an additional web page and interface and use PowerShell scripts that get created by technically skilled people in that specific topic (ie mail administrators). I don't see an issue using this approach for requests like adding a user where latency is not an issue, but I do wonder if this is feasible for interactive content with Ajax.

Ie I would like to implement a google suggest like search for AD users. This would mean that ie for every x keystrokes (or x seconds whatever approach I implement) an Ajax request will be made and the web application or web service will than use PowerShell to get the data. Taken into account that up to about 75 users can use this feature, is this something that would work? Not only performace-wise but also the number of connections (I read about the Powershell 5 remote session limit but also that it could be put to a higher number)? The example above is probably the most resource heavy Ajax requests (and can be optimized by caching), so taken into account they don't want this nice feature, are basic PowerShell scripts in ajax request really an option. My gut feeling is telling me this is a no-go, but I don't want to exclude the option just because it's not something I usually would do.

View 1 Replies

WCF / ASMX :: Discarding Queued Web Service Requests?

Mar 16, 2011

If a user makes a second request to the same Web Service method while the first request is already running, is there a way to simply stop the execution of the first request and discard it immediately?

Usually what happens is users get impatient and click on a button 10 times when there's a performance blip in the system, which only makes things worse since the system now has to process 10 queued requests (the first 9 of which are now irrelevant) before any results are returned.

View 1 Replies

Trapping Client Disconnections On Long Running HTTP Requests?

Sep 9, 2010

I have a long poll HTTP request using ASP.NET 4, MVC 2 and AsyncController. If a user closes their browser and kills the HTTP connection without the request completing, I'd like to know about it and completely clean up after them. If I don't, the open and incomplete requests just sit there and eventually IIS stops accepting new requests.

You can simulate my long running HTTP request by making a normal ASP.NET application with a page that has a Thread.Sleep. Even if you close the browser, the request carries on as if it hasn't.

There is a property called Response.IsClientConnected that gets switched to false if the client disconnects, and I can poll this to achieve the desired effect but it's not very clean and I'd like to avoid polling. Is there a way of getting notified when this happens rather than having to poll this property?

View 1 Replies

WCF / ASMX :: Do Multiple WCF Web Service Requests Queue Up Or Do They Run In Parallel

Mar 17, 2011

I've got a WCF web service that runs fine at the moment but there is talk about using it very heavily soon. As part of it's normal process it writes a file out, then reads it back in again (don't ask why, I know it's stupid). I'm concerned that if we start hitting it with lots of requests then the following might happen.

1. Request 1 writes the file out.

2. Request 2 comes in and overwrites the file.

3. Request 1 reads the file back in but this is now the wrong file.

My understanding is that the requests would naturally queue up so that request 2 wouldn't start until request 1 had finished, but I'm not totally sure.

View 1 Replies

WCF / ASMX :: Code Within A WebService And WCF Client Work Only When Fildder Is Capturing Requests?

Mar 31, 2011

I have a piece of code written in 2 different ways, one a web service and another a WCF client which are trying to access an external 3rd party URL.

The same code when written as an exe works fine, i see my submissions on the 3rd party site, while the web code does not work.

I installed Fiddler to check traffic and to my surprise the web code works when Fiddler is capturing traffic, As soon as I stop Fiddler my code does not work.

For the web service code I get error: The remote name could not be resolved:

For the WCF client I get error: There was no endpoint listening at <<3rd party URL>> that could accept the message. This is often caused by an incorrect address or SOAP action.

Am quite sure now that this is because of some network and/or proxy on my corporate network, but not able to figure out what it can be.

View 1 Replies

Jquery - Why 3 Extra HTTP Requests Are Done If You Use Ajax Call To A .net Web Service

Apr 4, 2011

When I was reading the blog Using jQuery to Consume ASP.NET JSON Web Services

I have seen this argument:

"By using jQuery to call the web service directly, we've eliminated over 100 KB of JavaScript and three extra HTTP requests. "

Why does the ASP.NET AJAX call to a .NET Web-Service needs 3 extra HTTP requests? What are those requests? (I wonder how jQuery manages the call with lesser HTTP requests in this case).

View 2 Replies

MVC's AsyncController Be Used To Service Large Number Of Concurrent Hanging Requests (long Poll)??

Feb 13, 2011

Frameworks like Node.js, Tornado, and Twisted let developers create server-push applications that supports large number of concurrent hanging requests (10k+). From what I understand, they all achieve this by not creating threads to service each hanging request.

Can AsyncController be used to service large number of inactive concurrent requests?If so, are there any reasonably large ASP.NET MVC websites using this approach to create long-poll applications?

View 1 Replies

Can't Get WCF Service's Operations List With Web Service Studio Client

Jan 21, 2011

I've created a simple WCF service hosted by ASP.NET web site:

[Code]....

I can add references to this service as to WCF service, as to WebService.WcfTestClient application successfully recognized service and its methods.

But "Web Service Studio" [URL] can't get a list of operations... Why? How to diagnose/resolve that?

P.S. I work under VS 2008 using .NET 3.5

View 2 Replies

Selectively Redirecting HTTP Requests To HTTPS Requests?

Jun 18, 2010

What's the simplest and most effective way to selectively redirect HTTP requests to your ASP.NET page to its HTTPS equivalent? For example, if my page site URL is [URL], I want to redirect some (or all) page requests to [URL] What's the easiest way to do that?

View 2 Replies

Webservice And Two "parallel" Requests From Client

Nov 5, 2010

I have such a problem. Suppose we have a client (WinForms app), which invokes some methods from webservice. Every 5 minutes (Interval of Timer) I invoke asynchronously webmethod A. Suppose that time of its execution take a 1 minute. When this operation runs, I open some Window, and invokes webmethod B synchronously... or i try to do it. Application suspended, wait until webmethod A ends, then process webmethod B (or I have an exception - Connection was closed, or Timeout...). Is there any possibility to run this A, B webmethods 'parallel'?

View 1 Replies

Security :: Disable SSL On Client Browsers?

Aug 18, 2010

I set up my web site to use SSL encrption and I set the settings in IIS to ignore client certificate. But when i access the web site from a client browser, it still shows "403" error.

View 1 Replies

Disable All Client Side Validation In A Site?

Feb 10, 2011

I would like to disable all client side validation in an Asp.Net web site in order to test that server side validation is correct (i.e. I want to test against people altering the response or tampering with client script)Currently, I am either-Disabling JS in the browserManually disabling client validation for individual validators.

View 2 Replies

MVC :: Disable Client Validation While Clicking Certain Buttons In A Form?

Mar 3, 2011

i am having an mvc 2 application in which i have a form that contains two buttons

[Code]....

Now my requirement is to disable validation when the user clicks `Add` button. But validate when the user clicks `Save` Button.

View 5 Replies

How To Conditionally Disable Client Side Validation In XVal

May 18, 2010

I am using xVal in a ASP.NET MVC project. One of the forms has two buttons and i want to disable the client side validation when one of the buttons is clicked. Is there a way to conditionally disable client side validation in xVal?

View 2 Replies

Javascript - Disable Client Side Validation For Some Fields In MVC?

Mar 21, 2011

How can I conditionally disable client-side validation of some fields ?

Here is the example of what I need to do:

user writes name and address and submits. Both are validated both server and client side. If validation passes e-mail is send to given address and (name, address) pair is stored.as a response same page is displayed (I don't want redirect!) this time with confirmation. User can retype their name and submit. In such case e-mail will be resend to the address that corresponds to given name.

It does not work because: client side validation will not pass when user clicks resent button on the second (confirmation screen). It would say that e-mail is required even if there is no field for it. How can I disable javascript validating email before the confirm page gets send to user ?

Example ASP.NET MVC page

<%if (Model.Confirm == false){ %>
<% using (Html.BeginForm()) { %>
Your email: <%: Html.EditorFor(m => m.Email) %>
Your name: <%: Html.EditorFor(m => m.Name) %>
<input type="submit" value="Send Email" />

[Code]....

View 4 Replies

Disable TextBox On Client-side Click On CheckBox?

Apr 3, 2010

How to disable asp:TextBox on client-side click on HTML checkbox or server-side asp:CheckBox using JavaScript?

<script type="text/javascript" language="javascript">
function enableTextbox() {
// ?[code]....

View 3 Replies

How To Disable The Open Option When A File Is Downloaded To Client Machine

Jul 24, 2010

At the time of file download process, teh IE thorws a dialog box asking the user open / save or cancel. How to disable the open option, i want only save or cancel. This file is a zip file. i don't want a open option, is it possible?

View 1 Replies

JavaScript - How To Disable Client Script Block Server Side

Aug 13, 2010

I have js script block (very long one that does editing capabilities to an invoice page).

I want to enable/disable this functionality on the server-side. First thing popped up on my mind was to say runat="server" to the tag, and set visible=true/false to asp.net, thinking asp.net does not render the HTML for non-visible items, so the block wouldn't load at all, which was what I wanted. But I quickly realized that saying runat="server" to client-side code was a real bad idea :)

What ar emy options, besides loading script from client side. Cuz I have other buttons that come from the server-that will enable dieable too.

View 1 Replies

Enable/disable RequiredValidator On Client-side / CustomValidator Not Firing?

Apr 23, 2010

I've got a drop-down where the user selects a Country. It is a required "field".Next to it, there is a textfield named State. If the user selects US, then the field State is required. If the user selects e.g. Sweden, the State is not required, since Sweden has no states.Example code:

<asp:DropDownList runat="server" ID="Country"></asp:DropDownList>
<asp:RequiredFieldValidator ControlToValidate="Country"
runat="server" Display="Static" ErrorMessage="Required field" />

[code]...

View 1 Replies

C# - Disable / Enable An Ajaxifeid Button From Client Side (JavaScript)?

Jun 22, 2010

i have an AJAXIFIED button(btnsend) thas is disable by it's Property -> Enabled="False"

i have a TextBox Next To This Button And I Want Enable that Button When Users Type Something in That TextBox...

so i did this (JavaScript):

function onkeyupontextbox() {
var btnSend = document.getElementById("btnSend");
btnSend.disabled = false;
}

but that button does not work after becomes enable...

what can i do about that?

(i am using radajaxmanager for ajaxify that button) (when i remove that button from RadAjaxmanager Or UpdatePanel So EveryThing Is Ok , But I Want That Button In Ajaxify Mode)

View 2 Replies

AJAX :: Disable / Enable An Ajaxifeid Button From Client Side (JavaScript)?

Jun 22, 2010

disable / enable An Ajaxifeid Button From Client Side (JavaScript)?

View 3 Replies

Web Service Not Accessible From Client?

Aug 11, 2010

I have developed a WCF .NET web service. It has evolved from a console application, hence some shortcuts were taken in VS 2008 rather than establishing the project from scratch as a WCF Web Service.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved