我们的客户端尝试通过HTTPS请求调用Web服务时出现错误提示。
''没有端点在https://XXXXXX/XXXX.svc处侦听-远程服务器返回错误:(403)禁止。'
但是有趣的是,客户端使用先前版本使用的端口成功连接。但是新端口不起作用。这意味着客户端仍然可以使用旧端口调用新服务。但是,一旦我们将绑定更改为新的https端口,客户端就会越过错误。
以下检查已经完成。
1)客户端可以从其服务器成功访问URL。2)没有为新创建的端口设置防火墙规则。2)SSL根证书位于“受信任的根证书”文件夹中。
请告诉我您是否对此问题有任何想法?
谢谢
根据您的描述,您似乎可能错过了wcf应用程序web.config文件中的https设置。
以下是使用HTTP的WCF服务的web.config文件的完整示例。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="MySecureWCFService.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="MySecureWCFService.IService1"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata 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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
更多详细信息,您可以参考此article。