WCF自定义Tcp绑定无法从配置文件加载

时间:2017-03-14 10:19:28

标签: c# web-services wcf wcf-binding wcf-security

您好,我在拒绝加载的双工WCF服务上有以下自定义绑定。

        <binding name="CustomBinding1" openTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="infinite">
      <transactionFlow />
      <reliableSession maxPendingChannels="20" inactivityTimeout="00:01:00" />
      <security authenticationMode="IssuedTokenForSslNegotiated" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature">
          <issuedTokenParameters tokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0">
            <issuer address="https://localhost/IdentityServer/issue/wstrust/mixed/certificate" binding="ws2007HttpBinding" bindingConfiguration="ws">
              <identity>
                <dns value="" />
              </identity>
            </issuer>
            <issuerMetadata address="https://localhost/IdentityServer/issue/wstrust/mex"></issuerMetadata>
          </issuedTokenParameters>
      </security>
      <binaryMessageEncoding>
        <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      </binaryMessageEncoding>
      <tcpTransport maxBufferPoolSize="524288" maxReceivedMessageSize="5242880" connectionBufferSize="8192" hostNameComparisonMode="StrongWildcard" channelInitializationTimeout="00:01:00" maxBufferSize="5242880" maxPendingConnections="20" maxOutputDelay="00:00:00.2000000" maxPendingAccepts="5" transferMode="Buffered" listenBacklog="25" portSharingEnabled="true" teredoEnabled="false">
        <connectionPoolSettings groupName="default" leaseTimeout="00:00:00" idleTimeout="00:00:00" maxOutboundConnectionsPerEndpoint="0" />
      </tcpTransport>
    </binding>

当我启动服务时,我收到以下错误:

  

System.InvalidOperationException:绑定“CustomBinding”不支持创建任何通道类型。这通常表示CustomBinding中的BindingElements堆叠不正确或顺序错误。堆栈底部需要传输。 BindingElements的推荐顺序是:TransactionFlow,ReliableSession,Security,CompositeDuplex,OneWay,StreamSecurity,MessageEncoding,Transport。

从文档中看起来一切都很好,任何人都可以看到这个有什么问题吗?我知道有一些元素缺失,但它们都是可选的。

由于

端点:

      <service name="Company.Services.SessionService" behaviorConfiguration="Release">
    <endpoint name="SessionTcp" address="net.tcp://localhost:61002/SessionService/1/Federated" binding="customBinding" bindingConfiguration="CustomBinding1" contract="Company.Services.Common.Interfaces.ISessionService" />
  </service>

服务行为:

        <behavior name="Release">
      <serviceAuthorization principalPermissionMode="Always" />
      <serviceCredentials useIdentityConfiguration="true">
        <serviceCertificate findValue="CN=Server.Company.com" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectDistinguishedName" />
        <issuedTokenAuthentication>
          <allowedAudienceUris>
            <add allowedAudienceUri="http://Company.com/" />
          </allowedAudienceUris>
        </issuedTokenAuthentication>
      </serviceCredentials>
      <dataContractSerializer maxItemsInObjectGraph="200000" />
      <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="2000" maxConcurrentInstances="2000" />
    </behavior>

0 个答案:

没有答案