简体   繁体   English

WCF配置错误:没有端点在监听

[英]WCF Configuration Error: There was no endpoint listening at

I am trying to use a WCF service (I didn't write) from a WebAPI and am getting the dreaded 'There was no endpoint listening at...' error. 我试图从WebAPI使用WCF服务(我没有写过),并且得到了可怕的“没有端点在监听...”错误。 The interesting thing is that the service has a test ASPX page that uses it without error. 有趣的是,该服务具有一个测试ASPX页面,该页面使用该页面时不会出错。 So I copied the client portion of the config and added that to my API. 因此,我复制了配置的客户端部分,并将其添加到我的API中。

Client: 客户:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IAuthenticationService" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="Transport" />
            </binding>
        </basicHttpBinding>
        <customBinding>
            <binding name="CustomBinding_ILockboxServiceV1">
                <security authenticationMode="UserNameOverTransport" includeTimestamp="true">
                    <secureConversationBootstrap />
                </security>
                <textMessageEncoding messageVersion="Default" writeEncoding="utf-8" />
                <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint address="https://devsandbox2.imagebankingsystem.com/LockboxRemote.Web/ws/LockboxServiceV1.svc"
            binding="customBinding" bindingConfiguration="CustomBinding_ILockboxServiceV1"
            contract="PaymentGateway.ILockboxServiceV1" name="CustomBinding_ILockboxServiceV1" />
        <endpoint address="https://devsandbox2.imagebankingsystem.com/LockboxRemote.Web/ws/AuthenticationService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthenticationService"
            contract="PaymentGatewayAuthentication.IAuthenticationService" name="BasicHttpBinding_IAuthenticationService" />
    </client>
</system.serviceModel>

Server: 服务器:

<services>
  <service name="LockboxRemote.Web.ws.LockboxServiceV1" behaviorConfiguration="ServiceBehavior">

    <endpoint behaviorConfiguration="MexFlatWSDLBehavior" address="" binding="customBinding" contract="LockboxRemote.Web.ws.ILockboxServiceV1" bindingConfiguration="myConfig" bindingNamespace="https://devsandbox2.imagebankingsystem.com/LockboxRemoteGateway/ws/LockboxServiceV1"/>
  </service>


</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="MexFlatWSDLBehavior">
      <FlatWSDL />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthorization principalPermissionMode="Custom">
        <authorizationPolicies>
          <add policyType="LockboxRemote.Web.AuthorizationPolicy, LockboxRemote.Web" />
        </authorizationPolicies>
      </serviceAuthorization>
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom"
          customUserNamePasswordValidatorType="LockboxRemote.Web.CustomValidator,LockboxRemote.Web" />
      </serviceCredentials>
      <serviceSecurityAudit auditLogLocation="Application" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" suppressAuditFailure="true" />
    </behavior>
    <behavior>
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthorization principalPermissionMode="None"/>
      <serviceSecurityAudit auditLogLocation="Application" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" suppressAuditFailure="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

May or may not be important but my WebAPI is on the same server but in a different virtual directory. 可能重要,也可能不重要,但我的WebAPI位于同一服务器上,但位于不同的虚拟目录中。

Thanks in advance. 提前致谢。

Turns out nothing was wrong with it. 原来没有错。 The error was caused by the firewall which was preventing the server from talking to itself through the external address. 该错误是由防火墙引起的,防火墙阻止了服务器通过外部地址与其自身进行通信。 Added a hostsfile entry to get around that. 添加了一个hostsfile条目来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM