[英]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.