none
若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时 这个问题是什么 RRS feed

  • 问题

  • 无法处理消息。这很可能是因为操作“http://tempuri.org/ICardServer/GetCardByCardNO”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。
    2010年7月1日 8:46

答案

  • 无法处理消息。这很可能是因为操作“http://tempuri.org/ICardServer/GetCardByCardNO”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。


    你检查一下,客户端和服务端的配置一样吗?提示里说了,你检查下Binding,以及绑定里的安全设置。

    按照提示基本就可以解决问题了,不行的话,你把自己的服务端和客户端的配置文件贴出来。


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛


    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Server.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="Server"
            name="SWCard.Contracts.CardServer">
            <endpoint
              address="CardService"
              binding="wsHttpBinding"  bindingConfiguration="MessageAndUserName" contract="SWCard.Contracts.ICardServer">
            </endpoint>

            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8001/"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Server">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceCredentials>
                <serviceCertificate  x509FindType="FindBySubjectName" findValue="FrankWCFServer" storeLocation="CurrentUser"/>
                <clientCertificate >
                  <authentication certificateValidationMode="None" />
                </clientCertificate>
                <userNameAuthentication userNamePasswordValidationMode="Custom"
                                        customUserNamePasswordValidatorType="SWCard.Contracts.Validata,SWCard.Contracts" />
              </serviceCredentials>
            </behavior>

          </serviceBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding  name="MessageAndUserName"   >
              <security  mode="Message">
                <transport clientCredentialType="None"/>
                <message clientCredentialType="UserName"/>
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>

    </configuration>

     

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Client.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial

    Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>


        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_ICardServer" 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" establishSecurityContext="true" />
                        </security>
                    </binding>
                    <binding name="WSHttpBinding_ICardServer1" 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" establishSecurityContext="true" />
                        </security>
                    </binding>

                  <binding name="ClientBinding" 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="None" />
                      <message clientCredentialType ="UserName"/>
                    </security>
                  </binding>
                 
                 
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="SWCard.Contracts.ICardServer"
                    name="WSHttpBinding_ICardServer">
                    <identity>
                        <dns value="FrankWCFServer" />
                    </identity>
                </endpoint>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="CardServer.ICardServer"
                    name="WSHttpBinding_ICardServer1">
                    <identity>
                        <certificate

    encodedValue="AwAAAAEAAAAUAAAAQ0z1XN/SjUnHkgO7hiX1zQLk5YMgAAAAAQAAAAkCAAAwggIFMIIBbqADAgECAhA9owLIY70kn0JbVDlzs+C/MA0GCSqGSIb

    3DQEBBAUAMBkxFzAVBgNVBAMTDkZyYW5rV0NGU2VydmVyMB4XDTEwMDYxMDAwNDcyNVoXDTM5MTIzMTIzNTk1OVowGTEXMBUGA1UEAxMORnJhbmtXQ0ZTZXJ2ZXIw

    gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANhkaiSNH72MqjEiyOs2PDgnf50hkwHaX4Wx5Z4neS6k0P44EFqOgTp9IE53qEYDDpxcvu6fFL5BLuywQh1jvacX4

    3ImCQVLWs0vjrYn1GItNqHwfuGmE/sbw+8BKLN1tVnNtlUcD5mG306U2DucNVSesDOijoTMT/9By0PAo129AgMBAAGjTjBMMEoGA1UdAQRDMEGAEFdkvKEajwWAYd

    mvp2qEMeKhGzAZMRcwFQYDVQQDEw5GcmFua1dDRlNlcnZlcoIQPaMCyGO9JJ9CW1Q5c7PgvzANBgkqhkiG9w0BAQQFAAOBgQBdFwM4zsRYOFbeH7lclRJzZ/Y2NU4

    Smy3qpuqB56wfd0S1uI3m0sHBYLJrw2CM+zN+L0dHzBenTLXEr4XSZ7EUc0A8k2NRoVDEGTgaUjTSB4RH3QyuT164CIL2PvQT9An6Lb4HPsdXF5knIsQSfGJ0nCuv

    vTbyaLtyxigfJdplPw==" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

    这个Binding配置一样,我看了服务和客户端的。

    再出错我就奇怪了


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛

    2010年7月7日 10:06
    版主

全部回复

  • 这个是客户端 服务端 的安全配置不一样照成的吗?
    2010年7月1日 8:57
  • 有可能是客户端与服务端不匹配造成的。建议更新一下Service reference。


    Mog Liang
    2010年7月2日 4:01
  • 无法处理消息。这很可能是因为操作“http://tempuri.org/ICardServer/GetCardByCardNO”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。


    你检查一下,客户端和服务端的配置一样吗?提示里说了,你检查下Binding,以及绑定里的安全设置。

    按照提示基本就可以解决问题了,不行的话,你把自己的服务端和客户端的配置文件贴出来。


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛

    2010年7月5日 1:55
    版主
  • 无法处理消息。这很可能是因为操作“http://tempuri.org/ICardServer/GetCardByCardNO”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。


    你检查一下,客户端和服务端的配置一样吗?提示里说了,你检查下Binding,以及绑定里的安全设置。

    按照提示基本就可以解决问题了,不行的话,你把自己的服务端和客户端的配置文件贴出来。


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛


    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Server.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="Server"
            name="SWCard.Contracts.CardServer">
            <endpoint
              address="CardService"
              binding="wsHttpBinding"  bindingConfiguration="MessageAndUserName" contract="SWCard.Contracts.ICardServer">
            </endpoint>

            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8001/"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Server">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceCredentials>
                <serviceCertificate  x509FindType="FindBySubjectName" findValue="FrankWCFServer" storeLocation="CurrentUser"/>
                <clientCertificate >
                  <authentication certificateValidationMode="None" />
                </clientCertificate>
                <userNameAuthentication userNamePasswordValidationMode="Custom"
                                        customUserNamePasswordValidatorType="SWCard.Contracts.Validata,SWCard.Contracts" />
              </serviceCredentials>
            </behavior>

          </serviceBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding  name="MessageAndUserName"   >
              <security  mode="Message">
                <transport clientCredentialType="None"/>
                <message clientCredentialType="UserName"/>
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>

    </configuration>

     

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Client.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial

    Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>


        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_ICardServer" 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" establishSecurityContext="true" />
                        </security>
                    </binding>
                    <binding name="WSHttpBinding_ICardServer1" 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" establishSecurityContext="true" />
                        </security>
                    </binding>

                  <binding name="ClientBinding" 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="None" />
                      <message clientCredentialType ="UserName"/>
                    </security>
                  </binding>
                 
                 
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="SWCard.Contracts.ICardServer"
                    name="WSHttpBinding_ICardServer">
                    <identity>
                        <dns value="FrankWCFServer" />
                    </identity>
                </endpoint>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="CardServer.ICardServer"
                    name="WSHttpBinding_ICardServer1">
                    <identity>
                        <certificate

    encodedValue="AwAAAAEAAAAUAAAAQ0z1XN/SjUnHkgO7hiX1zQLk5YMgAAAAAQAAAAkCAAAwggIFMIIBbqADAgECAhA9owLIY70kn0JbVDlzs+C/MA0GCSqGSIb

    3DQEBBAUAMBkxFzAVBgNVBAMTDkZyYW5rV0NGU2VydmVyMB4XDTEwMDYxMDAwNDcyNVoXDTM5MTIzMTIzNTk1OVowGTEXMBUGA1UEAxMORnJhbmtXQ0ZTZXJ2ZXIw

    gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANhkaiSNH72MqjEiyOs2PDgnf50hkwHaX4Wx5Z4neS6k0P44EFqOgTp9IE53qEYDDpxcvu6fFL5BLuywQh1jvacX4

    3ImCQVLWs0vjrYn1GItNqHwfuGmE/sbw+8BKLN1tVnNtlUcD5mG306U2DucNVSesDOijoTMT/9By0PAo129AgMBAAGjTjBMMEoGA1UdAQRDMEGAEFdkvKEajwWAYd

    mvp2qEMeKhGzAZMRcwFQYDVQQDEw5GcmFua1dDRlNlcnZlcoIQPaMCyGO9JJ9CW1Q5c7PgvzANBgkqhkiG9w0BAQQFAAOBgQBdFwM4zsRYOFbeH7lclRJzZ/Y2NU4

    Smy3qpuqB56wfd0S1uI3m0sHBYLJrw2CM+zN+L0dHzBenTLXEr4XSZ7EUc0A8k2NRoVDEGTgaUjTSB4RH3QyuT164CIL2PvQT9An6Lb4HPsdXF5knIsQSfGJ0nCuv

    vTbyaLtyxigfJdplPw==" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

    2010年7月7日 9:32
  • 无法处理消息。这很可能是因为操作“http://tempuri.org/ICardServer/GetCardByCardNO”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时。


    你检查一下,客户端和服务端的配置一样吗?提示里说了,你检查下Binding,以及绑定里的安全设置。

    按照提示基本就可以解决问题了,不行的话,你把自己的服务端和客户端的配置文件贴出来。


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛


    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Server.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="Server"
            name="SWCard.Contracts.CardServer">
            <endpoint
              address="CardService"
              binding="wsHttpBinding"  bindingConfiguration="MessageAndUserName" contract="SWCard.Contracts.ICardServer">
            </endpoint>

            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8001/"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Server">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceCredentials>
                <serviceCertificate  x509FindType="FindBySubjectName" findValue="FrankWCFServer" storeLocation="CurrentUser"/>
                <clientCertificate >
                  <authentication certificateValidationMode="None" />
                </clientCertificate>
                <userNameAuthentication userNamePasswordValidationMode="Custom"
                                        customUserNamePasswordValidatorType="SWCard.Contracts.Validata,SWCard.Contracts" />
              </serviceCredentials>
            </behavior>

          </serviceBehaviors>
        </behaviors>
        <bindings>
          <wsHttpBinding>
            <binding  name="MessageAndUserName"   >
              <security  mode="Message">
                <transport clientCredentialType="None"/>
                <message clientCredentialType="UserName"/>
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
      </system.serviceModel>

    </configuration>

     

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="SWCard.Client.Properties.Settings.Setting" connectionString="Data Source=192.168.0.181;Initial

    Catalog=SWCard;Persist Security Info=True;User ID=sa;Password=sa"
                providerName="System.Data.SqlClient" />
        </connectionStrings>


        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_ICardServer" 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" establishSecurityContext="true" />
                        </security>
                    </binding>
                    <binding name="WSHttpBinding_ICardServer1" 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" establishSecurityContext="true" />
                        </security>
                    </binding>

                  <binding name="ClientBinding" 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="None" />
                      <message clientCredentialType ="UserName"/>
                    </security>
                  </binding>
                 
                 
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="SWCard.Contracts.ICardServer"
                    name="WSHttpBinding_ICardServer">
                    <identity>
                        <dns value="FrankWCFServer" />
                    </identity>
                </endpoint>
                <endpoint address="http://localhost:8001/CardService" binding="wsHttpBinding"
                    bindingConfiguration="ClientBinding" contract="CardServer.ICardServer"
                    name="WSHttpBinding_ICardServer1">
                    <identity>
                        <certificate

    encodedValue="AwAAAAEAAAAUAAAAQ0z1XN/SjUnHkgO7hiX1zQLk5YMgAAAAAQAAAAkCAAAwggIFMIIBbqADAgECAhA9owLIY70kn0JbVDlzs+C/MA0GCSqGSIb

    3DQEBBAUAMBkxFzAVBgNVBAMTDkZyYW5rV0NGU2VydmVyMB4XDTEwMDYxMDAwNDcyNVoXDTM5MTIzMTIzNTk1OVowGTEXMBUGA1UEAxMORnJhbmtXQ0ZTZXJ2ZXIw

    gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANhkaiSNH72MqjEiyOs2PDgnf50hkwHaX4Wx5Z4neS6k0P44EFqOgTp9IE53qEYDDpxcvu6fFL5BLuywQh1jvacX4

    3ImCQVLWs0vjrYn1GItNqHwfuGmE/sbw+8BKLN1tVnNtlUcD5mG306U2DucNVSesDOijoTMT/9By0PAo129AgMBAAGjTjBMMEoGA1UdAQRDMEGAEFdkvKEajwWAYd

    mvp2qEMeKhGzAZMRcwFQYDVQQDEw5GcmFua1dDRlNlcnZlcoIQPaMCyGO9JJ9CW1Q5c7PgvzANBgkqhkiG9w0BAQQFAAOBgQBdFwM4zsRYOFbeH7lclRJzZ/Y2NU4

    Smy3qpuqB56wfd0S1uI3m0sHBYLJrw2CM+zN+L0dHzBenTLXEr4XSZ7EUc0A8k2NRoVDEGTgaUjTSB4RH3QyuT164CIL2PvQT9An6Lb4HPsdXF5knIsQSfGJ0nCuv

    vTbyaLtyxigfJdplPw==" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

    这个Binding配置一样,我看了服务和客户端的。

    再出错我就奇怪了


    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    老徐的博客】:http://www.cnblogs.com/frank_xl/

    【WCF中文技术论坛】:微软WCF中文技术论坛
    【WCF英文技术论坛】:微软WCF英文技术论坛

    2010年7月7日 10:06
    版主