none
Web service related exceptions RRS feed

  • Question

  • We have a web service hosted in staging environment. Its working well in the production but throwing exceptions as seen in the logs. Dev server has been decommissioned. How do I troubleshoot below exceptions. I have no prior experience in this.

    --------------------------
    1) The message could not be processed. This is most likely because the action 'http://tempuri.org/IDcData/MethodName' is incorrect or because the message contains

    an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the

    channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding

    --------------

    2) Exception has been thrown by the target of an invocation.

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle

    typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean

    skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at

    System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)


    Regards Vaibhav Kaulkar

    Tuesday, June 19, 2018 9:05 AM

Answers

  • Tao Zhou

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
              <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
              <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
              <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
              <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            </sectionGroup>
          </sectionGroup>
        </sectionGroup>
      </configSections>
      <appSettings/>
      <connectionStrings>
       
        <add name="BHOS" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=BHOS;Persist Security Info=True;Integrated Security=True; Connect Timeout=200; pooling='true'; Max Pool Size=200" />
        <add name="EBB" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=EBB;Persist Security Info=True;Integrated Security=True;Connect Timeout=200; pooling='true'; Max Pool Size=200" />
       <add name="BHOS-DC" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=DMSReporting;Persist Security Info=True;Integrated Security=True;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>
      </connectionStrings>
      <system.web>
        <httpRuntime executionTimeout="600"/>
        <compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
          </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows" />
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
             <error statusCode="403" redirect="NoAccess.htm"/>
             <error statusCode="404" redirect="FileNotFound.htm"/>
            </customErrors>
        -->
        <pages>
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </controls>
        </pages>
        <httpHandlers>
          <remove verb="*" path="*.asmx" />
          <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
        </httpHandlers>
        <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpModules>
      </system.web>
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="v3.5" />
            <providerOption name="WarnAsError" value="false" />
          </compiler>
        </compilers>
      </system.codedom>
      <!--
          The system.webServer section is required for running ASP.NET AJAX under Internet
          Information Services 7.0.  It is not necessary for previous version of IIS.
      -->
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
          <remove name="ScriptModule" />
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated" />
          <remove name="ScriptHandlerFactory" />
          <remove name="ScriptHandlerFactoryAppServices" />
          <remove name="ScriptResource" />
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </handlers>
        <directoryBrowse enabled="true" />
      </system.webServer>
      <runtime>
        <assemblyBinding appliesTo="v2.0.05727" xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.TasksServiceBehavior" name="BHI.BHOS.ServiceHost.Tasks">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.ITasks">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
            <endpoint address="mex" binding="wsHttpBinding"  contract="BHI.BHOS.ServiceHost.Service.ITasks" />
            <!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
          </service>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.RecordsServiceBehavior" name="BHI.BHOS.ServiceHost.Records">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.IRecords">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
            <endpoint address="mex" binding="wsHttpBinding"  contract="BHI.BHOS.ServiceHost.Service.IRecords" />
            <!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
          </service>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.DcDataBehavior" name="BHI.BHOS.ServiceHost.DcData">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.IDcData" >
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="BHI.BHOS.ServiceHost.TasksServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="524288000" />
            </behavior>
            <behavior name="BHI.BHOS.ServiceHost.RecordsServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="524288000" />
            </behavior>
            <behavior name="BHI.BHOS.ServiceHost.DcDataBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
              <dataContractSerializer maxItemsInObjectGraph="524288000"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding name="BHOSDCWSHttpsBinding" sendTimeout="00:10:00" maxBufferPoolSize="20000000"
              maxReceivedMessageSize="20000000" allowCookies="true">
              <readerQuotas maxDepth="32" maxStringContentLength="200000000"
                maxArrayLength="200000000" />
            </binding>
            <binding name="BHOSWSHttpsBinding" closeTimeout="00:30:00" openTimeout="00:30:00"
              receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="524288000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="524288000" maxStringContentLength="524288000"
                maxArrayLength="524288000" maxBytesPerRead="524288000" maxNameTableCharCount="524288000" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Transport">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
            <binding name="BHOSWSHttpBinding" closeTimeout="00:30:00" openTimeout="00:30:00"
              receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="524288000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="524288000" maxStringContentLength="524288000"
                maxArrayLength="524288000" maxBytesPerRead="524288000" maxNameTableCharCount="524288000" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>
    </configuration>


    Regards Vaibhav Kaulkar

    • Marked as answer by wiki_vk Sunday, July 8, 2018 3:50 PM
    Friday, June 22, 2018 11:53 AM
  • This is resolved now. The problem was with bindings and service references were not updated.

    Regards Vaibhav Kaulkar

    • Marked as answer by wiki_vk Sunday, July 8, 2018 3:51 PM
    Sunday, July 8, 2018 3:51 PM

All replies

  • Hi VaibhavKaulkar,

    Could you share us more information about your Web Service, like binding, security?

    >>This is most likely because the action 'http://tempuri.org/IDcData/MethodName' is incorrect or because the message contains

    Is this error logged by WCF Tracing? Does this error happen on the specific method or randomly methods?

    Could you reproduce this issue with a new Service?

    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.

    Wednesday, June 20, 2018 6:25 AM
  • Tao Zhou

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
              <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
              <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
              <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
              <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            </sectionGroup>
          </sectionGroup>
        </sectionGroup>
      </configSections>
      <appSettings/>
      <connectionStrings>
       
        <add name="BHOS" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=BHOS;Persist Security Info=True;Integrated Security=True; Connect Timeout=200; pooling='true'; Max Pool Size=200" />
        <add name="EBB" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=EBB;Persist Security Info=True;Integrated Security=True;Connect Timeout=200; pooling='true'; Max Pool Size=200" />
       <add name="BHOS-DC" connectionString="Data Source=BHIHOUVMH01;Pooling=false;Initial Catalog=DMSReporting;Persist Security Info=True;Integrated Security=True;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>
      </connectionStrings>
      <system.web>
        <httpRuntime executionTimeout="600"/>
        <compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
          </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows" />
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
             <error statusCode="403" redirect="NoAccess.htm"/>
             <error statusCode="404" redirect="FileNotFound.htm"/>
            </customErrors>
        -->
        <pages>
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </controls>
        </pages>
        <httpHandlers>
          <remove verb="*" path="*.asmx" />
          <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
        </httpHandlers>
        <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpModules>
      </system.web>
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="v3.5" />
            <providerOption name="WarnAsError" value="false" />
          </compiler>
        </compilers>
      </system.codedom>
      <!--
          The system.webServer section is required for running ASP.NET AJAX under Internet
          Information Services 7.0.  It is not necessary for previous version of IIS.
      -->
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
          <remove name="ScriptModule" />
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated" />
          <remove name="ScriptHandlerFactory" />
          <remove name="ScriptHandlerFactoryAppServices" />
          <remove name="ScriptResource" />
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </handlers>
        <directoryBrowse enabled="true" />
      </system.webServer>
      <runtime>
        <assemblyBinding appliesTo="v2.0.05727" xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.TasksServiceBehavior" name="BHI.BHOS.ServiceHost.Tasks">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.ITasks">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
            <endpoint address="mex" binding="wsHttpBinding"  contract="BHI.BHOS.ServiceHost.Service.ITasks" />
            <!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
          </service>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.RecordsServiceBehavior" name="BHI.BHOS.ServiceHost.Records">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.IRecords">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
            <endpoint address="mex" binding="wsHttpBinding"  contract="BHI.BHOS.ServiceHost.Service.IRecords" />
            <!--<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />-->
          </service>
          <service behaviorConfiguration="BHI.BHOS.ServiceHost.DcDataBehavior" name="BHI.BHOS.ServiceHost.DcData">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration="BHOSWSHttpBinding" contract="BHI.BHOS.ServiceHost.Service.IDcData" >
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="BHI.BHOS.ServiceHost.TasksServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="524288000" />
            </behavior>
            <behavior name="BHI.BHOS.ServiceHost.RecordsServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="524288000" />
            </behavior>
            <behavior name="BHI.BHOS.ServiceHost.DcDataBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
              <dataContractSerializer maxItemsInObjectGraph="524288000"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding name="BHOSDCWSHttpsBinding" sendTimeout="00:10:00" maxBufferPoolSize="20000000"
              maxReceivedMessageSize="20000000" allowCookies="true">
              <readerQuotas maxDepth="32" maxStringContentLength="200000000"
                maxArrayLength="200000000" />
            </binding>
            <binding name="BHOSWSHttpsBinding" closeTimeout="00:30:00" openTimeout="00:30:00"
              receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="524288000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="524288000" maxStringContentLength="524288000"
                maxArrayLength="524288000" maxBytesPerRead="524288000" maxNameTableCharCount="524288000" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Transport">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
            <binding name="BHOSWSHttpBinding" closeTimeout="00:30:00" openTimeout="00:30:00"
              receiveTimeout="00:30:00" sendTimeout="00:30:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288000" maxReceivedMessageSize="524288000"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="524288000" maxStringContentLength="524288000"
                maxArrayLength="524288000" maxBytesPerRead="524288000" maxNameTableCharCount="524288000" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>
    </configuration>


    Regards Vaibhav Kaulkar

    • Marked as answer by wiki_vk Sunday, July 8, 2018 3:50 PM
    Friday, June 22, 2018 11:53 AM
  • Hi VaibhavKaulkar,

    >>To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding

    For this error, I suggest you increase the Receive timeout to 60.

    >>Exception has been thrown by the target of an invocation

    How did you get this error, by WCF tracing or your own error handling?

    Could this issue be reproduced in a simple project?

    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, June 25, 2018 6:58 AM
  • Hi Tao, the service timeout is gone now and the tracing gives the exception. But no exception in the console application.

    Regards Vaibhav Kaulkar

    Monday, June 25, 2018 10:40 AM
  • >>But no exception in the console application.

    What do you mean by this line?

    Does this error "Exception has been thrown by the target of an invocation" throw in client or server side?


    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, June 26, 2018 5:53 AM
  • this is server side

    Regards Vaibhav Kaulkar

    Wednesday, June 27, 2018 3:05 AM
  • Does this error happen on the specific method?

    Could you reproduce this error with a new simple WCF Service?


    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.

    Wednesday, June 27, 2018 7:30 AM
  • I do not know much details about the service. I am a sharepoint developer can you give some troubleshoot points. When I hosted this in local iis and consumed using client, it gives me data in datatable but while binding to SPGRIDVIEW, it does not bind data. Do I need to refresh/ update service connections. Currently no documents are available on this but itsrunning in production. so any other way to replicate staging and production?

    Regards Vaibhav Kaulkar

    Saturday, June 30, 2018 4:45 AM
  • This is resolved now. The problem was with bindings and service references were not updated.

    Regards Vaibhav Kaulkar

    • Marked as answer by wiki_vk Sunday, July 8, 2018 3:51 PM
    Sunday, July 8, 2018 3:51 PM