Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Https WebService message: Message did not contain a valid Security Element

I am using axis 2 webservice client.

The first https call to the webservice throws a exception with the message: "Message did not contain a valid Security Element".

I think that the problem could be the security mode: maybe it has to be message level security. In this case, how can I configure it in axis?.

The code:

System.setProperty("javax.net.ssl.keyStore", jksFile);
System.setProperty("javax.net.ssl.keyStorePassword", jksPassword);

MyServicePortProxy proxy = new MyServicePortProxy();
Stub stub = (Stub) proxy.getMyServicePort();

proxy.setEndpoint(endpoint);
stub.setUsername(username);
stub.setPassword(password);

// throws exception with the above message:
proxy.serviceMethod(...);
like image 425
Antonio Avatar asked Jul 12 '26 13:07

Antonio


1 Answers

Take a look at http://ws.apache.org/wss4j/package.html we had to define a client-config.wsdd that told axis to include username/password (if it is ws-security you are using). I am a little bit weak on the different standards and what separates them.

like image 82
jwiklund Avatar answered Jul 14 '26 04:07

jwiklund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!