/** * Looks up or adds a body id. <p/> First try to locate the * <code>wsu:Id</code> in the SOAP body element. If one is found, the * value of the <code>wsu:Id</code> attribute is returned. Otherwise the * method generates a new <code>wsu:Id</code> and an appropriate value. * * @param doc The SOAP envelope as <code>Document</code> * @return The value of the <code>wsu:Id</code> attribute of the SOAP body * @throws Exception */ protected String setBodyID(Document doc) throws Exception { Element bodyElement = WSSecurityUtil.findBodyElement(doc); if (bodyElement == null) { throw new Exception("SOAP Body Element node not found"); } return setWsuId(bodyElement); }
secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL); tokenTypeSet = true; } else if (x509Token.isRequireKeyIdentifierReference()) { secBase.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER); tokenTypeSet = true; } else if (x509Token.isRequireThumbprintReference()) { secBase.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); tokenTypeSet = true; secBase.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER); } else if (wss.isMustSupportRefIssuerSerial()) { secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL); } else if (wss instanceof Wss11 && ((Wss11) wss).isMustSupportRefThumbprint()) { secBase.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); secBase.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
/** * Looks up or adds a body id. <p/> First try to locate the * <code>wsu:Id</code> in the SOAP body element. If one is found, the * value of the <code>wsu:Id</code> attribute is returned. Otherwise the * method generates a new <code>wsu:Id</code> and an appropriate value. * * @param doc The SOAP envelope as <code>Document</code> * @return The value of the <code>wsu:Id</code> attribute of the SOAP body * @throws Exception */ protected String setBodyID(Document doc) throws Exception { Element bodyElement = WSSecurityUtil.findBodyElement(doc); if (bodyElement == null) { throw new Exception("SOAP Body Element node not found"); } return setWsuId(bodyElement); }