I am trying to use WSS4J to add UsernameToken and sign some SOAP headers and SOAP body using that UsernameToken. This is the security policy defined in an end .NET web service.
In my first test case, I do not want to use Axis or Axis2. I am trying to do in the following way: 1) read an xml file which contains SOAP Envelope, and construct SOAPEnvelope from the data read from the xml file. 2) Using WSS4J to sign SOAP headers and SOAP body. 3) Send the signed SOAPEnvelope through HttpClient. I have some question in step 2). What class should I use? Shall I use WSSignEnvelope#build(Document, Crypto) method? Do I need to setUsernameToken(WSSAddUsernameToken)? Could anyone recommend me how to do that? The other question is not related to this first test case. In the second test case, I want to encrypt some SOAP headers and SOAP body using the UsernameToken. Shall I use WSEncryptBody#build(Document, Crypto)? There are a few method to set encryption key like setKey(byte[]) and setEmbeddedKeyName(String), which one should I use? Will the DerivedKeyToken been used when encrypting SOAP with UsernameToken? Thank you in advance for any suggestions and comments. Regards, Xinjun --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
