开发者

.Net 4.0 WCF with Membership services

having an unexplained issue.开发者_运维知识库.

Upgraded a working .Net 3.5 WCF service to 4.0 and immediately experienced this error:

"The message with Action 'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)."

The service is using wsHttpBinding using TransportWithMessageCredential, Message ClientCredentials=UserName; so it is using SSL for message encryption security and Membership services for user authentication. We need tthis configuration because our business partners will be accessing this from out on the public internet. The binding reported by the service is :

  <wsHttpBinding>
     <binding name="WSHttpBinding_IManageSCACFI" 
          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="TransportWithMessageCredential">
              <transport clientCredentialType="None" 
                  proxyCredentialType="None" realm="" />
              <message clientCredentialType="UserName" 
                  negotiateServiceCredential="true"
                  algorithmSuite="Default" 
                  establishSecurityContext="false" />
          </security>
     </binding>
 </wsHttpBinding>

This is all running in a web application (Virtual Directory in IIS7 on Windows Server 2008. The application pool has been reset to use the 4.0 CLR. The problem occurs even with the simplest service contract method, which simply returns a string.

  1. I know the wcf requests are making it to the server, because we are using a custom Membershiop provider, and I have wired it up to write a log entry when it validates the credentials, and this log entry is being created.
  2. I know it's not in the code cause the entire package works fine on the development box (Windows 7, but also IIS 7,) with the exact same bits and config settings.
  3. If I switch to Securitymode = "Transport", it works, but of course it is then defaulting to windows integrated security, instead of UserName (I don't understand why it is doing this, but it is, the membership services process is not getting hit.)
  4. We have completely rebuilt the entire web site and web application from scratch on the server and are still experiencing the same issue.
  5. The error message above is also what is reported in the WCF diagnostics trace log, and there is no more detailed information there to help with either.

We have been pounding away at this with no success for a while.. Has anyone else experienced this issue?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