GregorianCalendar timestamp = new GregorianCalendar();
EbMSMessage msg = (EbMSMessage)message.getPayload();
MessageHeader messageHeader = EbMSMessageUtils.createMessageHeader(msg.getMessageHeader(),hostname,timestamp,EbMSMessageType.ACKNOWLEDGMENT.action());
Acknowledgment acknowledgment = new Acknowledgment();
acknowledgment.setVersion(Constants.EBMS_VERSION);
acknowledgment.setMustUnderstand(true);
acknowledgment.setTimestamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(timestamp));
acknowledgment.setRefToMessageId(messageHeader.getMessageData().getRefToMessageId());
acknowledgment.setFrom(new From()); //optioneel
acknowledgment.getFrom().getPartyId().addAll(messageHeader.getFrom().getPartyId());
// ebMS specs 1701
//acknowledgment.getFrom().setRole(messageHeader.getFrom().getRole());
acknowledgment.getFrom().setRole(null);
//TODO resolve actor from CPA
acknowledgment.setActor(ActorType.URN_OASIS_NAMES_TC_EBXML_MSG_ACTOR_TO_PARTY_MSH.value());
if (msg.getAckRequested().isSigned() && msg.getSignature() != null)
for (ReferenceType reference : msg.getSignature().getSignedInfo().getReference())
acknowledgment.getReference().add(reference);
message.setPayload(new EbMSAcknowledgment(messageHeader,acknowledgment));
return message;
}
catch (DatatypeConfigurationException e)