【发布时间】:2013-06-19 19:17:17
【问题描述】:
以下是WCF的web.config中serviceModel的配置方式:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpWithSecure">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"></transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="CMA.Customers">
<endpoint name="basic" binding="basicHttpBinding" contract="CMA.Customers" bindingConfiguration="basicHttpWithSecure"></endpoint>
</service>
</services>
<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>
此服务部署在 IIS 上,我可以使用 url 访问它 - https://www.companyname.co.uk/sitename/wcfservicename/service.svc 此 WCF 在 IIS 中的身份验证设置为“匿名”和“基本”。
现在我在同一个站点上部署了一个 MVC 应用程序,我想指向该 MVC 站点来使用这个 WCF。如何在我的 MVC 站点的 web.config 中配置它?
或者您认为需要对 WCF 的配置进行任何更改才能使其成为可能?
【问题讨论】:
标签: wcf https web-config basichttpbinding