WCF安全处理器无法在消息中找到安全标头

时间:2011-09-06 09:45:41

标签: c# wcf security .net-4.0 certificate

首先,我是一名WCF新手,所以很有可能我做的事非常微不足道。无论如何,我目前正处于开发WCF服务的过程中,该服务使用wsHttpBinding进行通信,以及clientCredentialType用户名。

WCF指示使用凭证来加密通信(我已将其设置为“快速和脏”,因为我还没有生产证书。)。

当我直接从visual studio开发或测试服务时,地址变得类似http://localhost:123223/Checks.svc,一切正常,如果我将确切的项目部署到我的开发机器上的网站,我会发生以下异常:

  

从另一方收到了不安全或不正确安全的故障   派对。请参阅内部FaultException以获取故障代码和详细信息。

使用以下stacktrace:

  

服务器堆栈跟踪:at   System.ServiceModel.Channels.SecurityChannelFactory 1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory 1.SecurityRequestChannel.Request(消息   消息,TimeSpan超时)at   System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation   operation,EndpointAddress目标,Uri via,SecurityToken   currentToken,TimeSpan超时)at   System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(时间跨度   超时)at   System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(时间跨度   超时)at   System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(时间跨度   超时)at   System.ServiceModel.Channels.CommunicationObject.Open(时间跨度   超时)at   System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
  在System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan   超时)at   System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel   频道,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(时间跨度   超时,CallOnceManager级联)at   System.ServiceModel.Channels.ServiceChannel.EnsureOpened(时间跨度   System.ServiceModel.Channels.ServiceChannel.Call(String。)   action,Boolean oneway,ProxyOperationRuntime操作,Object [] ins,   对象[]出局,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage   methodCall,ProxyOperationRuntime operation)at   System.ServiceModel.Channels.ServiceChannelProxy.Invoke(即时聊天   消息)

     

在[0]处重新抛出异常:at   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(即时聊天   reqMsg,IMessage retMsg)at   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&安培;   msgData,Int32类型)at   TestCreditExchangeWCFServices.CreditExchange.WCF.Services.IChecks.CreditCheck(CreditCheck被   creditCheck1)at   TestCreditExchangeWCFServices.CreditExchange.WCF.Services.ChecksClient.CreditCheck(CreditCheck被   creditCheck1)in   d:\项目\ TEMP \ TestCreditExchangeWCFServices \ TestCreditExchangeWCFServices \服务   参考文献\ CreditExchange.WCF.Services \ Reference.cs:第1793行   TestCreditExchangeWCFServices.MainWindow.btnLite_Click(Object sender,   RoutedEventArgs e)in   d:\项目\ TEMP \ TestCreditExchangeWCFServices \ TestCreditExchangeWCFServices \ MainWindow.xaml.cs:行   39

服务器配置:

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="HttpBinding">
          <security mode="Message">
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="CreditExchange.WCF.Services.Checks">
        <endpoint address="" binding="wsHttpBinding"
          bindingConfiguration="HttpBinding" contract="CreditExchange.WCF.Services.IChecks">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding"  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <!--<serviceDebug includeExceptionDetailInFaults="true" />-->
          <serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="NHibernateRoleProvider" />
          <serviceCredentials>
            <serviceCertificate findValue="localhost" x509FindType="FindBySubjectName"
                              storeLocation="LocalMachine" storeName="My" />
            <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"
              membershipProviderName="CredentialsProvider" />
          </serviceCredentials>
          <errorHandler />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <extensions>
      <behaviorExtensions>
        <add name="errorHandler"
              type="Common.Library.WCF.Exceptions.UnhandledExceptionHandlerExtension, Common.Library" />
      </behaviorExtensions>
    </extensions>
  </system.serviceModel>

