简体   繁体   English

WCF服务-basicHttpBinding配置中的运行时错误将clientCredentialType传输到Basic

[英]WCF service - Getting Runtime error in basicHttpBinding configuration transport clientCredentialType to Basic

I have created a web service and I am using basicHttpBinding but the thing is when I set the clientCredentialType to None I can able to access the service but if I set to Basic/Windows I am getting error like "Runtime error".In IIS basic authentication is used. 我已经创建了一个Web服务,并且正在使用basicHttpBinding,但问题是,当我将clientCredentialType设置为None时,我可以访问该服务,但是如果设置为Basic / Windows,则会收到类似“运行时错误”的错误。在IIS basic中使用身份验证。 I need security for basicHttpbinding. 我需要basicHttpbinding的安全性。 How to resolve this issue. 如何解决这个问题。

Code in Web.Config: Web.Config中的代码:

<services>
      <service name="HealthCareService" behaviorConfiguration="Behavior_Service1">
        <endpoint address="" contract="IHealthCareService" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding1"  />
<endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"/>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding1">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Behavior_Service1">
          <serviceThrottling maxConcurrentSessions="10000"/>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

Error Screen shot: 错误屏幕截图: 在此处输入图片说明

Enable tracing on the WCF server as described in this MSDN article . 如本MSDN文章中所述,在 WCF服务器上启用跟踪。 The trace should give you enough info to troubleshoot the problem. 跟踪应该为您提供足够的信息来解决问题。

If it works with clientCredentialType = None, perhaps your client is not configured correctly - the configuration of client and server need to be compatible. 如果与clientCredentialType = None一起使用,则可能是您的客户端配置不正确-客户端和服务器的配置必须兼容。

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

相关问题 通过传输安全性使用Https basicHttpBinding获取404无端点侦听错误WCF 4.0 - Getting 404 no endpoint listening error WCF 4.0 using Https basicHttpBinding over Transport security Windows Phone Silverlight 8.0-在BasicHttpBinding上将ClientCredentialType指定为Basic - Windows Phone Silverlight 8.0 - Specify ClientCredentialType to Basic on BasicHttpBinding WCF服务的basicHttpBinding上的HTTPS - HTTPS on basicHttpBinding for WCF Service 具有 basicHttpBinding、传输安全性和基本客户端凭据类型的自定义 WCF 凭据验证器 - Custom WCF credential validator with basicHttpBinding, Transport security, and Basic client credential type 如何将WCF用户名clientCredentialType传递给其他服务? - How to pass WCF UserName clientCredentialType to other service? WCF basicHttpBinding配置被忽略 - WCF basicHttpBinding configuration is being ignored 使用BasicHttpBinding进行身份验证的WCF服务 - WCF service with authentication using BasicHttpBinding WCF服务maxReceivedMessageSize basicHttpBinding问题 - WCF service maxReceivedMessageSize basicHttpBinding issue 基本身份验证和 WCF REST 服务配置问题 - Trouble with Basic Authentication and WCF REST Service Configuration 在运行时动态更新 WCF 路由服务配置 - Dynamically update WCF Routing Service configuration at runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM