private String createTimestampUuid(SoapMessage message) throws ParserException {
  NodeList timestampList=message.getHeader().getOwnerDocument().getElementsByTagNameNS(WSU_NAMESPACE,WSU_TIMESTAMP_LOCAL_NAME);
  assert timestampList.getLength() <= 1;
  if (timestampList.getLength() == 1) {
    assert timestampList.item(0).getNodeType() == Node.ELEMENT_NODE;
    Element timestamp=(Element)timestampList.item(0);
    String timestampId=Util.randomNCNameUUID();
    Attr wsuId=timestamp.getOwnerDocument().createAttributeNS(WSU_NAMESPACE,WSU_ID_LOCAL_NAME);
    wsuId.setPrefix(timestamp.getPrefix());
    wsuId.setValue(timestampId);
    timestamp.setAttributeNodeNS(wsuId);
    timestamp.setIdAttributeNode(wsuId,true);
    log.trace("Created wsu:Id for wsu:Timestamp: " + timestampId);
    return timestampId;
  }
  log.trace("Timestamp element not found in the message");
  return null;
}

private String createTimestampUuid ( SoapMessage message ) throws ParserException { NodeList timestampList = message . getHeader ( ) . getOwnerDocument ( ) . getElementsByTagNameNS ( WSU_NAMESPACE , WSU_TIMESTAMP_LOCAL_NAME ) ; assert timestampList . getLength ( ) <= 1 ; if ( timestampList . getLength ( ) == 1 ) { assert timestampList . item ( 0 ) . getNodeType ( ) == Node . ELEMENT_NODE ; Element timestamp = ( Element ) timestampList . item ( 0 ) ; String timestampId = Util . randomNCNameUUID ( ) ; Attr wsuId = timestamp . getOwnerDocument ( ) . createAttributeNS ( WSU_NAMESPACE , WSU_ID_LOCAL_NAME ) ; wsuId . setPrefix ( timestamp . getPrefix ( ) ) ; wsuId . setValue ( timestampId ) ; timestamp . setAttributeNodeNS ( wsuId ) ; timestamp . setIdAttributeNode ( wsuId , true ) ; log . trace ( "Created wsu:Id for wsu:Timestamp: " + timestampId ) ; return timestampId ; } log . trace ( "Timestamp element not found in the message" ) ; return null ; }
creates ' wsu : id ' attribute for wsu : timestamp needed for signature .
