Intermittent Bad Gateway (502 error) in a WCF Service - wcf

Does anyone knows which scenarios a intermittent Bad Gateway can happens?
My client service works fine, so suddenly.. bad gateway!
My current binding:
<bindings>
<wsHttpBinding>
<binding name="ReceptorBinding" maxReceivedMessageSize="6291456" openTimeout="00:30:00"
closeTimeout="00:30:00" sendTimeout="00:30:00" receiveTimeout="00:30:00" useDefaultWebProxy="true" >
</binding>
</wsHttpBinding>
</bindings>
The log:
2013-12-09 09:42:49,659 [12] INFO - Sending package 1/616.
2013-12-09 09:47:07,025 [12] INFO - Sending package 2/616.
2013-12-09 09:50:43,510 [12] INFO - Sending package 3/616.
2013-12-09 09:55:33,195 [12] INFO - Sending package 4/616.
2013-12-09 09:58:41,370 [12] ERROR - [...]
The error:
System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (502) Proxy Error. ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory'1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory'1 factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory'1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ClientReliableChannelBinder'1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder'1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)
at System.ServiceModel.Channels.ClientReliableChannelBinder'1.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionClientSettings'1.SecurityRequestSessionChannel.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.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 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 Infraero.TINE3.STTComum.Modelo.Contratos.IContratoServicoReceptor.EnviarBilhetes(ContratoDadosReceptor dados)
at Infraero.TINE3.STTColetor.Negocio.Proxies.ProxyReceptor.EnviarBilhetes(ContratoDadosReceptor dados) in D:\SVN\STT na SEDE\3-0_CodigoFonte_Coletor\3-4_SRC\Coletor 2.0\Infraero.TINE3.STTColetor.Negocio\Proxies\ProxyReceptor.cs:line 34
at Infraero.TINE3.STTColetor.Negocio.Servicos.ServicoTransmissao.TransmitirBilhetes(ProxyReceptor proxyEnterprise, Int32 quantidadeLotes, Int32 i) in D:\SVN\STT na SEDE\3-0_CodigoFonte_Coletor\3-4_SRC\Coletor 2.0\Infraero.TINE3.STTColetor.Negocio\Servicos\ServicoTransmissao.cs:line 122
at Infraero.TINE3.STTColetor.Negocio.Servicos.ServicoTransmissao.TransmitirBilhetes() in D:\SVN\STT na SEDE\3-0_CodigoFonte_Coletor\3-4_SRC\Coletor 2.0\Infraero.TINE3.STTColetor.Negocio\Servicos\ServicoTransmissao.cs:line 55

Related

Getting the Reason/text data from soap fault