客户端配置:

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IChecks" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" negotiateServiceCredential="true"
                algorithmSuite="Default" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <!--<endpoint address="http://localhost:52744/Checks.svc" behaviorConfiguration="ClientBehavior" binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IChecks" contract="CreditExchange.WCF.Services.IChecks"
          name="WSHttpBinding_IChecks">-->
      <endpoint address="http://localhost/CreditExchange.WCF.Services/Checks.svc" behaviorConfiguration="ClientBehavior" binding="wsHttpBinding"
        bindingConfiguration="WSHttpBinding_IChecks" contract="CreditExchange.WCF.Services.IChecks"
        name="WSHttpBinding_IChecks">
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
    </client>
    <behaviors>
      <!-- Needed because otherwise we get errors because the Cert chain can not be verified -->
      <endpointBehaviors>
        <behavior name="ClientBehavior">
          <clientCredentials>
            <serviceCertificate>
              <authentication certificateValidationMode="None" />
            </serviceCertificate>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

我用谷歌搜索它,我已经看到提到时间戳问题导致这个问题,但我根本不明白如何在完全相同的机器上运行在VS调试环境中运行良好,但发布抛出一个错误,我无法绕过我的脑袋。

我在客户端启用了跟踪,显示以下异常(对我来说没有意义):

Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties.   This can occur if the service is configured for security and the client is not using security.

我跟踪了两条消息,一条是成功的(在我的调试版本上),一条是失败的,我正在看差异,我唯一能看到的是Via标签(由于某种原因,一条针对我的FQDN ,而不是localhost)和AppDomain是不同的(这是有道理的)

