Example: Using a Web Services (SOAP) Input Adapter with Transport Level Security

Set up a Web Services (SOAP) Input adapter that uses transport level username/token security and communicates over HTTPS.

The steps below result in the creation of a keystore. Provide a password for the user "sybase" but do not change the username "sybase".

  1. Install Apache Tomcat.
  2. Ensure that the JDK_HOME environment variable is properly set. If it is not, you can set using set_example_env.bat or set_example_env.sh.
  3. Run create_server_keystore <YOURSTOREPASSWORD> to create a server.jks. Answer "localhost" to "What is your first and last name".

    The server.jks is created under the current working directory. The Tomcat SSL HTTP connector and Web Services (SOAP) adapter use the server.jks to set up the HTTPS connection between them.

  4. Add the following to the tomcat/conf/server.xml file:
    <Connector port="8443" 
                       protocol="org.apache.coyote.http11.Http11Protocol" 
                       SSLEnabled="true" maxThreads="150"  
                       scheme="https" secure="true" 
                       keystoreFile="ESP_INSTALL\adapters\webservices\examples\input_transportUT\server.jks" 
                       keystorePass="YOURSTOREPASSWORD"   
                       clientAuth="false" 
                       sslProtocol="TLS" />
  5. Add Apache Axis2™ to Tomcat. Copy axis2.war to tomcat/webapps, and start Tomcat.
    Axis2 is automatically unzipped.
  6. Copy the files in rampart/modules to tomcat/webapps/axis2/WEB-INF/modules.
  7. Copy the files in rampart/lib to tomcat/webapps/axis2/ WEB-INF/lib.
  8. Add the following to the <Tomcat>\webapps\axis2\WEB-INF\conf\axis2.xml file:
    <transportReceiver name="https" class="org.apache.axis2.transport.http.AxisServletListener">
    <parameter name="port">8443</parameter>
    </transportReceiver>
  9. Modify the adapter_config.xml file as follows:
    <security>
    			<sslTrustStore>server.jks</sslTrustStore>
    			<sslTrustStorePassword>YOURSTOREPASSWORD</sslTrustStorePassword><!--Just change the element to the same as your input-->
    			<TransportUsernameToken>
    				<credentials>
    					<!-- The user value should not be changed in this adapter example -->
    				    <User>sybase</User> 
    					<!-- The password value shall match with the parameter "TransportUTPassword" in service.xml-->
    					<Password encrypted="false">YOURPASSWORD</Password><!--Just change the element to the same as your input-->
    					<EncryptionAlgorithm>RSA</EncryptionAlgorithm>
    				</credentials>
    			</TransportUsernameToken>
    	</security>
    

    Set the <User> and <Password> to the username and password used by node1 in $ESP_HOME/cluster/examples:

    <EspProjects>
          <EspProject>    
            <Name>StockTraderProject</Name>
            <Uri>esp://localhost:19011/w1/p1</Uri>
            <Security>
    			<User></User>
    			<Password></Password>
    			<AuthType>user_password</AuthType>
    
  10. Modify the services.xml as follows:
    <parameter name="TransportUTPassword">YOURPASSWORD</parameter>
  11. Run ant create_sample_aar to create the sample .aar file.
  12. Remove any StockTraderService_noSec.aar or StockTraderService_messageUT.aar files from the adapter examples/service directory if you previously ran those examples.
  13. Copy the examples/service/StockTraderService_transportUT.aar file to the tomcat/webapps/axis2/WEB-INF/services directory under your Web server.
  14. Modify set_example_env.bat or set_example_env.bat by setting ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD to the username and password used by node1 in $ESP_HOME/cluster/examples.
  15. Start the Web server.
  16. Start the ESP node by running the start_node.bat or start_node.sh script.
  17. Start the ESP project by running the start_project.bat or start_project.sh script.
  18. Subscribe to the stream in the project by running the subscribe.bat or subscribe.sh script.
  19. Start the adapter by running the start_adapter.sh or start_adapter.sh script.
    Data begins flowing in the subscription window.