Hi to all,
please help me....I wrote a Web Service that take two integer in input and return the sum.
I added to this Web Service the "UsernameToken" security configuration.

Next I generated the Client through WSAS....I created a new package and inside of it i placed the files just generated. Next I wrote the Client:

public class Client {

/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub

System.setProperty("javax.net.ssl.trustStore", "C:/wso2wsas-3.0.1/resources/security/wso2carbon.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:/wso2wsas-3.0.1/resources/clientRepository", null);
SommaStub stub = new SommaStub(ctx, "https://192.168.1.2:9443/services/Somma");
Options options = stub._getServiceClient().getOptions();
//options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.FALSE);
try {

options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, Client.loadPolicy("policy.xml"));

}
catch (Exception e1) {
// TODO Auto-generated catch block

e1.printStackTrace();
}

stub._getServiceClient().setOptions(options);
stub._getServiceClient().engageModule("rampart");
Somma a = new Somma();
a.setA(6);
a.setB(9);

try {
SommaResponse res = stub.somma(a);
System.out.println("RISULTATO: " + res.get_return());
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private static org.apache.neethi.Policy loadPolicy(String xmlPath) throws Exception {
StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
return PolicyEngine.getPolicy(builder.getDocumentElement());
}
}

and the PWCBHandler class:

public class PWCBHandler implements CallbackHandler {
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
if(pwcb.getIdentifer().equals("admin")) {
pwcb.setPassword("admin");
return;
}
}
}
}

Next I run my Client but I obtain this Exception:

Exception in thread "main" org.apache.axis2.AxisFault: trying to engage two different module versions null : 1.41
at org.apache.axis2.util.Utils.checkVersion(Utils.java:351)
at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:473)
at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:453)
at org.apache.axis2.description.AxisDescription.engageModulesToAxisDescription(AxisDescription.java:421)
at org.apache.axis2.description.AxisDescription.engageModulesForPolicy(AxisDescription.java:404)
at org.apache.axis2.description.AxisDescription.applyPolicy(AxisDescription.java:326)
at org.apache.axis2.description.AxisDescription.applyPolicy(AxisDescription.java:331)
at org.apache.axis2.description.AxisDescription.applyPolicy(AxisDescription.java:331)
at it.sisinf.client.SommaStub.(SommaStub.java:97)
at it.sisinf.client.SommaStub.(SommaStub.java:81)
at it.sisinf.client.Client.main(Client.java:31)

I'm using WSO2WSAS 3.0.1

PLEASE...HELP ME....