Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem creating client with Axis2 + Rampart

800533Jun 28 2011 — edited Jun 29 2011
I'm creating a web service using Axis2 which uses Rampart for authentication. In all the samples for Rampart, the client needs to have a client side repository for Axis2. Rampart is started on the client as follows:

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("path/to/client/repo", null);

SecureServiceStub stub = new SecureServiceStub(ctx,"https://localhost:8443/axis2/services/SecureService");

ServiceClient sc = stub._getServiceClient();

sc.engageModule("rampart");

The method createConfigurationContextFromFileSystem needs a path to an Axis2 repo on the client which has the rampart.mar file. It apparently needs a full absolute path, not a relative path.

However, I'm deploying my client with Java Web Start and I can't put a Axis2 repo on every machine that may need to run the client. It needs to work from any machine from a web browser so everything the client needs to be in the jar. Is there any way I can load the rampart.mar file from the jar of my client app?

Another possibility would be using the ConfigurationContextFactory.createConfigurationContextFromURIs method, but this would require me to create an online repo of axis2+rampart on the server. Anyone know of a good guide for this? I still would prefer to just package everything in the jar.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2011
Added on Jun 28 2011
4 comments
1,603 views