.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

WCF Service hosted in IIS 6 failing on idle timeout and does not restart

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :WCF
I've got a WCF service hosted in IIS 6 with its own application pool.  The application pool is running under a domain service account.  It appears that the application pool's idle shutdown setting is killing WCF service and subsequent requests to the WCF service get an exception as listed below I can only access after I browse to the .svc page in order to get it working again.   I've went through the svc tracing and able to see where the ServiceHost closes down. I have tried various session management techniques with no result. I haven't read anything about having to disable the idle timeout in IIS 6 when hosting a WCF service, and I suspect that there shouldn't be any need to.   Can anyone provide any insight into why this is happening?   ******************* My client exception ******************* Test method **********  threw exception:  System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<html>     <head>         <title>Runtime Error</title>      

View Complete Post

More Related Resource Links

To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the s

The following error is issued following 10 minutes of system inactivity: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: The message could not be processed. This is most likely because the action 'http://tempuri.org/IParticipant/SearchParticipants' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding. Per the message, I tried changing the app config on the client from     receiveTimeout     ="00:10:00" to     receiveTimeout="10:00:00" but the change seems to have no impact.  What am I missing?

Cannot get service reference for Net.tcp service hosted in IIS7

HiI've got a service that I want to host in IIS7. The service runs over net.tcp (currently without security), but I am unable to create a service reference to it, or call it, using the net.tcp protocol. My event log is populated with lots of errors related to ASP.NET and System.ServiceModel, relevant services are installed and running (net.tcp port sharing service and net.tcp listener adapter).O/S : Window7 RTMDevStudio: 2008I publish the webservice to IIS7 and I get a valid page when navigating to the published .svc file (which tells me to use svtutil.exe and point it at the net.tcp endpoint).For that, I get this error :    The message could not be dispatched because the service at the endpoint address 'net.tcp://gedm-desktop.profiledc01.appdevelop.local/ManageAVMEP/ManageAVMAgent.svc/mex' is unavailable for the protocol of the address.Googling the problem leads me down several blind alleys :(I cannot determine what is causing the net.tcp listener to keep stopping? Everything is fine if I use the wsHttpBinding.Any tips or pointers to a course of action would be appreciated.ThanksGed My event log is full of errors (here is a sample) :-------An error occurred while trying to listen for the URL '/LM/W3SVC/1/ROOT/ManageAVMEP'. This worker process will be terminated. Sender Information: net.tcp Exception: System.ServiceModel.WasHos

Question about WCF Service hosted in Windows Service

Hi, I have little experience with WCF and working on a projet that requires WCF Service instance to run 24x7. After searching for a solution and reading about WCF, I think if I host it under Windows Service I can have a single instance of WCF Service running 24x7. Is this correct? I just successfully ran the MSDN sample project that hosts CalculatorService in Windows Service. I realized that Windows Service cannot communicate with WCF Service it is hosting (I do not have any experience with writing Windows Service). I wrote a test function (public) in Windows Service and tried to call it from WCF Service but it did not appear in the Intellisense list. Is my assumption correct or is there a way to establish communication between Windows Service and its hosted WCF Service? Thanks. kr

A connection has exceeded the idle timeout of this connection pool ????

Dear all,I have an the following message in my service lo :A connection has exceeded the idle timeout of this connection pool <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"> <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> <EventID>262147</EventID> <Type>3</Type> <SubType Name="Information">0</SubType> <Level>8</Level> <TimeCreated SystemTime="2009-06-12T10:11:24.7047020Z" /> <Source Name="System.ServiceModel" /> <Correlation ActivityID="{5e7a4c90-646a-41ae-8081-b6ebddbe3e9e}" /> <Execution ProcessName="Maillefer.Nomos.Plateform.Service.Console" ProcessID="5984" ThreadID="12" /> <Channel /> <Computer>VISTATEST</Computer> </System> <ApplicationData> <TraceData> <DataItem> <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information"> <TraceIdentifier>http://msdn.microsoft.com/fr-FR/library/System.ServiceModel.Channels.ConnectionPoolIdleTimeoutReached.aspx</TraceIdentifier> <Description>A connection has exceeded the idle timeout of this connection pool (00:02:00) and been closed.</Description> <AppDomain>Maillefe

Workflow Service failing on high load

Hi, I am load testing my workflow service to ensure that it can sustain high loads for a high volume transaction application. I am using Visual Studio's Load Test to run on a simple unit test to call the workflow service. I have configured the bindings on my service as follows:  <bindings>      <netTcpBinding>        <binding portSharingEnabled="true" closeTimeout="00:10:00"                 openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"                 maxBufferPoolSize="20480000" maxBufferSize="20480000" maxConnections="10"                  maxReceivedMessageSize="20480000"  >                    <security mode="None" />        </binding>      </netTcpBinding>  &n

Duplex communication and calling clients from outside the hosted service

Hey,   I am currently building an interface between two applications: One that hosts a WCF service and receives external input (e.g. from a sensory system) and another which subscribes to updates sent by the first.   It is quite easy to call back to the client if I create a ServiceHost and provide it with an instance of my service (using ServiceHost.SingletonInstance). However, if I use a PerSession instance mode, how is it possible to call the clients when I receive an updated from the external sensory system?   Thank you for your time!   Cheers, Till

I have dual core machine i have hosted wcf service . At a time how many requests my server will exec

I have dual core machine i have hosted wcf service . At a time how many requests my server will execute how to find that count.

How to measure WCF start up time ? ( WCF service .NET 3.5 hosted in IIS6 under win 2003 )

Hi ,   I have relative big and complex WCF (.net 3.5)service hosted in IIS 6 .  When IIS worker goes down , it takes a lot of time for service to wake up.  My question is how can I measure what exactly takes time ? Or its just service compilation time and nothing could be done here ? If I know what takes time I will try to optimize it .    Thanks. 

Not able to generate proxy for the service hosted on IIS, but working on Dev Web Server?

Hi, I have tried to host WCF on the IIS, it browsed sucessfully using the path http://localhost/WCF/Service1.svc but when tried to generate proxy using SvcUtil, it generated the following message. Bus the same when tried from the development server is working file. c:\Program Files\Microsoft Visual Studio 9.0\VC>svcutil.exe http://localhost/WCF /Service1.svc?wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved. Attempting to download metadata from 'http://localhost/WCF/Service1.svc?wsdl' us ing WS-Metadata Exchange or DISCO. Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation.  All rights reserved. Error: Cannot obtain Metadata from http://localhost/WCF/Service1.svc?wsdl If this is a Windows (R) Communication Foundation service to which you have acce ss, please check that you have enabled metadata publishing at the specified addr ess.  For help enabling metadata publishing, please refer to the MSDN documentat ion at http://go.microsoft.com/fwlink/?LinkId=65455. WS-Metadata Exchange Error     URI: http://localhost/WCF/Service1.svc?wsdl     Metadata contains a reference that cannot be resolved: 'http:

Send/open timeouts on WAS-hosted WCF service with named pipe orTCP binding, per-call instancing

We have a client that sends requests to a per-call WCF service (WAS hosted, NP binding, same machine) in a loop. The WCF service calls an external EXE to process requests. The operations on the service can take a few seconds, or a few hours. To combat this, we have sendTimeout=00:05:00, receiveTimeout=00:05:00 and a built-in circuit-breaker on the service that kills the external process after 00:05:00. Any service-side errors are returned to the client as FaultExceptions.  On the client, FaultExceptions are logged and the client proxy is aborted (proxy.Abort()). The client has configurable multithreading. In this example, it is running 3 threads, each of which creates a proxy, makes a call, and closes the proxy (or aborts it if an exception was received). Since the service is instanced as per-call, and it never receives more than 3 simultaneous calls (each of which being followed by a .Close() or .Abort() on the proxy), I would not expect the client to be getting timeouts during the send, but I am. In fact, the send timeouts I am receiving would seem to imply that the WCF service is hitting the default session limit, even though the class is explicitly marked with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]. I put some trace logging on the client and I can see that the timeout is occurring when the proxy is being created. sendTimeout seems to

