ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Devon Miller <>
Subject help composing security header without using a cxf/axis2 framework
Date Thu, 19 Jan 2017 22:59:16 GMT
I am trying to create a SOAP security header but am having difficulty
understanding how to create the proper crypto and other configs. I have
attached the WSDL policy (not the entire WSDL) as well as the token request
and response from the server and a whoami request that shows a example of
the security header that I need to generate. The server is a WCF endpoint
e.g. CRM system. All of the attachments are to a small virtual machine demo
system I setup to test security processing in java. I am using wss4j 2.1.8

I've gone through the wss4j tests trying to stitch together just the right
parts as I don't need to have anything robust, just a security header that
meets this one target. When trying to use axis2 to generate the stubs, it
did not seem to generate the security part and I just need some code for
the client side in a non-servlet scenario. I tried to look at rampart to
understand it may create the config but reading that code did not help. I
have also read through the standards but that's not helped me map it to the
code I need.

Thoughts on which wss4j tests might hold critical code for me to look at
and cut and paste  from? For example, I've yet to figure out how to create
the proper crypto to use with the signature, it seems all the choices use
disk-based keystores.


   val secHeader = new WSSecHeader(doc)
    val timestamp = new WSSecTimestamp()
    timestamp.setTimeToLive(3600 * 2), secHeader)
    val x509Data = new DOMX509Data(doc,
      new DOMX509IssuerSerial(doc, "CN=DemoCrmServer, DC=Demo, DC=Local",
    // This gives me an error because I do not have a,
but I just need a memory based version
    val crypto = CryptoFactory.getInstance()
    val signer = new WSSecSignature()
    // What's the right crypto?
    val signedDoc =, crypto, secHeader)

View raw message