Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Himai Minh

Problem with Axis2 WS-Security (Please Help)

Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could be a lengthy post, any help would be greatly appreciated.

I'm a newbie in webservices. Started a week back learning webservices. I wrote a sample service and client using axis2 and don't have any problems. Coming to the real time application, I have to consume a webservice provided by a client. The webservice is written in .NET. I have generated the Handler and Stub using the WSDL2Java tool provided in axis2. Sending the SOAP request and getting the response is fine. The problem comes when I use Timestamp Signature Encryption. When I use just Timestamp Encryption, it works fine. I'm getting a soap response but in the Body, I'm not getting the complete data. Getting a message "internal error occurred, please contact". When I contacted the service provider, he said, the SOAP message is getting into the front door but something is going wrong at the method level.
I'm thinking, this could be because I'm not using the Signature Encryption.

If I use the following properties in axis2.xml

<parameter name="OutflowSecurity">
<items>Timestamp Encrypt </items>

I don't get any error, able to send SOAP request and getting the SOAP response, but with incomplete data.

If I use the following properties.

<parameter name="OutflowSecurity">
<items>Timestamp Signature Encrypt </items>
<!-- <encryptionPropFile></encryptionPropFile> -->

I get the following exception while sending the SOAP request.

java.lang.Exception: Cannot find key for alias: test; nested exception is: WSHandler: Signature: error during message Signature creation failed; nested exception is:
java.lang.Exception: Cannot find key for alias: test

I have a key store file. I opened it using the "keytool" command. The password I'm providing to open this file is same a that I'm using in the "" file. Here're the file contents.

I would be greatly thankful if someone can tell me what I'm missing in order to do Signature Encryption.

Thanks in advance,
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic