views:

414

answers:

1

I cannot figure out how to set a timeout on an ADO.NET data service that I am calling from a Silverlight client. I have seen blogs posts that mention a timeout property on the DataServiceContext base class.

http://blogs.msdn.com/astoriateam/archive/2009/01/13/timeout-workaround.aspx

But when I try to set the Timeout property it on my DataServiceContext - but the property is not there.

Anyone know of other ways to set the timeout - otherwise the Silverlight app will sit there waiting forever.

I am sure there is a way to set a time out on my async methods that call out to the service but I do not wan to have to set that on each method call - I would to handle it at the service level

thanks Michael

A: 
<configuration>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="AllocationsDataServiceSoap" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647" **receiveTimeout=""**>
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address=""
            binding="basicHttpBinding" bindingConfiguration="AllocationsDataServiceSoap"
            contract="AllocationsDataWebService.AllocationsDataServiceSoap"
            name="AllocationsDataServiceSoap" />
    </client>
</system.serviceModel>

recievetimeout attribute in clientconfig.xml within the binding tag

edit: this xml file is created in you project root when you add a service reference

Jason Watts
this is great. Is there any way to do this code - we have 4 environments and would need to be able to set the endpoiont address in the binding dynamically
MIantosca

related questions