Açıklama:


İçinde web servis sorgusu bulunan süreçlerde aşağıdaki hata alınıyorsa, sorgunun tamamlanması için verilen default timeout süresi aşılıyor demektir.

Unhandled exception occured while completing job.
System.TimeoutException: The request channel timed out attempting to send after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'https://kepws.turkkep.com.tr/KEPWSClient/KEPRetrieval' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace: 
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Request(Message message)

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IRequestChannel.Request(Message message)
at AltiKare.Web.Services.WebServiceEndpoint.Send(XmlMessage input, CredentialStore credentials)
at AltiKare.Web.Services.WebServiceReference.Invoke(String contractName, XmlMessage message, CredentialStore credentials)
at AltiKare.Web.Services.WebServiceReference.InvokeChecked(String contractName, XmlMessage message, CredentialStore credentials)
at AltiKare.Scripting.Execution.WebServiceOperationProxy.CallLateBound(Object thisObject, Object[] argumentValues)
at fetchInbox(ScriptEngine , Scope , Object , FunctionInstance , Object[] )
at Jurassic.Library.UserDefinedFunction.CallLateBound(Object thisObject, Object[] argumentValues)
at Jurassic.Library.ArrayInstance.ForEach(ObjectInstance thisObj, FunctionInstance callbackFunction, ObjectInstance context)
at binder_for_Jurassic.Library.ArrayInstance.ForEach(ScriptEngine , Object , Object[] )
at Jurassic.Compiler.Binder.Call(ScriptEngine engine, Object thisObject, Object[] arguments)
at Jurassic.Library.ClrFunction.CallLateBound(Object thisObject, Object[] arguments)
at eval(ScriptEngine , Scope , Object )
at Jurassic.Compiler.EvalMethodGenerator.Execute()
at Jurassic.ScriptEngine.Evaluate(ScriptSource source)
at AltiKare.Scripting.Execution.ScriptContext.Run(ScriptEngine engine, String code)
at AltiKare.Workflow.Business.Server.Logic.WorkItem.RunEvaluationScript(WorkItem workItem)
at AltiKare.Workflow.Business.Server.Logic.Workers.WorkItemEvaluate.CompleteCore()
at AltiKare.Workers.Worker.Complete()


Çözüm:


Süreç koduna girerek web servis sorgusunu bulduktan sonra konfigurasyonda aşağıdaki şekilde istediğiniz timeout süresini verebilirsiniz: 

<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding openTimeout="00:10:00" 
                 closeTimeout="00:10:00" 
                 sendTimeout="00:10:00" 
                 receiveTimeout="00:10:00">
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>

 

Timeout sürelerinin client ve web servis taraflarındaki tanımları:


Client tarafında timeout tanımları

SendTimeout: Mesaj gönderilirken dikkat edilen süre.

OpenTimeout: Hiçbir timeout süresi belirtilmediğinde kanal açılırken dikkate alınır.

CloseTimeout: Hiçbir timeout süresi belirtilmediğinde kanal kapatılırken dikkate alınır.

ReceiveTimeout: Client tarafında kullanılmaz.


Web Servis tarafında timeout tanımları

SendTimeout, OpenTimeout, CloseTimeout: Client tarafındaki ile aynı.

ReceiveTimeout: Bir session'ın timeout olmadan önce ne kadar süreyle idle (atıl) kalabileceğini belirler.