Hi Phil, Please try using sc.getAxisService().getPolicySubject().attachPolicy(getRampartConfiguration());
instead of the policy include. You can check the populateAxisService() method of the generated stub to check whether policies are correctly attached. Please use Axis2 1.4.1 instead of Axis2 1.4. Please take a look at "Security Vulnerabilities in Apache Axis2 1.4 / Rampart 1.4 and Avoiding Them" [1]. thanks, nandana [1] - http://wso2.org/library/3787 On 10/11/08, Philippe Camus <[EMAIL PROTECTED]> wrote: > Hi all, > > I am using Rampart 1.4 and Axis2 1.4, and trying to sign my messages. I had > a piece of code working fine in Axis/Rampart 1.2, and I am trying to port it > 1.4. > > For some reason my client won't encrypt its messages and I cannot figure out > why..... so everything is working in clear text (I haven't configured the > server side yet, and simply wanted to see the signed request in TcpMon). > > ConfigurationContext context = > ConfigurationContextFactory.createConfigurationContextFromFileSystem("repository", > null); > ServiceStub service = new ServiceStub(context, > "http://localhost:1256/axis2/services/Service?wsdl"); > ServiceClient sc = service._getServiceClient(); > sc.engageModule("rampart"); > StAXOMBuilder builder = new StAXOMBuilder("rampart-config.xml"); > Policy rampartConfig = PolicyEngine.getPolicy(builder.getDocumentElement()); > sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, > rampartConfig); > > FYI, the client is generated from the WSDL containing the encryption policy > using the "wsdl2code" ANT task. > > How can I debug the client side to see if the policy is correctly picked up? > Thanks! > > Best regards, > > Phil > >
