.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 Web Service URL (Timeout)

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :WCF

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?




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?

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

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>      

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: 

WCF service timeout when not closing the client properly



I have a WCF service hosted in IIS. I know you need to close the client after calling the service. But I use the service as a web service and I don't know if clients will close the service. When they don't close the client the service will get a timeout after 10 calls.

I set the following on the service:
[ServiceContract(SessionMode = SessionMode.NotAllowed)]

When I use performance monitor I see the number of instances stays 0. When I don't use SessionMode =
SessionMode.NotAllowed an instance is added for each call. I thought I solved it. bad luck: still I get a timeout after 10 calls.

Next I added this to the class implementing the service:

Managed windows service startup timeout


When a PC boots  we have the problem that the services, that our product relies on, often fails to start.

The services are written in managed C# code using .Net 4 framework. When the services fails to start the Main function is never executed i.e. the Service Control Manager kills the process while the process is initializing, but before the first line of our code is excuted.

Our guess is that it is the initialization of the .Net runtime that takes too long time as we can solve the problem by increasing the value of [HKEY_LOCAL_MACHINE \System \CurrentControlSet \Control] ServicesPipeTimeout.

Does anyone know if we can solve this without setting the ServicesPipeTimeout? Or do you think that it is OK to increase the ServicesPipeTimeout to 60 seconds or more, when installing our product?

 I am putting the question under CLR since there is not really a better forum? Do you have an idea for which forum to put it in?

Thanks ArildR



Service timeout

I've developed a service, which should run continuously until the system or  IIS shutdown  and also service should run without any request from client.

Async Web Service TimeOut


I have a windows client application that calls a asmx web service asynchronously. Most of the time this works fine.  But I have a user occasionally running into the issue where the completed event throws a System.Timeout exception. The server continues running and completes the operation.

The httpruntime execution timeout is 1800, which is definitely not getting hit.  It's almost like the callback is timing out.  I am trying to figure out where exactly to look.

I know the service proxy has a Timeout property, but I've read this is only for calling the service synchronously.  Please correct me if I'm wrong. 

Here is what the stack trace looks like.

Server stack trace: 
  at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
  at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
  at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
  at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, I

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Creating and Using an ASP.NET Web Service in Visual Web Developer

In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

AutoGenerateSelectButton="False" ignored when using Domain Service


Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no



 I keep getting the following error. I also added time out parameter in the connection stirng and it still did not help. Has any one faced similar issues.

Thanks in adavance.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]

SQL 2008 timeout


I am recently getting a timeout exception when executing this method. This table stores images and it might be due to the size of the table. I have no idea! Help!


 Public Sub StoreFile(ByVal fileId As Integer, ByVal upload As Stream, ByVal connection As SqlConnection)
            Dim bufferLen As Integer = 8040
            Dim br As BinaryReader = New BinaryReader(upload)
            Dim chunk As Byte()
            chunk = br.ReadBytes(bufferLen)

            Dim cmd As SqlCommand = _
            New SqlCommand("UPDATE tblContactDocuments SET ContractDocument=@Buffer WHERE AutoID=@FileId", _
            cmd.CommandTimeout = 30
            cmd.Parameters.AddWithValue("@FileId", fileId)
            cmd.Parameters.Add("@Buffer", SqlDbType.VarBinary, bufferLen).Value = chunk

            Dim cmdAppend = New SqlCommand("UPDATE tblContactDocuments SET CONTRACTDOCUMENT.WRITE(@Buffer, NULL, 0) WHERE AutoID=@FileId", _
            cmdAppend.Parameters.AddWithValue("@FileId", fileId)
            cmdAppend.Parameters.Add("@Buffer", SqlDbType.VarBinary, bufferLen)
            chunk = br.ReadBytes(bufferLen)

            While (c

ReadXML Timeout


I am reading an XML file from an external URL and putting it into a dataset that is the populates a repeater. This works fine when I run it locally, however on the published web site I receive A connection attempt failed because the connected party did not properly respond after a period of time error messages.

However, if i type the URL directly into a browser, I get the XML file almost immeadately which leads me to believe that I am going about this the wrong way or I need to some how to extend the timeout period.

Here is my code:

Protected Sub ButtonValidate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonValidate.Click
        If Page.IsValid = False Then
        End If

        TableCellVATSIMIDResults.Text = "<br />VATSIM ID Validation Results for <i>" & TextBoxVATSIMID.Text & "</i>"
        Dim DataSetVATSIMValidation As New DataSet
        DataSetVATSIMValidation.ReadXml("http://cert.vatsim.net/cert/vatsimnet/idstatus.php?cid=" & TextBoxVATSIMID.Text)


<asp:Repeater runat="server" ID="RepeaterVATSIMValidation">
                    <HeaderTemplate />
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