aspose file tools*
The moose likes Web Services and the fly likes Need to send Signed SOAP Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need to send Signed SOAP Message " Watch "Need to send Signed SOAP Message " New topic
Author

Need to send Signed SOAP Message

Mahfuzul islam
Greenhorn

Joined: Jun 22, 2010
Posts: 16
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]

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
Mahfuzul islam
Greenhorn

Joined: Jun 22, 2010
Posts: 16

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?



shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
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.


SCJP 1.5(97%) My Blog
Mahfuzul islam
Greenhorn

Joined: Jun 22, 2010
Posts: 16
Hi Tripathi,

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

It will be very helpfull

Thanks!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
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.


Ping & DNS - my free Android networking tools app
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
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
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to send Signed SOAP Message