WCF Web Service URL (Timeout)


Hello all,


I have a WCF web service project called ALC_Service. I have built a client application that needs to access this service. I assumed that I could change the URL of the service at runtime and it should just work but I keep getting a timeout when I call the method of the service (System.Net.WebException: "The operation has timed-out.").

Here is the code that I am using:

    private void button1_Click(object sender, EventArgs e)
      button1.Enabled = false;

      // Display the message from the service
      AlcServiceReference.AlcService service = new ALC_Client.AlcServiceReference.AlcService();
      service.Url = "http://fakepooPC/ALC_Service/AlcService.svc";      
      button1.Text = service.GetTimeString();

      button1.Enabled = true;


Basically, I create an instance of AlcService and set the URL to the machine that is running the service. Then, I try to call the method of the service (GetTimeString) and here is where it times out.


Any ideas?




SharePoint 2010 Timer Service keep failing


Hi everybody,


I am trying to set up SharePoint 2010 on small farm environment. 1 db server, 1 domain controller and 1 SharePoint server - where all services should run.

It was installed and working, until I tried to configure user profile synchronization service. I used least privileged account model, following in particular this article http://www.harbar.net/articles/sp2010ups.aspx

As you know, the configuration is quite complicated and require a lot of tuning on accounts rights.


I apparently mess something up very, very badly because since then SharePoint Timer Service keep failling every 2 or so minutes.

It all started at 6 am this morning when the service was recycled.


System Event viewer is flooded a loop of 4 events regarding the timer service:

  • Timer service entered the running state.
2.30 minutes latter:
  • Timer service entered the stopped state
  • Timer service terminated with service-specific error %%-2147467259
  • Timer service terminated unexpectedly.  It has done this 2 time(s).  The following corrective action will be taken in 30000 milliseconds: Restart the service
and starting again after 30 seconds


for you information, here are the exact events:

Log Name:   System

Webservice timeout while calling windows service



We have a .net product built in .Net 2.0.
It consist of three blocks.
First is a asp.net web application which calls webservice which in turn call a windows service to get results from database.
Our problem is that windows service is taking time to get results from database because of which timeout is occuring.

Now we have already set timeout property in web application while calling web service through proxy. However, we could not find how to set timeout property for webservice(This will stop webervice from timeout before windows service send back the result).

If somebody have done it, please help


Intermittent timeout calling ASMX web service yet Upload data transfer completes OK

I'm calling my webservice from a web page and getting a timeout despite setting very high values in my web.config files. This occurs intermittently when the file is usually pretty large but yet the file is still getting uploaded completely (as if the timeout DID NOT occur). Here is a function in my .aspx file which calls my ASMX proxy class:
private void UploadFile(HttpPostedFile postedFile, string fileNameOnly) 
    // create an instance of the proxy class to talk to our service; calling it client: 

Hw can i restart the central administration service?


Hi ,

Accidentally i stop central administration service (operations->services on server).

How can Central Administration Service be restarted? Cannot go to Central Admin, when the service is not running :-)

Please help me out




WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host


I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?



ServiceHost host =

Restarting Server: How to restart User Profile Sync Service?


Greetings all,


We had to restart our server, and once restarted, the User Profile Service (that we so laboriously fixed/reconfigured a month back) isn't starting. We get a retry on "User Profile Sync is provisioning, please wait..." before it terminates.

Can someone please recommend the best order in which to re-start the services so User Profile Sync restarts and continues to update?

Thanks SO MUCH,


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