问题描述
我有WCF服务和客户端.创建WCF代理并调用所有操作约定,但返回一个返回数据集的操作,我没有任何问题.数据集是相当大的对象,最初它给出了错误响应错误,然后我通过将maxBufferPoolSize更改为``50000000''来解决了该问题.而不是默认值(我将与大小有关的所有内容都更改为"50000000").但是现在当我调用此特定方法时,它给出了以下错误
System.ServiceModel.Security.MessageSecurityException:签名验证失败.请参阅内部异常以获取故障详细信息. ---> System.Security.Cryptography.CryptographicException:在System.IdentityModel.Reference.EnsureDigestValidityIfIdMatches(String id,Object resolveXmlSource)
的引用'#_0'的摘要验证失败.IdentityModel.StandardSignedInfo.EnsureDigestValidityIfIdMatches(String id,Object resolveXmlSource)
在System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfosignedInfo,String id,XmlDictionaryReader readers Checks,Boolean MessageParters br/>--内部异常堆栈跟踪的结尾---
Hi,
I have a WCF service and client. I have no issues in creating the WCF proxy and calling all the operation contract but to one operation which returns a DataSet. The dataset is fairly large object, initially it gave Bad Response error and i resolved it by changing the maxBufferPoolSize to "50000000" instead of the default value( i changed all the stuff related to size to "50000000"). But now when i call this particular method it gives the following error
System.ServiceModel.Security.MessageSecurityException: The signature verification failed. Please see inner exception for fault details. ---> System.Security.Cryptography.CryptographicException: Digest verification failed for Reference '#_0'.
at System.IdentityModel.Reference.EnsureDigestValidityIfIdMatches(String id, Object resolvedXmlSource)
at System.IdentityModel.StandardSignedInfo.EnsureDigestValidityIfIdMatches(String id, Object resolvedXmlSource)
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfo signedInfo, String id, XmlDictionaryReader reader, Boolean doSoapAttributeChecks, MessagePartSpecification signatureParts, MessageHeaderInfo info, Boolean checkForTokensAtHeaders)
--- End of inner exception stack trace ---
服务器堆栈跟踪:
位于System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfosignedInfo,字符串id,XmlDictionaryReader阅读器,布尔值doSoapAttributeChecks,MessagePartSpecification signatureParts,MessageHeaderInfo info,布尔值CheckForTokensAtHeaders处的布尔值). ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.ExecuteMessageProtectionPass(Boolean hasAtLeastOneSupportingTokenExpectedToBeSigned)
在System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout)
在System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader; ,位于System.ServiceModel.Security.InitiatorSessionSymmetricMessageSecurityProtocol.VerifyIncomingMessageCore(Message& message,String actor,TimeSpan超时)处的SecurityToken必需SigningToken,TimeSpan超时,SecurityProtocolCorrelationState []相关状态) ,位于System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message&在System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.VerifyIncomingMessage(Message&消息,TimeSpan超时,SecurityProtocolCorrelationState相关状态)
在System.ServiceModel.Security处的消息,TimeSpan超时,SecurityProtocolCorrelationState []相关状态)
SecuritySessionClientSettings`1.ClientSecuritySessionChannel.ProcessIncomingMessage(消息,TimeSpan超时,SecurityProtocolCorrelationState相关状态,MessageFault和protocolFault)位于System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(消息答复,TimeSpan超时,SecurityProtocolCorlation) br/>在System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(消息,TimeSpan超时)
在System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息,TimeSpan超时)在
系统. ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,Object [] outs,TimeSpan timeout)
在System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway ,ProxyOperationRuntime操作,在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)中的Object [] ins,Object [] outs)
在System.ServiceModel.Channels.ServiceChannelProxy.Invoke( IMessage消息)
Server stack trace:
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfo signedInfo, String id, XmlDictionaryReader reader, Boolean doSoapAttributeChecks, MessagePartSpecification signatureParts, MessageHeaderInfo info, Boolean checkForTokensAtHeaders)
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.ExecuteMessageProtectionPass(Boolean hasAtLeastOneSupportingTokenExpectedToBeSigned)
at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout)
at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.InitiatorSessionSymmetricMessageSecurityProtocol.VerifyIncomingMessageCore(Message& message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.ProcessIncomingMessage(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState, MessageFault& protocolFault)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
在[0]处抛出异常:在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(在Honeywell.PSOS.Data.Provider.WCFPSOSDAService.IDAService.GetUpdatedData(Object& SpecialMessage,String serverName,String hostName)的MessageData&msgData,Int32类型)
在Honeywell.PSOS.Data.Provider.WCFPSOSDAService D中的.DAServiceClient.GetUpdatedData(Object& SpecialMessage,字符串serverName,字符串主机名):D:\ cc_view \ E311367_Remote_view_R400 \ Prod_URT \ ProfitSuite操作员站\ DataAccess \ Honeywell.PSOS.Data.Provider \ Service References \ WCFPSOSDAService \ Reference.cs:第128行
在Honeywell.PSOS.Data.Provider.WebSubscriptionManager.GetData(Boolean bFullData)
我找不到,谷歌或任何地方的任何解决方案.请让我知道如何解决此问题.预先感谢
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Honeywell.PSOS.Data.Provider.WCFPSOSDAService.IDAService.GetUpdatedData(Object& specialMessage, String serverName, String hostName)
at Honeywell.PSOS.Data.Provider.WCFPSOSDAService.DAServiceClient.GetUpdatedData(Object& specialMessage, String serverName, String hostName) in D:\cc_view\E311367_Remote_view_R400\Prod_URT\ProfitSuite Operator Station\DataAccess\Honeywell.PSOS.Data.Provider\Service References\WCFPSOSDAService\Reference.cs:line 128
at Honeywell.PSOS.Data.Provider.WebSubscriptionManager.GetData(Boolean bFullData)
I could not able to find, any solution in google or any where. Please let me know how to resolve this. Thanks in advance
This is my web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<system.serviceModel>
<services>
<service behaviorConfiguration="Honeywell.PSOS.Data.WCFDAService.Service1Behavior"
name="Honeywell.PSOS.Data.WCFDAService.DAService">
<endpoint address="" binding="wsHttpBinding" contract="Honeywell.PSOS.Data.WCFDAService.IDAService" bindingConfiguration="endPointBehave" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Honeywell.PSOS.Data.WCFDAService.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="endPointBehave" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000" maxArrayLength="50000000"
maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
This is my app.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IDAService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000" maxArrayLength="50000000"
maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://ie11ltj2sts1s.global.ds.honeywell.com/PSOSWCFDA/DAService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IDAService" contract="WCFPSOSDAService.IDAService"
name="WSHttpBinding_IDAService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
推荐答案
这篇关于摘要验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!