Wednesday, June 28, 2017

Common error on securityConfirmation when invoking secured service with .NET client

When invoking a secured SOAP service over a .NET client a very common error as below can be seen.

<Exception> <ExceptionType>System.ServiceModel.Security.MessageSecurityException</ExceptionType> <Message>Signature confirmation is not expected in the security header.</Message> <StackTrace>
 
This is because the secured policy used for the service is sending a SignatureConfirmation header in its security header.

If you secured the service over WSO2 ESB secured proxy , then you only need to remove below tag in blue from your WS-policy for service.

 
 
             <sp:Wss11>
                <wsp:Policy>
                    <sp:MustSupportRefKeyIdentifier/>
                    <sp:MustSupportRefIssuerSerial/>
                    <sp:MustSupportRefThumbprint/>
                    <sp:MustSupportRefEncryptedKey/>
                    <sp:RequireSignatureConfirmation/>
                </wsp:Policy>
            </sp:Wss11> 


Executing sqls for AS400 objects with WSO2 ESB

1. Download and add jt400.jar to ESB_HOME/repository/components/lib.
2. Then you could create the connection pool as below and execute your query with dblookup mediator.


         <dblookup>
            <connection>
               <pool>
                  <password>123456</password>
                  <driver>com.ibm.as400.access.AS400JDBCDriver</driver>
                  <url>jdbc:as400://{IP}/{DB_NAME}</url>
                  <user>userA</user>
               </pool>
            </connection>
            <statement>
               <sql>select id from exp1000 where clId ='A1000000'</sql>
               <result name="custID" column="id"/>
            </statement>
         </dblookup>