Does any one knows exact XPath to extract the reason/text from below SOAP FAULT using the adapter 'Messages' property tab and 'Inbound BizTalk message body' path property where I have to enter XPath.
I tried all the combination but did not get the text which is under reason/text tag.
I need to get the data which is under CData and send it to the user
I am sending soap fault to the user:
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Receiver</s:Value>
<s:Subcode>
<s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US"><![CDATA[<ns0:TimeoutFault xmlns:ns0="">
<Type>TimeoutFault</Type>
<Destination></Destination>
<Source></Source>
<MiddlewareMessageID>de03ba4a-f6af-4524-a92e-952ceae067bf</MiddlewareMessageID>
<MiddlewareMessage>Timeout Fault</MiddlewareMessage>
<DateTime>9/17/2013 11:51:15 AM</DateTime>
<ErrorDetails>An error occurred while processing the message, refer to the details section for more information
Message ID: {DEBB80C7-B2E8-479F-BCAA-649AEAF21986}
Instance ID: {81320AEC-79DE-48DB-84EE-5D2BC8F3E3BE}
Error Description: System.TimeoutException: The HTTP request to '' has exceeded the allotted timeout of 00:00:00. The time allotted to this operation may have been a portion of a longer timeout.
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.SetRequestTimeout(HttpWebRequest request, TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.SendWebRequest()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, AsyncCallback callback, Object state)
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.BeginRequest(Message message, AsyncCallback callback, Object state)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendRequestMessage(IBaseMessage bizTalkMessage, IRequestChannel channel)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)
</ErrorDetails>
<StackTrace />
<Error>
<ErrorParam />
</Error>
</ns0:TimeoutFault>]]></s:Text>
</s:Reason>
<s:Detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true"/>
<InnerException i:nil="true"/>
<Message><![CDATA[<ns0:TimeoutFault xmlns:ns0="">
<Type></Type>
<Destination></Destination>
<Source>Worker Web</Source>
<MiddlewareMessageID>de03ba4a-f6af-4524-a92e-952ceae067bf</MiddlewareMessageID>
<MiddlewareMessage>Timeout Fault</MiddlewareMessage>
<DateTime>9/17/2013 11:51:15 AM</DateTime>
<ErrorDetails>An error occurred while processing the message, refer to the details section for more information
Error Description: System.TimeoutException: The HTTP request to '' has exceeded the allotted timeout of 00:00:00. The time allotted to this operation may have been a portion of a longer timeout.
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.SetRequestTimeout(HttpWebRequest request, TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.SendWebRequest()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.BeginRequest(Message message, AsyncCallback callback, Object state)
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.BeginRequest(Message message, AsyncCallback callback, Object state)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendRequestMessage(IBaseMessage bizTalkMessage, IRequestChannel channel)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage)
</ErrorDetails>
<StackTrace />
<Error>
<ErrorParam />
</Error>
</ns0:TimeoutFault>]]></Message>
<StackTrace>at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance.EndOperation(IAsyncResult result)
at AsyncInvokeEndEndTwoWayMethod(Object , Object[] , IAsyncResult )
at System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeEnd(Object instance, Object[]& outputs, IAsyncResult result)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkNackException</Type>
</ExceptionDetail>
</s:Detail>
</s:Fault>
</s:Body>
</s:Envelope>
I need to remove all the things and only send the reason part as a fault.
How to customize my soap fault?
Assuming that it is de-enveloped first, the XPath is
/*[local-name()='Fault' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Reason' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']/*[local-name()='Text' and namespace-uri()='http://www.w3.org/2003/05/soap-envelope']

Exception when making a call to DB and returning a List<T>

I am making a WCF service that connects to a database and return results. One out of four DataContracts works without a problem (that return an int) but the other three give me an exception (that return a List). Below the error message.
The underlying connection was closed: The connection was closed unexpectedly.
Server stack trace: at
System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException
webException, HttpWebRequest request, HttpAbortReason abortReason)
at
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
timeout) 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.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation) at
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
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 IReceiverService.SatList() at
ReceiverServiceClient.SatList()
Inner Exception: The underlying connection was closed: The connection
was closed unexpectedly. at System.Net.HttpWebRequest.GetResponse()
at
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
timeout)
You probably need to decorate the entities returned or the service with known type attributes

WebHttpBinding authentication ignored

I'm trying to use basic HTTP authentication with a REST service, but debugging proxy shows that no authentication headers are sent at all, they are ignored! Here is my code:
WebChannelFactory<IMyService> factory = new WebChannelFactory<IMyService>(
new WebHttpBinding(),
new Uri("http://10.6.90.45:8081"));
WebHttpBinding http = (WebHttpBinding) factory.Endpoint.Binding;
http.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
http.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly;
factory.Credentials.UserName.UserName = "username";
factory.Credentials.UserName.Password = "password";
IMyService proxy = factory.CreateChannel();
proxy.SomeMethod();
...
The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was ''.
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
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.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 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)
...

WCFTestClient exception on deployed service

I use the WCFTestClient that is provided with visual studio to test my service.
The thing is that the tool is working for the service that is deployed in wisual studio with my aplication. But if I try to connect to a deployed instance on another machine I get the following exception. Has anyone solved this issue?
The service uses WindowsAutentication.
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate oX0we6ADCgEBonQEcmBwBgkqhkiG9xIBAgIDAH5hMF+gAwIBBaEDAgEepBEYDzIwMTAxMDI3MDgzNTIxWqUFAgMCED6mAwIBKakLGwlCQVcuTE9DQUyqJzAloAMCAQOhHjAcGwRob3N0GxRsYmFpdGVzdDAxLmJhdy5sb2NhbA=='.
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
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.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 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 IBCMService.GetAllRegions()
at BCMServiceClient.GetAllRegions()
Inner Exception:
The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
Inner Exception:
The target principal name is incorrect
at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean throwOnError, SecurityStatus& statusCode)
at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob)
at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate)
at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials)
at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials)
at System.Net.AuthenticationState.AttemptAuthenticate(HttpWebRequest httpWebRequest, ICredentials authInfo)
at System.Net.HttpWebRequest.CheckResubmitForAuth()
at System.Net.HttpWebRequest.CheckResubmit(Exception& e)
You can right click on the config file in wcftestclient, click copy Full path, open the path it in an editor and check that the security settings match the deployed service configuration

error :Security processor was unable to find a security header in the message

I've a Windows based application using a WCF service hosted in IIS of development server. I'm calling a method defined in the service to run an SSIS package at the SQL database. The method returns success or failure to the client based on whether the package is executed successfully or not.
The package gets executed at the database successfully at all times but the service throws this error ONLY when the package takes longer than roughly 10 mins to execute. Otherwise I do not get this error.
I've already tried the following with no success:-
Increase the client timeouts in the app.config to higher value like 20 mins.
Increase the httpRuntime executionTimeout value in the web.config to a high value like 7200 secs.
The tracelog contains the following error:-
Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties. This can occur if the service is configured for security and the client is not using security.
stack trace:
System.ServiceModel.Security.SecurityStandardsManager.CreateReceiveSecurityHeader(Message message, String actor, SecurityAlgorithmSuite algorithmSuite, MessageDirection direction)
System.ServiceModel.Security.MessageSecurityProtocol.CreateSecurityHeader(Message message, String actor, MessageDirection transferDirection, SecurityStandardsManager standardsManager)
System.ServiceModel.Security.MessageSecurityProtocol.ConfigureReceiveSecurityHeader(Message message, String actor, SecurityProtocolCorrelationState[] correlationStates, SecurityStandardsManager standardsManager, IList1& supportingAuthenticators)
System.ServiceModel.Security.InitiatorSessionSymmetricMessageSecurityProtocol.VerifyIncomingMessageCore(Message& message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.ProcessIncomingMessage(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState, MessageFault& protocolFault)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.ProcessRequestContext(RequestContext requestContext, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.ReceiveInternal(TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
System.ServiceModel.Security.SecuritySessionClientSettings1.SecurityRequestSessionChannel.CloseOutputSession(TimeSpan timeout)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.CloseSession(TimeSpan timeout, Boolean& wasAborted)
System.ServiceModel.Security.SecuritySessionClientSettings1.ClientSecuritySessionChannel.OnClose(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.OnClose(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.ServiceModel.Channels.ServiceChannelProxy.ExecuteMessage(Object target, IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeChannel(IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)
System.ServiceModel.ClientBase1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)
System.ServiceModel.ClientBase1.Close()
MemberPlus.MemberPlusShared.ServiceProxy`1.Dispose()
MemberPlusDataLoads.DataLoads.ProcessData()
MemberPlusDataLoads.DataLoads.DoProcessData()
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
System.Threading.ExecutionContext.runTryCode(Object userData)
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Threading.ThreadHelper.ThreadStart()
I also get the following error:
The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
stack trace :
System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
System.ServiceModel.Channels.ClientReliableChannelBinder1.RequestClientReliableChannelBinder1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)
System.ServiceModel.Channels.ClientReliableChannelBinder1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)
System.ServiceModel.Channels.ClientReliableChannelBinder1.Request(Message message, TimeSpan timeout)
System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
IDataLoadService.LaunchPackage(String sourceType, String packageName, Int32 fileId, Int32 ign)
DataLoadServiceClient.LaunchPackage(String sourceType, String packageName, Int32 fileId, Int32 ign)
MemberPlusDataLoads.DataLoads.ProcessData()
MemberPlusDataLoads.DataLoads.DoProcessData()
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
System.Threading.ExecutionContext.runTryCode(Object userData)
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Threading.ThreadHelper.ThreadStart()
My app.config :-
<
binding name="WSHttpBinding_IDataLoadService" closeTimeout="00:12:00"
openTimeout="00:12:00" receiveTimeout="00:12:00" sendTimeout="00:12:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<
readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<
reliableSession ordered="true" inactivityTimeout="00:20:00"
enabled="false" />
<
security mode="Message">
<
transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<
message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
<
endpoint address="http://testappdbd/MemberPlusService/DataLoadService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDataLoadService"
contract="IDataLoadService" name="WSHttpBinding_IDataLoadService">
<
identity>
<
userPrincipalName value="testappdbd\ASPNET" />
The web.config:
<
system.web> <
httpRuntime maxRequestLength="2097151"
executionTimeout="7200"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
<
compilation debug="false" />
<
wsHttpBinding>
<
binding name="DLBinding"
maxReceivedMessageSize="2147483647" >
<
behavior name="DLServiceBehavior">
<
serviceMetadata httpGetEnabled="true" />
<
serviceDebug includeExceptionDetailInFaults="true" />
<
dataContractSerializer maxItemsInObjectGraph="2147483647" />
<
service name="DataLoadsService.ServiceImplementation.DataLoadsService" behaviorConfiguration ="DLServiceBehavior"> <
endpoint address="" binding="wsHttpBinding" bindingConfiguration="DLBinding"
contract="DataLoadsService.ServiceContract.IDataLoadService" />
<
endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
I used breakpoints at client side method which calls the service to see what's happening and i find that the client side connection remains open for entire length of time set under timeouts (12 mins) but the server side does not return the message.
Any thoughts on where the problems might be and the solution?
It may be a mismatch between the configuration on the client and the server.
Try putting all your configuration in a binding configuration and then use the same binding configuration on the server and client.