Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Error in accessing WCF Service: I am struck can somebody please help me friends

$
0
0
Hi,

I am trying to access some considerably large data from a WCF Service Operation, sometimes I am getting this error:
Additional information: An error occurred while receiving the HTTP response to https://localhost:44301/RefData.svc. 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.

An another thing just now I have found is: for the ones that are not failing, I am getting only 11035 records, but the ones the WFC client is failing, then we are receiving 30206 records, so this could be one of the problems, but trying different combinations where to fix this issue, I have changed in many places by placing different max sizes to fix this issue.

I have changed the Service Behavior in the Services Project I have changed the httpRuntime for max values changed the bindings at the client to support max values like buffer, receive size etc, tried to set the JSon serialization values to support max values like the below. Nothing worked so far any help would be greatly helpful thanks in advance.

is JSon timing out or exceeding the max value I don't know
<system.web.extensions><scripting><webServices><jsonSerialization maxJsonLength="2147483647" /></webServices></scripting></system.web.extensions>
But still this didn't help

Any help would be very very helpful, a link, a code snippet or even suggestion, thanks in advance friends.

my Web config of WCF Service is:
<system.serviceModel><bindings><customBinding><bindingname="crsSecureHttpBinding"><transactionFlow/><textMessageEncoding/><security><localServiceSettingsreplayCacheSize="800000"replayWindow="00:05:00"/></security><httpsTransportmaxBufferPoolSize="524288"maxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding></customBinding></bindings><behaviors><serviceBehaviors><behavior><!-- To avoid disclosing metadata information, set the values below to false before deployment --><serviceMetadatahttpGetEnabled="true"httpsGetEnabled="true"/><!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --><serviceDebugincludeExceptionDetailInFaults="true"/></behavior></serviceBehaviors></behaviors><services><servicename="RefDataWcfService.MenuItemsService"><endpointaddress=""binding="customBinding"bindingConfiguration="crsSecureHttpBinding"contract="RefDataWcfService.IMenuItemsService"/></service><servicename="RefDataWcfService.ReferenceData"><endpointaddress=""binding="customBinding"bindingConfiguration="crsSecureHttpBinding"contract="RefDataWcfService.IReferenceData"/></service><servicename="ReportsWcfService.ReportsService"><endpointaddress=""binding="customBinding"bindingConfiguration="crsSecureHttpBinding"contract="ReportsWcfService.IReports"/></service><servicename="RefDataWcfService.DataEntryService"><endpointaddress=""binding="customBinding"bindingConfiguration="crsSecureHttpBinding"contract="RefDataWcfService.IDataEntryService"/></service><servicename="RefDataWcfService.ITAdminService"><endpointaddress=""binding="customBinding"bindingConfiguration="crsSecureHttpBinding"contract="RefDataWcfService.IITAdminService"/></service></services><protocolMapping><addbinding="basicHttpsBinding"scheme="https"/></protocolMapping><!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />--></system.serviceModel>

my Web config of ASP.Net MVC application is:
<system.serviceModel><behaviors><endpointBehaviors><behaviorname="ImpersonationBehavior"><clientCredentials><windowsallowedImpersonationLevel="Impersonation"/></clientCredentials></behavior></endpointBehaviors></behaviors><bindings><customBinding><bindingname="CustomBinding_IMenuItemsService"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportmaxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding><bindingname="CustomBinding_IDataEntryService"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportmaxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding><bindingname="CustomBinding_IReferenceData"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportmaxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding><bindingname="CustomBinding_IITAdminService"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportmaxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding><bindingname="CustomBinding_IReports"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportmaxReceivedMessageSize="2147483647"authenticationScheme="Negotiate"maxBufferSize="2147483647"/></binding><bindingname="CustomBinding_IReferenceData1"><securitydefaultAlgorithmSuite="Default"authenticationMode="SspiNegotiated"requireDerivedKeys="true"includeTimestamp="true"messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"requireSignatureConfirmation="false"><localClientSettingsdetectReplays="true"/><localServiceSettingsdetectReplays="true"/></security><textMessageEncoding/><httpsTransportauthenticationScheme="Negotiate"/></binding></customBinding><wsHttpBinding><bindingname="WSHttpBinding_IBHISPortalDataService"maxReceivedMessageSize="2147483647"maxBufferPoolSize="2147483647"><securitymode="Transport"/></binding></wsHttpBinding></bindings><client><endpointaddress="https://bhisdevapp.dhcs.ca.gov:448/BHISPortalDataService.svc"binding="wsHttpBinding"bindingConfiguration="WSHttpBinding_IBHISPortalDataService"contract="BHISPortalDataService.IBHISPortalDataService"name="WSHttpBinding_IBHISPortalDataService"/><endpointaddress="https://localhost:44301/MenuItemsService.svc"behaviorConfiguration="ImpersonationBehavior"binding="customBinding"bindingConfiguration="CustomBinding_IMenuItemsService"contract="MenuItemsService.IMenuItemsService"name="CustomBinding_IMenuItemsService"/><endpointaddress="https://localhost:44301/DataEntryService.svc"binding="customBinding"bindingConfiguration="CustomBinding_IDataEntryService"contract="DataEntryService.IDataEntryService"name="CustomBinding_IDataEntryService"/><endpointaddress="https://localhost:44301/ITAdminService.svc"binding="customBinding"bindingConfiguration="CustomBinding_IITAdminService"contract="ITAdminService.IITAdminService"name="CustomBinding_IITAdminService"/><endpointaddress="https://localhost:44301/ReportsService.svc"binding="customBinding"bindingConfiguration="CustomBinding_IReports"contract="ReportsService.IReports"name="CustomBinding_IReports"/><endpointaddress="https://localhost:44301/ReferenceData.svc"binding="customBinding"bindingConfiguration="CustomBinding_IReferenceData"contract="ReferenceDataService.IReferenceData"name="CustomBinding_IReferenceData"></endpoint></client></system.serviceModel>

The Controller method where its throwing exception, is JSon timing out or exceeding the max value I don't know.
[AjaxAction]public ActionResult ServicePrograms_Read([DataSourceRequest] DataSourceRequest request)
{using (ReferenceDataClient referenceDataClient = new ReferenceDataClient())
    {
        CommonFunctions.IgnoreCertificationErrors();try
        {return Json(referenceDataClient.GetServiceProgramDetails(GetCurrentFiscalPeriod(), GetCurrentUser()).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }catch (Exception ex)
        {throw ex;
        }
    }
}
Is this error related to any Json conversion or content negotiation any help would be greatly helpful - thanks in advance friends.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>