简体   繁体   中英

Timeout exception - c# ( wcf )

While I'm executing the server method asynchronously, getting this Timeout exception continuously.

"Additional information: This request operation sent to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous did not receive a reply within the configured timeout (00:01:00).
The time allotted to this operation may have been a portion of a longer timeout.
This may be because the service is still processing the operation or because the service was unable to send a reply message.
Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client."

Could someone mention how to increasing the operation timeout by casting the channel/proxy to IContextChannel and setting the OperationTimeout property ?

This is my existing binding (with client) code.

    DuplexChannelFactory<IPortal> datafactory;
    NetTcpBinding tcpBinding = new NetTcpBinding();
    String sURL = "net.tcp://localhost:8002/MyPortal";              
    tcpBinding.MaxReceivedMessageSize = System.Int32.MaxValue;
    tcpBinding.ReaderQuotas.MaxArrayLength = System.Int32.MaxValue;
    datafactory = new DuplexChannelFactory<IPortal>(this,tcpBinding, sURL);               
    Portal = datafactory.CreateChannel();

If you follow the link in the error (schemas.microsoft.com etc etc) it serves up:

Theresource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Why are you looking up MS? It sounds like you've got some config data wrong somewhere. If you search your source for that url, what do you find? Does it look sensible?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM