This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Digital signature in SOAP XML  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all,

i need to append the digital signature to the soap message that is sent to the server. the service is run in https (ssl). i have coded the client in the axis java, i have also created the stubs from wsdl using wsdl2java program. now how do i insert the signature to the soap xml. i read some docs in the web but it didnt show the implementation of this in axis...

Thanks in advance to the help


Vijay Veeraraghavan
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard for using digital signatures in XML is called XML-Signature; if you install the Rampart module for Axis 2 you'll have all the libraries that are needed to use it.

But you should really use WS-Security, which is the standard for securing web services. It includes signatures, and is also implemented by Rampart.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

public SOAPElement stringToSOAPElement(String xmlText) {
try {
SOAPMessage message = null;
InputStream is = new ByteArrayInputStream(xmlText.getBytes());
org.w3c.dom.Document doc =XMLUtils.newDocument(is);
MessageFactory factory = MessageFactory.newInstance();
message = factory.createMessage();
SOAPElement element = message.getSOAPBody().addDocument(doc);

// This returns the SOAPBodyElement
// that contains ONLY the Payload
return (element);

} catch (SOAPException e) {
System.out.println(”SOAPException : ” + e);
return null;

} catch (IOException e) {
System.out.println(”IOException : ” + e);
return null;

} catch (ParserConfigurationException e) {
System.out.println(”ParserConfigurationException : ” + e);
return null;

} catch (SAXException e) {
System.out.println(”SAXException : ” + e);
return null;

}
}

[ UD: Please post in English only. Also, you may have missed that we have a policy on screen names here at JavaRanch. It must consist of a first name and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do using the "My Profile" link at the top of the page. ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!