We have a requirement where a webservice with username token security has been created in IBM Websphere Integration Developer 6.1. Now, in order to test this, we have to develop a Web Service Client in Java. The requirement is to get this done using Apache Axis2. After doing a lot of reading on this, I was able to use Axis2 to generate a client for a simple Web Service which does not require authentication and I was able to test it correctly. But I came to know that in order to use UserName token Security with axis2, rampart is needed.
Now I need to know how to use Rampart with Axis2 in eclipse. We dont have apache server installed in our systems, but we deploy it in eclipse. Even after reading a lot of articles on the same, I havent been able to get Rampart to work.
Can someone please guide me through the steps of configuring Rampart in eclipse and also how to use it for WebService Client Generation using UserName token?
So far, using Axis2 I used to do the following Steps. 1. Create a Java Project and import the required WSDLs into it. 2. Using the WSDLs, I create the WebServiceClient and the following types of files get generated a. A java Interface file b. A Java Proxy file which implements the interface mentioned in a. c. A java stub file which extends org.apache.axis.client.Stub and implements the interface mentioned in a. d. A java Service file which is again an interface e. A java ServiceLocator file which implements the above interface.
So, I also need to know how I can use these files for testing the Username Token Web Service.
When I do the above using a Dynamic Web project and right click on the WSDLs and click on generate client, a ServiceCallBackHandler.java and HttpSrviceStub files are created. How do i use these to achieve the testing?
Thanks.
I haven't used rampart for Username Tokens, but for my services (signing and encrypting) IBM documentation was really helpful. Have a look at: http://www.ibm.com/developerworks/java/library/j-jws4/ Java Web services: Axis2 WS-Security basics; See how to install Rampart into Axis2 and implement UsernameToken handling
For my project Java source is the same when I use WS-Security (working environment) and without WS-Security (test environment). All I have to do on client side it to enable/disable rampart configuration from my_client/axis-repo/conf/axis2.xml
. Have a look at: http://wso2.org/library/240 where you will find example configuration that may be useful to you:
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken</items>
<user>bob</user>
<passwordCallbackClass>org.apache.rampart.
samples.sample02.PWCBHandler</passwordCallbackClass>
</action>
</parameter>