2

我正在开发一个双工联合 wcf 服务,我的联合方案工作正常,但是当我尝试使其双工时抛出异常“无法验证传入策略”

我认为它与我的配置有关,但仍然无法找出错误,

以下是我的配置:

  1. 对于我的主要服务:

    <bindings>
        <customBinding>
            <binding name='MyServiceBinding'>
                <security authenticationMode='SecureConversation'>
                    <secureConversationBootstrap authenticationMode='IssuedTokenForCertificate'/>
                    <issuedTokenParameters>
                        <issuerMetadata address='http://localhost:62751/TokenIssuer.svc/mex'/>
                    </issuedTokenParameters>
                </security>
                <compositeDuplex/>
                <oneWay/>
                <httpTransport/>
            </binding>
        </customBinding>
    </bindings>
    
    <services>
        <service name="MyService.MyService"
                           behaviorConfiguration='MyServiceBehavior'>
            <endpoint address="Response"
                                  binding="customBinding"
                                  bindingConfiguration='MyServiceBinding'
                                  contract="MyService.IMyService" />
            <endpoint address="mex"
                      binding="mexHttpBinding"
                      contract="IMetadataExchange" />
    
        </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    

  2. STS 配置

和 3. 客户端配置

<system.serviceModel>
    <bindings>
        <customBinding>
                <binding name='MyServiceBinding'>
                    <security authenticationMode='SecureConversation'>
                        <secureConversationBootstrap authenticationMode='IssuedTokenForCertificate'/>
                        <issuedTokenParameters>
                            <issuer address='http://localhost:62751/TokenIssuer.svc' binding='wsHttpBinding' bindingConfiguration='MyTokenIssuer'/>
                        </issuedTokenParameters>
                    </security>
                    <compositeDuplex/>
                    <oneWay/>
                    <httpTransport/>
                </binding>

        </customBinding>

        <wsHttpBinding>
            <binding name="MyTokenIssuer">
                <security mode="Message"/>
            </binding>
        </wsHttpBinding>

    </bindings>

    <behaviors>
        <endpointBehaviors>
            <behavior name="GetResponseClientBehavior">
                <clientCredentials>
                    <serviceCertificate>
                        <authentication certificateValidationMode="PeerOrChainTrust"/>
                    </serviceCertificate>
                </clientCredentials>
            </behavior>
        </endpointBehaviors>
    </behaviors>

    <client>
        <endpoint name="WSFederationHttpBinding_IMyService" address="http://localhost:53121/MyService.svc/Response" binding="customBinding" bindingConfiguration="MyServiceBinding" behaviorConfiguration="GetResponseClientBehavior" contract="IMyService">
            <identity>
                <certificateReference storeLocation="CurrentUser" storeName="TrustedPeople" x509FindType="FindBySubjectName" findValue="BookStoreService.com"/>
            </identity>
        </endpoint>
    </client>        
</system.serviceModel>
4

0 回答 0