Hi.

I want to use WSSPolicy with Axis2 1.5.1 and Rampart 1.4. Deploying the service with an attached Policy works fine. Creating the stubs with WSDL2Java don't cause an error. But when I send a request there are no WSSHeaders generated.

Rampart is engaged. Using the OutflowSecurity parameter WSS works on the client side.

Without the OutflowSecurity parameter I use the RampartConfig class to configure the client:

 RampartConfig rampartConfig = new RampartConfig();
 rampartConfig.setUser("client");
 rampartConfig.setPwCbClass("PWDCallback");
CryptoConfig sigCrypto = new CryptoConfig();
 sigCrypto.setProvider("org.apache.ws.security.components.crypto.Merlin");
Properties props = new Properties(); props.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", "JKS"); props.setProperty("org.apache.ws.security.crypto.merlin.file","client.jks"); props.setProperty("org.apache.ws.security.crypto.merlin.keystore.password", "apache"); sigCrypto.setProp(props); rampartConfig.setSigCryptoConfig(sigCrypto); Policy policy = new Policy();
 policy.addAssertion(rampartConfig);
stub._getServiceClient().getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, policy);

Thanks,
Shaan

Reply via email to