WCF WSS4J Interop

April 5, 2009

Recently I had to work on an interop scenario where WCF client needed to call a WSS4J service. After a bit of experimentation, I came up with the following configuration.

Here are some of the key settings to note:

Authentication Mode  MutualCertificate

Message Protection Order  SignBeforeEncrypt

SOAP Version  1.1

Algorithm Basic128Rsa15

Message Security Version  WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10

 

<?xml version=1.0 encoding=utf-8 ?>

<configuration>

    <system.serviceModel>

            <client>

                  <endpoint address=http://gp64156.exampleCorp.net:8080/eservices/aService

                behaviorConfiguration=ClientCertBehavior binding=customBinding

                bindingConfiguration=JavaInterop contract=exampleCorp.Proxy.aProfileManager

                name=UserProfileManager>

                        <identity>

                              <dns value=userprofilews />

                        </identity>

                  </endpoint>

            </client>

 

            <bindings>

                  <customBinding>

                        <binding name=JavaInterop>

                              <security defaultAlgorithmSuite=Basic128Rsa15 allowSerializedSigningTokenOnReply=true

                        authenticationMode=MutualCertificate requireDerivedKeys=false

                        securityHeaderLayout=Lax includeTimestamp=false messageProtectionOrder=SignBeforeEncrypt

                        messageSecurityVersion=WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10>

                                    <localClientSettings detectReplays=false />

                              </security>

                              <textMessageEncoding messageVersion=Soap11 />

                              <httpTransport />

                        </binding>

                  </customBinding>

            </bindings>

 

            <behaviors>

            <endpointBehaviors>

                <behavior name=ClientCertBehavior>

                    <clientCredentials>

                        <clientCertificate findValue=CN=client.com />

                        <serviceCertificate>

                            <defaultCertificate findValue=userprofilews storeLocation=LocalMachine

                                storeName=TrustedPeople x509FindType=FindByIssuerName />

                        </serviceCertificate>

                    </clientCredentials>

                </behavior>

            </endpointBehaviors>

        </behaviors>

       

       

    </system.serviceModel>

</configuration>

One Response to “WCF WSS4J Interop”

  1. Trangntt Says:

    Please show me how to configure Wss4j services.
    Please help me! I spent a lot of time to solve this problem.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: