Search code examples
wcfsoap-clientwcf-binding

"No Endpoint Listening” in WCF Service Hosted in external Windows Service


I'm working on some code refactoring within an existing application.

The application is already hosted and it works fine.

I have WCF services hosted by an external Windows service.

Indeed, I'm working locally and I'm trying to test some code implementations in the Pre prod environment.

So, this is the proxy configuration within the basicHttpBinding code:

<bindings>
  <basicHttpBinding>
    <!--proxy configuration must be provided-->
    <binding name="BindingTimeSheet" maxReceivedMessageSize="6000000" useDefaultWebProxy="false" proxyAddress="http://xxx.xxx.x.x:xxxx" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00">
      <readerQuotas />
      <security mode="Transport">
        <transport clientCredentialType="Ntlm" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

and this is project server endpoint configuration:

<client>
  <endpoint address="https://xxxxxxxxxx.asmx" binding="basicHttpBinding" bindingConfiguration="BindingTimeSheet" contract="ProxyClientJeanDoe.JeanDoeSoap" name="JeanDoeSoap" />
</client>

I'm receiving this exceptions:

Inner Exception 1: EndpointNotFoundException: There was no listening endpoint on https://xxxxxxx.asmx that could accept the message. This is often due to an incorrect address or SOAP action. If present, see the InnerException element for more information.

Inner Exception 2: WebException: Can not connect to remote server

Inner Exception 3: SocketException: A connection attempt failed because the connected party did not respond properly after a certain amount of time or an established connection failed because the login host did not respond xxx.xxx.xx.x:xxxx

I have tested the WSDL services and they are working fine but the proxy address is not responding

I have already tried to set the anonymous authentication enabled and I'm working in a local machine where the Internet connection is using a proxy server and it's impossible to configure the firewall for Security reasons.

thanks for your understanding


Solution

  • Finally, The problem was related with the BypassProxyOnLocal flag. It was enabled so the requests to local Internet resources was not using the proxy server.

    This configuration placed into the Web.config works fine.

    <system.net> 
      <defaultProxy useDefaultCredentials="true"> 
        <proxy usesystemdefault="True" proxyaddress="http://xxxxxxxxxxx:8080" 
           bypassonlocal="False"/> 
      </defaultProxy> 
    </system.net>
    

    Thank you.