[英]WCF Configuration Error: There was no endpoint listening at
我试图从WebAPI使用WCF服务(我没有写过),并且得到了可怕的“没有端点在监听...”错误。 有趣的是,该服务具有一个测试ASPX页面,该页面使用该页面时不会出错。 因此,我复制了配置的客户端部分,并将其添加到我的API中。
客户:
<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>
服务器:
<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>
可能重要,也可能不重要,但我的WebAPI位于同一服务器上,但位于不同的虚拟目录中。
提前致谢。
原来没有错。 该错误是由防火墙引起的,防火墙阻止了服务器通过外部地址与其自身进行通信。 添加了一个hostsfile条目来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.