Set up a Web Services (SOAP) Input adapter that uses Policy driven security and communicates over HTTPS.
The source code for the WSPolicy and MessageUT_Policy classes are located in the adapter example/src directory.
The steps below result in the creation of three keystores (server.jks, client.jks, and service.jks). Do not change the username "client" and "service".
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.
<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" />
<transportReceiver name="https" class="org.apache.axis2.transport.http.AxisServletListener"> <parameter name="port">8443</parameter> </transportReceiver>
<security> <sslTrustStore>server.jks</sslTrustStore> <sslTrustStorePassword>YOURSTOREPASSWORD</sslTrustStorePassword> <!--Just change the element to the same as your input--> <WSPolicy> <credentials> <User>client</User><!--Just change the element to the same as your input--> <!-- here the password is the pw for the client keystore --> <Password encrypted="false">YOURCLIENTPASSWORD</Password> <!--Just change the element to the same as your input--> </credentials> <policyClass>com.sap.esp.adapter.ws.security.MessageUTPolicy</policyClass> <param name="policyPath" value="messageUT_policy.xml"/> <param name="clientKeystore" value="client.jks"/> </WSPolicy> </security>
<EspProjects> <EspProject> <Name>StockTraderProject</Name> <Uri>esp://localhost:19011/w1/p1</Uri> <Security> <User></User> <Password></Password> <AuthType>user_password</AuthType>
<parameter name="MessageUTPassword">YOURSERVICEPASSWORD</parameter> <!--Here, it need YOURSERVICEPASSWORD instead of YOURCLIENTPASSWORD--> ...... <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> ...... <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">YOURSERVICEPASSWORD</ramp:property><!--Here, it need YOURSERVICEPASSWORD instead of YOURCLIENTPASSWORD--> </ramp:RampartConfig>