WCF in Silverlight - How to Set the Default Timeout Change to 1 Minute

I have a WCF service that I am connecting to in a Silverlight project. The task that the service should complete takes more than a minute (this is normal), but I get an error message. I communicate with him through a proxy (created by dev studio when adding a link to the service)

The HTTP request to 'http://localhost/ImporterService.svc' has exceeded the allotted timeout. The time allotted to this operation may have been a portion of a longer timeout.

(where ImporterService is my service)

I read all kinds of messages over the past 3 days about raising the next one.

receiveTimeout="00:10:00"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"

Nothing worked, it still expires in 1 minute!

Ok, so in the generated ServiceReferences.ClientConfig file, I added the values ​​to the following location

<configuration>
  <system.serviceModel>
  <bindings>
   <basicHttpBinding>
   <binding name="BasicHttpBinding_ImporterService" maxBufferSize="2147483647"
      receiveTimeout="00:10:00"
      sendTimeout="00:10:00"
        openTimeout="00:10:00"
        closeTimeout="00:10:00"
        maxReceivedMessageSize="2147483647">
        <security mode="None" />
        </binding>
        ....

This timeout appears on the client side (for example, I can do this by adding a 1-minute sleep in the service code)

Question1 , , .

, web.config web.config

inside the existing <basicHttpBinding> as shown below


 ><basicHttpBinding>
    ><binding name="downloadBinding" maxReceivedMessageSize="2000000" maxBufferSize="2000000">
    ><readerQuotas maxArrayLength="2000000" maxStringContentLength="2000000" />
    ></binding>
    >    
    ><binding name="BasicHttpBinding_IImporterService" maxBufferSize="2147483647"
    >receiveTimeout="00:10:00"
    >sendTimeout="00:10:00"
    >openTimeout="00:10:00"
    >closeTimeout="00:10:00"
    >maxReceivedMessageSize="2147483647">
    ><security mode="None" />
    ></binding>
    >    
    ></basicHttpBinding>            
    ></bindings>

. BasicHttpBinding_IImporterService ( , , ,

I also have <httpRuntime executionTimeout set to a huge value.

- . 1 .

,

1. What an I doing wrong, am I putting these settings in the wrong place?
2. Is it just client side I need to do
3. Perhap it can be done in code if these config settings don't work

, ,

ImporterServiceClient importerService = new ImporterServiceClient("*", new >EndpointAddress(ServicePath));

, , , , , , , ?

. , , - ( , config, -, )!

,

0
2

web.config . SL. ServiceRefferences , VisualStudio

ServiceReferences.ClientConfig

<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>

            <binding name="BasicHttpBinding_IEventsService" closeTimeout="01:59:00"
                receiveTimeout="01:59:00" sendTimeout="01:59:00" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://mySite/MyService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEventsService"
            contract="EventService.IEventsService" name="BasicHttpBinding_IEventsService" />

    </client>
</system.serviceModel>

. .

+1

@Std_Net, . , , ( !)

, -, - . , , , , , , .

, (web.config), .

, - - ( WCF, ), ...

private readonly ImporterServiceClient m_importerService; ...

m_importerService = new ImporterServiceClient("*", new EndpointAddress(ServicePath));            
const int timeoutMinutes = 15;
m_importerService.Endpoint.Binding.OpenTimeout = TimeSpan.FromMinutes(timeoutMinutes);
m_importerService.Endpoint.Binding.SendTimeout = TimeSpan.FromMinutes(timeoutMinutes);
0

All Articles