Show TOC

Example: Using a Web Services (SOAP) Input Adapter with Transport Level SecurityLocate this document in the navigation structure

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

Prerequisites

The cluster database stores configuration information. Ensure that the cluster is running, so that the adapter can interact with the projects on the cluster.

Context

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

Procedure

  1. Install Apache Tomcat.
  2. Ensure that the JDK_HOME environment variable is properly set. If it is not, you can set it 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><!--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><!--Change the element to the same as your input-->
    					<EncryptionAlgorithm>RSA</EncryptionAlgorithm>
    				</credentials>
    			</TransportUsernameToken>
    	</security>
    

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

    <EspProjects>
          <EspProject>    
            <Name>StockTraderProject</Name>
            <Uri>esp[s]://localhost:19011/w1/p1</Uri>
            <Security>
    			<User>user</User>
    			<Password>password</Password>
    			<AuthType>user_password</AuthType>
    
    
    Note In order to use SSL on the ESP server, the JDK specified in Step 8 needs to be version 8 or higher. If SSL is enabled, edit the esp:// prefix in the Uri to esps://.
  10. Run ant create_sample_aar to create the sample .aar file.
  11. Remove any StockTraderService_noSec.aar or StockTraderService_messageUT.aar files from the adapter examples/service directory if you previously ran those examples.
  12. Copy the examples/service/StockTraderService_transportUT.aar file to the tomcat/webapps/axis2/WEB-INF/services directory under your Web server.
  13. Modify set_example_env.bat or set_example_env.sh to set ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD to the desired user name and password combination, and set ADAPTER_EXAMPLE_CLUSTER_NODE_PROTOCOL to esps if SSL is enabled or esp if SSL is disabled.
  14. Start the Web server.
  15. Start the node by running the start_node.bat or start_node.sh script.
  16. Start the project by running the start_project.bat or start_project.sh script.
  17. Subscribe to the stream in the project by running the subscribe.bat or subscribe.sh script.
  18. Start the adapter by running the start_adapter.sh or start_adapter.sh script.
    Data begins flowing in the subscription window.