Succesfull:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>262163</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2011-09-06T10:04:03.6960710Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{1a2bd6e0-c785-468b-95ea-d8b464abec94}" />
<Execution ProcessName="WebDev.WebServer40" ProcessID="2792" ThreadID="31" />
<Channel />
<Computer>PC-FOLKERT</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
<TraceIdentifier>http://msdn.microsoft.com/nl-NL/library/System.ServiceModel.Channels.MessageReceived.aspx</TraceIdentifier>
<Description>Received a message over a channel.</Description>
<AppDomain>f67db61a-2-129597770339060921</AppDomain>
<Source>System.ServiceModel.Activation.HostedHttpContext+HostedHttpInput/64865147</Source>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTransmitTraceRecord">
<MessageProperties>
<Encoder>application/soap+xml; charset=utf-8</Encoder>
<AllowOutputBatching>False</AllowOutputBatching>
<Via>http://localhost:52744/Checks.svc</Via>
</MessageProperties>
<MessageHeaders>
<a:Action s:mustUnderstand="1" u:Id="_4" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</a:Action>
<a:MessageID u:Id="_5" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:a="http://www.w3.org/2005/08/addressing">urn:uuid:7117ff27-a64b-4b86-9f80-127225fd3e44</a:MessageID>
<ActivityId CorrelationId="4878f073-6eed-4f48-a8a1-bc792112cfd8" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId>
<a:ReplyTo u:Id="_6" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:a="http://www.w3.org/2005/08/addressing">
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1" u:Id="_7" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">http://localhost:52744/Checks.svc</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<u:Timestamp u:Id="uuid-54189139-4404-4f93-a197-4438ab5f3fde-5" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<u:Created>2011-09-06T10:04:03.580Z</u:Created>
<u:Expires>2011-09-06T10:09:03.580Z</u:Expires>
</u:Timestamp>
<c:SecurityContextToken u:Id="uuid-c4807903-c4a0-4ef0-9712-bd05f8788780-1" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<c:Identifier>urn:uuid:e3f5c663-9b49-45b6-8774-5292da16ca2e</c:Identifier>
</c:SecurityContextToken>
<c:DerivedKeyToken u:Id="_0" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI="#uuid-c4807903-c4a0-4ef0-9712-bd05f8788780-1"></o:Reference>
</o:SecurityTokenReference>
<c:Offset>0</c:Offset>
<c:Length>24</c:Length>
<c:Nonce>
<!-- Removed-->
</c:Nonce>
</c:DerivedKeyToken>
<c:DerivedKeyToken u:Id="_1" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI="#uuid-c4807903-c4a0-4ef0-9712-bd05f8788780-1"></o:Reference>
</o:SecurityTokenReference>
<c:Nonce>
<!-- Removed-->
</c:Nonce>
</c:DerivedKeyToken>
<e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:DataReference URI="#_3"></e:DataReference>
<e:DataReference URI="#_8"></e:DataReference>
<e:DataReference URI="#_9"></e:DataReference>
</e:ReferenceList>
<e:EncryptedData Id="_9" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></e:EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#_1"></o:Reference>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>T9HGceq5Weq5n5Cygk/YzOb9JRFrJVGLdgB+Bf2cDcwue6/Wf5HUg0Krl35/e05wtuwTwNNCH4Q9a8e8+J9+L68tYVijYKwlxJZBIEHLx2XCCKqbve6DWc3VYmaX8mNqDXtKC8cfAtW1O5oH8m/6lCnuN+sZoQDgYh97S5f7AusJdT+eTb9OFarhH5HwiupUjERpnYWAXWoSUgjjCKxIp0iD+MpRGCGA2/7xt+WvfDgX2B/c1DvzuWwx+Kwv7HiXeHS6ZVfnTTYZO3e4GTq7TDYtMThLvw3hGOkK5nb/IDOlGLqWEBk4tzdKgIn7FGssOdhohXyYIAj7x3wzyEirg+HRLg7OO/rtrG0jw/jLdIzs627Hypdbrm9mckAdtxFbh/5p3/CYmGuTr/2ck4EW/a5AM8nkn6J1QT4Cp14Ckr4ZjbvivMKAwGtTcmaJQm6h053b6KOW2lGxO3z+kOjYrE94K993hLvjFfK99LRM1yyApCQyRNMEaKJWNaONmpfdSEAcfrpx+bp0+Fohm1D+8AyYL0m4+tSign7btWZFwU5y8P7ggVQuGrJ0ew0EpDscurFL9FOfZf4H6+qidH305o4CkY0BZanwb6kDhLzxA/0=</e:CipherValue>
</e:CipherData>
</e:EncryptedData>
<e:EncryptedData Id="_8" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></e:EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#_1"></o:Reference>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>Nni+QmkTzz7sQ56j3vkzS9v19wYLTCtqQrAMOk07fzCCYG31rUfGKzH9bBF8Fmjc/cdmeNRa7YonvNRusaDzPaZgyzWQharZh6uf4EqgwizId8Xk67e1SIVHqSfb8KXtijivi0z94B+cp21wRNomV4h4EEFNJvTlLzNen3GKXwz87cDYUdDhNTEvQOFLU8a1gd2L06WoQ3IaUngpRI3ffg5WKPKZ5b2O+zIK+jy0ol0MqkyO2c43XzwQLBpJEY489pmUazdSERd6nmndV7FtZfE87ECCApcaNxfAxCHwCndkhQBK6bVA+imO67lA1nuXNL41P3meUH78HX7vSw6ujXxKOoJoqd339G5CDXqvXxGz/UkoOCLWl5j17RqxTApC8f9oMavXTFGqgHjeIsPycmv58yJB10il9mx+j7wNUaj10llExNUU++Y1uVhDwHZ2LQ2bAPXmsZPZ4EDTWz5XFifH2POtN7OmUUrsDpyXyvn/DdAhfn+q4GK9fJuEcc/Co3VQ7rlSib1if8XKjlo8fqrAlh5uFRZirlIrXvVXVt2FVP/bAmfFxKrYTxvpkCJE7EEwjeT4h6PE8GJL0Vujme4ipDuEWzjuZ7y00G29qUbUX2ErN84xLUQPg41oq1LgxKeF3RCOvVer+QtekDWjxPb1rzfN9JJoOHXmx4UOWzmpuYJr8Y6sWUE3aYZEcNBfYvOZ/MSMciv+5nVdP0i9q++2ej3Pu4iSgSadfYX5JsVaZBVx3YWFa/O1C23Zzpp39KJ39ag2vjghX+ywrU5bqoR6OsbpAE2jLD4rq3gvxT25hvDz12UEpjshcXJavToKH2eEMlZ8/xl2OoPe05374AA+3NqwyyWndo4RS3k3ahSFQbBYC8OqQUAIEdMgwxbxzCho6wcifGPKfldOhxiXEkuMUNSTJdEpES7NLRwoWP1h8Qmdrq2BNWrJOcOMqV2u8gS6UBN16uMSCevW/x1IwvA4opWrX9xFTAKTSf5tsWZwf6LsK3/PSXk+rd2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Security>
</MessageHeaders>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

失败:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>262163</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2011-09-06T10:38:36.3276859Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{fba8e1c9-a9f9-491e-814a-e1b513188bcc}" />
<Execution ProcessName="w3wp" ProcessID="1896" ThreadID="13" />
<Channel />
<Computer>PC-FOLKERT</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
<TraceIdentifier>http://msdn.microsoft.com/nl-NL/library/System.ServiceModel.Channels.MessageReceived.aspx</TraceIdentifier>
<Description>Received a message over a channel.</Description>
<AppDomain>/LM/W3SVC/1/ROOT/CreditExchange.WCF.Services-3-129597790759646859</AppDomain>
<Source>System.ServiceModel.Activation.HostedHttpContext+HostedHttpInput/3683710</Source>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTransmitTraceRecord">
<MessageProperties>
<Encoder>application/soap+xml; charset=utf-8</Encoder>
<AllowOutputBatching>False</AllowOutputBatching>
<Via>http://pc-folkert.domain.local/CreditExchange.WCF.Services/Checks.svc</Via>
</MessageProperties>
<MessageHeaders>
<a:Action s:mustUnderstand="1" u:Id="_4" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</a:Action>
<a:MessageID u:Id="_5" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:a="http://www.w3.org/2005/08/addressing">urn:uuid:3352b0d1-a569-4d59-a377-82730c5d07f2</a:MessageID>
<ActivityId CorrelationId="dfd3e02f-53ef-4b33-a5a4-43bb5bf71245" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId>
<a:ReplyTo u:Id="_6" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:a="http://www.w3.org/2005/08/addressing">
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1" u:Id="_7" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">http://localhost/CreditExchange.WCF.Services/Checks.svc</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<u:Timestamp u:Id="uuid-6f05a6c6-cffa-492e-ae65-4e02b33a0ef1-5" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<u:Created>2011-09-06T10:38:36.249Z</u:Created>
<u:Expires>2011-09-06T10:43:36.249Z</u:Expires>
</u:Timestamp>
<c:SecurityContextToken u:Id="uuid-63efd986-fc21-47db-84eb-735045c57539-2" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<c:Identifier>urn:uuid:67a5014b-b3e0-4f91-a730-60a2a36d3cbe</c:Identifier>
</c:SecurityContextToken>
<c:DerivedKeyToken u:Id="_0" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI="#uuid-63efd986-fc21-47db-84eb-735045c57539-2"></o:Reference>
</o:SecurityTokenReference>
<c:Offset>0</c:Offset>
<c:Length>24</c:Length>
<c:Nonce>
<!-- Removed-->
</c:Nonce>
</c:DerivedKeyToken>
<c:DerivedKeyToken u:Id="_1" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" URI="#uuid-63efd986-fc21-47db-84eb-735045c57539-2"></o:Reference>
</o:SecurityTokenReference>
<c:Nonce>
<!-- Removed-->
</c:Nonce>
</c:DerivedKeyToken>
<e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:DataReference URI="#_3"></e:DataReference>
<e:DataReference URI="#_8"></e:DataReference>
<e:DataReference URI="#_9"></e:DataReference>
</e:ReferenceList>
<e:EncryptedData Id="_9" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></e:EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#_1"></o:Reference>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>HS9eENPLD7iILYw/0a8IVNQZ/Q30RxnLDPUTTSW1C33ZYnyLG6+c6mzT5T4eooh9Fn5YatOacyM/y33rHkf3S+kmbQ5PMTQ7KIQZQMO/6YfQ4hQI+a5WrTmPIHuYLaSDHB6M4lVOyzJbP4JDSrg8hVTWPBHOo1pQ8MP5MbsScvhYk+UofBqMo2WdyZL3JIxiAXvnbkcab3dnKl2AFqpBnImCAORb2zFP5rNB78epggMa03Uj2vYxJZbLVaDFh/kTuc7Ud9tx5xtLSoyJiBU4AlwqNbI4gKR8+BvbEPnVc9NKTQa98mi10Goyb/oxGPJadVLHS3L8zuH4TH/v0T0gxI8JGR+Ng7JMHADlLGh2W31S8k0UznwrJ2l0DFC86LUMno1k7/EJrXNJuu/GuJjPaspjTM0O1nEvAKmvHAgyt0JAD2NV0W7GnU4/G8JkH5/P8YYHEBy0lsDo+6ejoZ5upYChI5Y1ZsGHa0eLNvP7jYMKTFraF1LLe3quMFQXG7rOWovaXvUleHbzfEqR90GBTATzwpr2WaXJYgiZ8CWu3KJYcR/G6O8EFPsDveVYUHJ+yI2IbecH6uHnABbNWDua5VYJC4jPdJtuEHjA/+iwjKI=</e:CipherValue>
</e:CipherData>
</e:EncryptedData>
<e:EncryptedData Id="_8" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></e:EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<o:SecurityTokenReference>
<o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#_1"></o:Reference>
</o:SecurityTokenReference>
</KeyInfo>
<e:CipherData>
<e:CipherValue>WT8Qk0NYcBfVQPDfAdpdTXGdDKI3WtnfpkbeBxmFLVeyUsbvi3VCF95bLO2gx+vm+2VukWEWcJ5XA3zuVqyRQP3fNq4PK5sA8MMnqKtm762Z7SB0MjbS1bp5yaJEA+h/3cUwpIqnms2Unf5AbfMBQmp9mrHpcA/FqCs6gV2phu4AzSgzkDbmm9vtNllq+XjDDDQ7AO7BxOzfeH0Wjb5E4TBykaZ4G/RXpxQqxRRZR3uUtYKw+Nr85fe2ejfzXrhHDYDNarU/J6l2iJBGk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ddmcVN+Qyys3tOiOoMsguFl/e/8fsFJ2+RC+ycDDNvQ9vZvLSANq1ITwaIGrgr0dQaduY+dREmQqZ+IrAn4eERMTdbnHSXCFwiVjAdqqbLXvaoDnZFsOG1ImyPHy4DfNwD35GObupKCR9ZSoz65MvRzKfK8FGCoC68s0PCbJ3SfP5TpKcGnslqTwXowLXTmbj2FvsPyNNZ6WIRWtbyC7ZDpaU6Z3rRkEFC9Tl+NUlJ1lDvPCKrk+oB4lH3YuI3pNaquXMKnQWHWDajrmOLD8OIvCSLXpNJjsmddhjAzljcbujDuqsO6eK+WO/jH113HYmQjeVlR3HsGNYBUL6YyqFjGnKTCxDDPvhZfCL0LlfhseQRoihi7J0gc3TyaSYoTdX1vT1q10sj4NUX/1OtxH53sQEDzXsSot8bZTdEcXb4zqGq7iX2TDUkUlN4I1L+3DYqs1FULw+++iA0xe6Vx/myhc13aaPCBNwmsli2ZqVKnl6r4ZSLeczHcmwYNjg1roEQU+oMg84es86GoF454tEyBsJiICf9OaRwCqJZgVi/2LncZSlWM/lJ8K8NAD07rMiqZMASpRjP9XABzG1O4Js1GAa4JBVWg7zTJ2qmBzLAG2AS+0h2TJe1TqjVfSffAT5a/XkVjchk9eMVPkGvnPqgDu9ntYteG81poWS65rPB+K4Y3GK</e:CipherValue>
</e:CipherData>
</e:EncryptedData>
</o:Security>
</MessageHeaders>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

1 个答案:

答案 0 :(得分:1)

所以......好吧......我感到惭愧......

基本上在请求失败后我会打开跟踪日志并收到消息文件没有正确关闭。由于某种原因,服务不会像我预期的那样快速写入。午餐后我没有注意到这一点(这有助于我退后一步)。我在“未正确关闭”消息时向右滚动并注意到它显示异常。

这引发了我,因为到目前为止我只在日志中看到了警告。所以我在Notepad ++中打开了文件并阅读了一段时间以来我见过的最愚蠢的异常。它缺少一个程序集......(确切地说是NHibernate程序集之一)。

可悲的是,当我从VS2010发布它并没有发布这些程序集时,为什么完全超出我...我只是浪费了两个多小时的生命,因为它没有发布它放在调试盒上的文件...结合我没有正确地查看这些日志文件真的没有让我的一天。

顺便提出安全错误的原因是我们使用了一个使用NHibernate来验证基于用户的成员资格提供程序...

正如我经常遇到的情况一样,我花了很多时间解决一个容易修复的问题,这给我的脸颊带来了红色......感谢至少Ladislav的帮助!