• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to send Signed SOAP Message

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Experts,

I have developed my application that send SOAP request using SAAJ. for one of customer.

Recently, Customer implemented security file keystoke (jks) file in the server and now I am facing problem to send signed soap messages.

Please have a look how my system is working without any sign. but now its facing error 403 mean not allowing the service. I need to send Signed Saop message
using the key file
==========================================================================================
RequestSendRecieverToHLRD.java



==============================================================================================================

The Class was working fine without any error but after enabling the security (jks) can you please tell how i can sign the soap message with the key?

The key file and SOAP xml are attached also.


Detail of the key (jks) file is as below:
_______________________________


keystoreType: JKS
keystoreFile: TBSoapClient1.jks
keystorePass: provgw
privateKeyAlias: tbsoapclient1.provgw
privateKeyPass: provgw
certificateAlias: tbsoapclient1.provgw

=======================================
changeimsi.xml contents:





Where i need to put code to use the TBSoapClient1.jks file and send Signed SOAP message?Please help me!!! its deadly urgent.

[Devaka: Added code tags]

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Have you had a look at WSS4J (http://ws.apache.org/wss4j/)?
As far as I understand, there is code in there that can help you sign SOAP messages - at least if the server follows standards in WS-Security.
Best wishes!
 
Mahfuzul islam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks! I have downlaoded wss4j 1.8 but facing problem to add


import org.apache.ws.axis.security.util.AxisUtil;


to make some code as :
Message signedSOAPMsg = (org.apache.axis.Message)AxisUtil.toSOAPMessage(signedDoc);

Can you help about the wss4j version or anything i am missing?



 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you use axis if yes axis has rampart module to take care of security features which is also built on wss4j and easy to use.
 
Mahfuzul islam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tripathi,

Can you please provide simple java code how to sign and send using axis?

It will be very helpfull

Thanks!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WS-Security is not trivial stuff, so no simple examples are available. But it's not rocket science, either. Download Axis2, download the Rampart module that implements WS-Security and copy its *.mar and *.jar files into the Axis web app. Then check out the "samples" directory that comes with Rampart.
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Download rampart module source code. It has got some samples where signing is implemented. I have tried theses earlier, let me know if you have any issue executing these.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Download rampart module source code. It has got some samples where signing is implemented.


What you really want is the Rampart binary download. It includes the source code of the examples.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic