System.TimeoutException Error

We changed our Orchestration from using HTTP adapter to Wcf-WebHttp Adapter to call the REST service. In the Orchestration previously we used

Message(HTTP.RequestTimeout) = 3600;

Now with Wcf-WebHttp adapter which timeout do I need to use. Because there are WCF.CloseTimeout, WCF.LeaseTimeout, WCF.OpenTimeout,WCF.SendTimeout.

Any help is greatly appreciated. Thanks

July 28th, 2015 9:17am

Perhaps all of them as they apply to different situations, though OpenTimeout and SendTimeout are likely what you're really looking for.

Open refers to establishing the connection while Send applies to competing the request side of the operation, meaning sending all relevant data.

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 9:36am

You have to set the SendTimeout.

brief summary of binding timeouts:-

Client-side Timeouts

On the client side:

  1. SendTimeout 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.
  2. OpenTimeout used when opening channels when no explicit timeout value is specified
  3. CloseTimeout used when closing channels when no explicit timeout value is specified
  4. ReceiveTimeout is not used

Client-side Timeouts

On the service side:

  1. SendTimeout, OpentTimeout, CloseTimeout are the same as on the client
  2. ReceiveTimeout used by the Service Framework Layer to initialize the session-idle timeout which controls how long a session can be idle before timing out.
July 28th, 2015 9:42am

Can all these timeouts be over 10 minutes. Or it needs to be 10 minutes because master MSDTC timeout in Machine.config that's defaulted to 10 minutes
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 10:20am

By default all the distributed transactions initiated using System.Transactions have the default timeout of 10 minutes. If we try to override this timeout in the code or in the app.config file it will be adjusted down to 10 minutes. To get around the problem :

1. Added the following section in the machine.config file to set the maxTimeout to 1 hour :

<configuration>
 <system.transactions>
   <machineSettings maxTimeout="01:00:00" />
 </system.transactions>
</configuration> 

2. We modified the System.Transactions section in machine.config by setting the allowExeDefinition attribute to MachineToApplication (from MachineOnly). After this, we were able to override the machine.config timeout of 10 minutes in the code and that allowed the transaction to complete successfully.

 
<sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
      <section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineToApplication" />
    </sectionGroup>

Source: Override the System.Transactions default timeout of 10 minutes in the code
July 28th, 2015 10:33am

Sure, you can set them to anything you want.  Not sure what the MSDTC timeout has to do with anything.

You will have to test, and test again.  Lengthening one timeout can expose other timeouts.

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 10:34am

Rachit Sikroria

where do I find this machine.config file.

July 28th, 2015 10:56am

I tried to give timeout

varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];

varNewXmlMsg = new System.Xml.XmlDocument(); varNewXmlMsg.LoadXml(@"<path>" + Message_Data(FILE.ReceivedFileName) + @"</path>"); Message = varNewXmlMsg; Message(WCF.OpenTimeout)= "01:00:00"; Message(WCF.CloseTimeout)= "01:00:00"; Message(WCF.SendTimeout)= "01:00:00"; Message(HTTP.RequestTimeout) = 3600; Message(WCF.HttpMethodAndUrl) = @"<BtsHttpUrlMapping><Operation Name = 'RESTGet' Method ='GET'/></BtsHttpUrlMapping>"; Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Data(FILE.ReceivedFileName); Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp"; Message(WCF.SuppressMessageBodyForHttpVerbs) = "GET";

Now it gives me

A message sent to adapter "WCF-WebHttp" on send port "..." with URI "...." is suspended.
 Error details: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to .... This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

What could be the reason this. I tried to give onl the SendTimeOut but that does give the same error like above.

Any help is greatly appreciated.


  • Edited by vdha 16 hours 5 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 11:04am

I would also check by adding Receive timeout. I have seen that client Policy requires.

https://msdn.microsoft.com/en-us/library/bb412176(v=vs.110).aspx

Regards

K


  • Edited by Koushik984 15 hours 33 minutes ago Missed the URL
July 28th, 2015 11:06am

I dont see any Receive timeout here

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 11:15am

HOLD ON!  Do you actually expect the service to regularly take up to 10 minutes?

What problem are you actually trying to solve.

Also, why are you worrying about MSDTC timeouts?  That has nothing to do with WCF/http calls.

July 28th, 2015 11:21am

I didnot change anything with respect to the MSDTC timeout. I read that MSDTC timeout in Machine.config that's defaulted to 10 minutes, not sure if I  can change the WCF.CloseTimeout, WCF.LeaseTimeout, WCF.OpenTimeout,WCF.SendTimeout. to over 10 mins.

Now my problem is even I tried to give three timeouts but I am getting the above error...

Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 11:24am

