Skip to main content Skip to complementary content

Filters and Handlers Test

About this task

This test consists of three steps:

Procedure

  1. Add a PasswordHandler to your Application Service/Client
    PasswordHandler is a pre-defined handler used to replace the real password characters with null ('') for security considerations. You can set the tag name which has the password and needs to be replaced. For example:
    <bean id="passwordFilter"
          class="org.talend.esb.sam.common.handler.impl.PasswordHandler">
       <property name="tagnames">
          <list>
             <value>Password</value>
          </list>
       </property>
    </bean>
    Then, send a Message which has the <Password> tag:
    <soapenv:Header>
       <wsse:Security
          xmlns:wsse="http://docs.oasisopen.org/wss/2004/01/   \\
          oasis-200401-wss-wssecurity-secext-1.0.xsd"
          soapenv:mustUnderstand="0">
    
       <wsse:UsernameToken>
          <wsse:Username>user1</wsse:Username>
          <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/   \\
             oasis-200401-wss-usernametoken-profile-1.0#PasswordDigest">
          IR55epSSTb7sg3Z3+HKNb9MqAWg=</wsse:Password>
       </wsse:UsernameToken>
    
       </wsse:Security>
    </soapenv:Header>   
    The value of <Password> Element should be replaced with ''.
    <soapenv:Header>
       <wsse:Security
          xmlns:wsse="http://docs.oasisopen.org/wss/2004/01/   \\
          oasis-200401-wss-wssecurity-secext-1.0.xsd"
          soapenv:mustUnderstand="0">
    
       <wsse:UsernameToken>
          <wsse:Username>user1</wsse:Username>
          <replaced xmlns=""/>
       </wsse:UsernameToken>
    
       </wsse:Security>
    </soapenv:Header>
  2. Next, add a CustomInfoHandler to your application service or client. CustomInfoHandler is a pre-defined handler used to store user-defined key/values in the database. For example: <bean id="fixedProperties" class="org.talend.esb.sam.common.handler.impl.CustomInfoHandler"> <property name="customInfo"> <map> <entry key="Application name" value="Placeholder App"/> <entry key="Stage" value="Dev"/> </map> </property> </bean>
    Then send a message, and the custom key/value properties will be stored in the database.

    Example

  3. Finally, add filter configuration on the Service Activity Monitoring Server:
    Modify the Service Activity Monitoring Server's server.xml. For example:
    ......
    <bean id="monitoringService"
          class="org.talend.esb.sam.soap.service.MonitoringServiceImpl">
       <property name="eventFilter">
          <list>
             <ref local="stringContentFilter" />
          </list>
          </property>
             <property name="eventManipulator">
             <list>
                <ref local="contentLengthHandler" />
             </list>
          </property>
       <property name="persistenceHandler" ref="eventRepository" />
    </bean>
    ......
  4. The information should now get stored in the database.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!