WCF - HTTP request was aborted

smt1279 1 Reputation point
2021-09-28T23:31:29.49+00:00

I am new to WCF and trying to troubleshoot an error. I have a WCF service running on a remote server and am receiving an error when another WCF service tries to call it running in my localhost.

The HTTP request to [url to the service] was aborted. This may be due to the local channel being closed while the request was still in progress. If this behavior is not desired, then update your code so that it does not close the channel while request operations are still in progress.

I tried looking at the activity in the Microsoft Service Trace Viewer and the first error received is:

Failed to lookup a channel to receive an incoming message. Either the endpoint or the SOAP action was not found.

I can see the service is running, I can access it in the browser.
Can anyone help point me in the right direction of anything I can try? The service that I am trying to connect to is called LinkTable and I have added the relevant config files.

Client web.config

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.6"/>
    <httpRuntime targetFramework="4.6"/>
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IMyService" />
        <binding name="BasicHttpBinding_IKeyLinkage" closeTimeout="00:25:00"
          openTimeout="00:02:00" receiveTimeout="00:02:00" sendTimeout="00:02:00"
          maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
        <binding name="BasicHttpBinding_IMaintenance" />
      </basicHttpBinding>
      <wsHttpBinding>
        <binding name="WSHttpBinding_L2" closeTimeout="00:25:00" openTimeout="00:02:00"
          receiveTimeout="00:02:00" sendTimeout="00:02:00" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
        <binding name="wsHttpBinding_IProcessXML" closeTimeout="00:25:00"
          openTimeout="00:02:00" receiveTimeout="00:02:00" sendTimeout="00:02:00"
          maxReceivedMessageSize="2147483647" />
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http:/path/Service.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
        contract="NotificationService.IMyService" name="BasicHttpBinding_IMyService" />
      <endpoint address="http://path/Maintenance.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMaintenance"
        contract="MaintenanceService.IMaintenance" name="BasicHttpBinding_IMaintenance" />
      <endpoint address="http://path/Services/KeyLinkage.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IKeyLinkage"
        contract="KeyLinkageService.IKeyLinkage" name="BasicHttpBinding_IKeyLinkage" />
      <endpoint address="https://path/Services/LinkTableService.svc"
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_L2"
        contract="LinkTable_L2.ILinkTableService" name="WSHttpBinding_ILinkTableService" />
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="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 -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="wsHttpBinding" scheme="http" bindingConfiguration="wsHttpBinding_IProcessXML"/>
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>
    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
                <listeners>
                    <add name="ServiceModelTraceListener" />
                </listeners>
            </source>
            <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
                <listeners>
                    <add name="ServiceModelTraceListener" />
                </listeners>
            </source>
            <source name="System.Runtime.Serialization" switchValue="Verbose,ActivityTracing">
                <listeners>
                    <add name="ServiceModelTraceListener" />
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add initializeData="App_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp" />
        </sharedListeners>
    </system.diagnostics>
</configuration>

Server web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
  </system.web>
  <system.serviceModel>
    <client>
      <endpoint address="http://path/Services/LinkTable.svc" binding="basicHttpBinding" bindingConfiguration="AppName_WCF_BasicHttpBinding" contract="LinkTableWCF.ILinkTable" name="BasicHttpBinding_ILinkTable" />
    </client>
    <services>
      </service>
      <service behaviorConfiguration="AppName_L2_WCF_Behavior" name="AppName_L2_WCF.Services.LinkTableService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="AppName_L2_WCF_wsHttpBinding" contract="AppName_L2_WCF.ServiceContracts.ILinkTableService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="AppName_WCF_BasicHttpBinding" maxBufferPoolSize="819200" maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
      <wsHttpBinding>
        <binding name="AppName_L2_WCF_wsHttpBinding" maxBufferPoolSize="819200" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="AppName_L2_WCF_Behavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="AppName_L2_WCF.Utils.ServiceAuthenticator, AppName_L2_WCF" />
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="wsHttpBinding" scheme="http" bindingConfiguration="AppName_L2_WCF_wsHttpBinding" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true" />
  </system.webServer>
</configuration>
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,368 questions
{count} votes