return;
HeaderList hl = responsePacket.getMessage().getHeaders();
// wsa:To
WSEndpointReference replyTo;
try {
replyTo = message.getHeaders().getReplyTo(av, sv);
if (replyTo != null)
hl.add(new StringHeader(av.toTag, replyTo.getAddress()));
} catch (InvalidAddressingHeaderException e) {
replyTo = null;
}
// wsa:Action, add if the message doesn't already contain it,
// generally true for SEI case where there is SEIModel or WSDLModel
// false for Provider with no wsdl, Expects User to set the coresponding header on the Message.
if(responsePacket.getMessage().getHeaders().getAction(av,sv) == null) {
//wsa:Action header is not set in the message, so use the wsa:Action passed as the parameter.
hl.add(new StringHeader(av.actionTag, action));
}
// wsa:MessageID
hl.add(new StringHeader(av.messageIDTag, responsePacket.getMessage().getID(av, sv)));
// wsa:RelatesTo
String mid = getMessage().getHeaders().getMessageID(av,sv);
if (mid != null)
hl.add(new RelatesToHeader(av.relatesToTag, mid));
// populate reference parameters
WSEndpointReference refpEPR;
if (responsePacket.getMessage().isFault()) {
// choose FaultTo
refpEPR = message.getHeaders().getFaultTo(av, sv);
// if FaultTo is null, then use ReplyTo
if (refpEPR == null)
refpEPR = replyTo;
} else {
// choose ReplyTo
refpEPR = replyTo;
}
if (refpEPR != null) {
refpEPR.addReferenceParameters(hl);
}
}