When messages are digitally signed, the recipient must have the sender's certificate chain in order to check the signature. Typically, the chain has two certificates: that of the sender and that of the sender's certificate authority (CA).
There are two common ways of getting the certificates to the service.
The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA.
To use the direct-reference method when using WSDoAllSender to sign the messages, the client must set a handler property as follows.
stub._setProperty(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
To use the issuer-serial method, the property should be set like this:
stub._setProperty(WSHandlerConstants.SIG_KEY_ID, "IssuerSerial");
If the property is not set, the default in WSS4J is to use the issuer-serial method.