Does it work with all the defaults set?  You have to start with the most basic config and adjust from there.

July 28th, 2015 12:04pm

I tried to give timeout

varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];

varNewXmlMsg = new System.Xml.XmlDocument(); varNewXmlMsg.LoadXml(@"<path>" + Message_Data(FILE.ReceivedFileName) + @"</path>"); Message = varNewXmlMsg; Message(WCF.OpenTimeout)= "01:00:00"; Message(WCF.CloseTimeout)= "01:00:00"; Message(WCF.SendTimeout)= "01:00:00"; Message(HTTP.RequestTimeout) = 3600; Message(WCF.HttpMethodAndUrl) = @"<BtsHttpUrlMapping><Operation Name = 'RESTGet' Method ='GET'/></BtsHttpUrlMapping>"; Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Data(FILE.ReceivedFileName); Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp"; Message(WCF.SuppressMessageBodyForHttpVerbs) = "GET";

Now it gives me

A message sent to adapter "WCF-WebHttp" on send port "..." with URI "...." is suspended.
 Error details: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to .... This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

What could be the reason this. I tried to give onl the SendTimeOut but that does give the same error like above.

Any help is greatly appreciated.


  • Edited by vdha Tuesday, July 28, 2015 2:58 PM
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 2:58pm

I tried to give timeout

varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];

varNewXmlMsg = new System.Xml.XmlDocument(); varNewXmlMsg.LoadXml(@"<path>" + Message_Data(FILE.ReceivedFileName) + @"</path>"); Message = varNewXmlMsg; Message(WCF.OpenTimeout)= "01:00:00"; Message(WCF.CloseTimeout)= "01:00:00"; Message(WCF.SendTimeout)= "01:00:00"; Message(HTTP.RequestTimeout) = 3600; Message(WCF.HttpMethodAndUrl) = @"<BtsHttpUrlMapping><Operation Name = 'RESTGet' Method ='GET'/></BtsHttpUrlMapping>"; Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Data(FILE.ReceivedFileName); Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp"; Message(WCF.SuppressMessageBodyForHttpVerbs) = "GET";

Now it gives me

A message sent to adapter "WCF-WebHttp" on send port "..." with URI "...." is suspended.
 Error details: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to .... This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

What could be the reason this. I tried to give onl the SendTimeOut but that does give the same error like above.

Any help is greatly appreciated.


  • Edited by vdha Tuesday, July 28, 2015 2:58 PM
July 28th, 2015 2:58pm

I tried to give timeout

varNewSearchDataLoadURL = System.Configuration.ConfigurationManager.AppSettings["NewSearchDataLoadURL"];

varNewXmlMsg = new System.Xml.XmlDocument(); varNewXmlMsg.LoadXml(@"<path>" + Message_Data(FILE.ReceivedFileName) + @"</path>"); Message = varNewXmlMsg; Message(WCF.OpenTimeout)= "01:00:00"; Message(WCF.CloseTimeout)= "01:00:00"; Message(WCF.SendTimeout)= "01:00:00"; Message(HTTP.RequestTimeout) = 3600; Message(WCF.HttpMethodAndUrl) = @"<BtsHttpUrlMapping><Operation Name = 'RESTGet' Method ='GET'/></BtsHttpUrlMapping>"; Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.Address) = varNewSearchDataLoadURL + "?path=" + Message_Data(FILE.ReceivedFileName); Port_NewSearch_API(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WebHttp"; Message(WCF.SuppressMessageBodyForHttpVerbs) = "GET";

Now it gives me

A message sent to adapter "WCF-WebHttp" on send port "..." with URI "...." is suspended.
 Error details: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to .... This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

What could be the reason this. I tried to give onl the SendTimeOut but that does give the same error like above.

Any help is greatly appreciated.


  • Edited by vdha Tuesday, July 28, 2015 2:58 PM
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 2:58pm

I would also check by adding Receive timeout. I have seen that client Policy requires.

https://msdn.microsoft.com/en-us/library/bb412176(v=vs.110).aspx

Regards

K


  • Edited by Koushik984 Tuesday, July 28, 2015 3:30 PM Missed the URL
July 28th, 2015 3:00pm

I would also check by adding Receive timeout. I have seen that client Policy requires.

https://msdn.microsoft.com/en-us/library/bb412176(v=vs.110).aspx

Regards

K


  • Edited by Koushik984 Tuesday, July 28, 2015 3:30 PM Missed the URL
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2015 3:00pm

I would also check by adding Receive timeout. I have seen that client Policy requires.

https://msdn.microsoft.com/en-us/library/bb412176(v=vs.110).aspx

Regards

K


  • Edited by Koushik984 Tuesday, July 28, 2015 3:30 PM Missed the URL
July 28th, 2015 3:00pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics