简体   繁体   English

WCF中的'System.ServiceModel.Security.MessageSecurityException'

[英]'System.ServiceModel.Security.MessageSecurityException' in WCF

I have WCF client with the following config. 我有带有以下配置的WCF客户端。

 <system.serviceModel> <bindings> <basicHttpBinding> <binding name="MyService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://myservername/MyGreatServices/MyService.svc" binding="basicHttpBinding" bindingConfiguration="MyService" contract="XXX.Ixxx" name="MyService" /> </client> </system.serviceModel> 

but when trying to run application getting an error: 但是当尝试运行应用程序时出现错误:

An exception of type 'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dll but was not handled in user code Additional information: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. mscorlib.dll中发生类型'System.ServiceModel.Security.MessageSecurityException'的异常,但未在用户代码中处理。其他信息:HTTP请求未经客户端身份验证方案'Negotiate'的授权。 The authentication header received from the server was 'Negotiate oXoweKADCgEBonEEb2BtBgkqhkiG9xIBAgIDAH5eMFygAwIBBaEDAgEepBEYDzIwMTYwMTEyMjAwNDAwWqUFAgMH13imAwIBKakUGxJVUy5LV09STEQuS1BNRy5DT02qGzAZoAMCAQGhEjAQGw51c21kY2tkYXAxMDg3JA=='. 从服务器接收到的认证标头是“协商oXoweKADCgEBonEEb2BtBgkqhkiG9xIBAgIDAH5eMFygAwIBBaEDAgEepBEYDzIwMTYwMTEyMjAwNDAwWqUFAgMH13imAwIBKakUGxJVUy5LV09STEQuS1BNRy5DT02qGzAZoAMCAQGhEjAQGw51c21kY2tkYXAxMDg3JA ==”。

On the IIS both Anonimous and Windows authentication are enabled 在IIS上,同时启用了Anonimous和Windows身份验证

change 更改

<transport clientCredentialType="Windows" />

to

<transport clientCredentialType="Ntlm" />

暂无
暂无

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

相关问题 我有这个错误 System.ServiceModel.Security.MessageSecurityException - I have this error System.ServiceModel.Security.MessageSecurityException 访问Dynamics365时发生错误“ Microsoft.Xrm.Sdk.dll中发生System.ServiceModel.Security.MessageSecurityException” - An error “System.ServiceModel.Security.MessageSecurityException' occurred in Microsoft.Xrm.Sdk.dll” occurs when accessing Dynamics365 WCF错误:System.ServiceModel.AddressAccessDeniedException: - WCF Error: System.ServiceModel.AddressAccessDeniedException: 如何解决WCF中的System.ServiceModel.ServerTooBusyException? - How to solve System.ServiceModel.ServerTooBusyException in WCF? 使用服务时,C#.NET 4.0 WCF MessageSecurityException,“安全标头为空。” - C# .NET 4.0 WCF MessageSecurityException, “Security header is empty.” when consuming a service 'System.ServiceModel.Diagnostics.TraceUtility'在WCF中引发了异常 - 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception in WCF 部署WCF客户端时出错 - 在SQL Catalog中找不到&#39;system.servicemodel&#39; - Error deploying WCF Client - 'system.servicemodel was not found in SQL Catalog' 如何在System.ServiceModel.ChannelFactory中优化WCF CreateFactory? - How to optimize WCF CreateFactory in System.ServiceModel.ChannelFactory? 自承载WCF和System.ServiceModel.FaultException - Self-Hosting WCF and System.ServiceModel.FaultException 尝试通过WCF传递位图时出现“ System.ServiceModel.CommunicationException” - “System.ServiceModel.CommunicationException” when trying to pass a bitmap through WCF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM