none
Timeout setting for WCF RESTful service RRS feed

  • Question

  • Hi all,

    I faced a strange issue when I using webhttpbinding to implement WCF RESTful service. I set the sendTimeout of binding to 5 mins in server side and then use Thread.Sleep to wait 10 mins in the operation. But when I use browser to call operation, it will not get the timeout and result can return after about 10 mins. So why the sendtimeout of binding doesn't work?

    Thanks.

    Saturday, May 12, 2018 12:41 PM

Answers

  • Hi,

    What do you want to achieve?

    >> why the sendtimeout of binding doesn't work?

    SendTimeout would not throw exception in your scenario. It is used to initialize the OperationTimeout, which governs the whole process of sending a message, including receiving a reply message for a request/reply service operation. This timeout also applies when sending reply messages from a callback contract method.

    For Rest service, you could not set the SendTimeout for web browser, for setting this at service side, it applies when sending reply message from a callback in service side.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 14, 2018 2:05 AM

All replies

  • Hi,

    What do you want to achieve?

    >> why the sendtimeout of binding doesn't work?

    SendTimeout would not throw exception in your scenario. It is used to initialize the OperationTimeout, which governs the whole process of sending a message, including receiving a reply message for a request/reply service operation. This timeout also applies when sending reply messages from a callback contract method.

    For Rest service, you could not set the SendTimeout for web browser, for setting this at service side, it applies when sending reply message from a callback in service side.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 14, 2018 2:05 AM
  • Hi Tao,

    Thanks for the reply. So for the SendTimeout of client side binding, it is used as timeout of whole operation (client request+servce process+server response). And for the SendTimeout of server side binding, it is used as timeout of message response from server side via callback. Is my understanding right?

    Thanks again.

    Monday, May 14, 2018 11:53 AM
  • Yes, that's it.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 15, 2018 2:18 AM
  • Thanks for the supporting!
    Tuesday, May 15, 2018 11:53 AM