On Fri, Jul 22, 2011 at 11:41 AM, Martin Gainty <mgai...@hotmail.com> wrote:
> Hi Jay- > The Axis solution is to configure public and private keystores..create a > cert with public key and engage Rampart (Security) Module to Axis > http://wso2.org/library/3190 > > Let me know if you need any guidance..i've done this about a hundred times > Martin Gainty > I could definitely use some guidance. I'm trying to follow that guide, but it seems to be missing a few details, which is throwing me off. For instance, the code under "Step 3. Engaging Rampart and Setting Authentication Information" does not show its imports. I had to search to find that ConfigurationContext is apache.axis2.context.ConfigurationContext (similarly had to search for ConfigurationContextFactory and ServiceClient). Here's my test code: > package org.petio.magiceightball; > import org.apache.axis2.context.ConfigurationContext; > import org.apache.axis2.context.ConfigurationContextFactory; > import org.apache.axis2.client.ServiceClient; > public class MagicEightBallServiceCGClient > { > public static void main(String[] args) throws Exception > { > /* Get repository context */ > ConfigurationContext ctx = > ConfigurationContextFactory.createConfigurati > onContextFromFileSystem("/usr/local/axis2-1.5.5/repository", null); > > /* Get Service stub */ > MagicEightBallServiceStub stub = new MagicEightBallServiceStub(ctx); > > /* Engage rampart */ > ServiceClient sc = stub._getServiceClient(); > sc.engageModule("rampart"); > > /* Consume service */ > System.out.println(stub.getAdvice()); > } > } > > When I try to run this, I get this error: org.apache.axis2.AxisFault: Unable to engage module : rampart > at > org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:358) > at > org.petio.magiceightball.MagicEightBallServiceCGClient.main(MagicEightBallServiceCGClient.java:19) > My /usr/local/axis2-1.5.5/repository directory looks like the following: /usr/local/axis2-1.5.5/repository/modules: > addressing-1.5.5.mar mtompolicy-1.5.5.mar rampart-1.6.0.mar > mex-1.5.5.mar ping-1.5.5.mar scripting-1.5.5.mar > modules.list rahas-1.6.0.mar soapmonitor-1.5.5.mar > > /usr/local/axis2-1.5.5/repository/services: > services.list version.aar > And I've manually added rahas-1.6.0.mar and rampart-1.6.0.mar to modules.list (should I have??). Still getting the same problem. Also, when I don't engage the rampart module, I get this error: Exception in thread "main" org.apache.axis2.AxisFault: Must Understand check > failed for header http://www.w3.org/2005/08/addressing : Action > at > org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:97) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163) > at > org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364) > at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417) > at > org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) > at > org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) > at > org.petio.magiceightball.MagicEightBallServiceStub.getAdvice(MagicEightBallServiceStub.java:189) > at > org.petio.magiceightball.MagicEightBallServiceCGClient.main(MagicEightBallServiceCGClient.java:25) > I'm wondering if this is a side-effect of not loading rampart. Or must I also load the "addressing" module? -- Jay Sullivan