SOAPHeaderBlock toHeaderBlock = soapHeader.addHeaderBlock(
WSA_TO, addressingNamespaceObject);
toHeaderBlock.setText(address);
}
AnyContentType referenceParameters = epr.getReferenceParameters();
if (referenceParameters != null) {
processAnyContentType(referenceParameters, soapHeader);
}
addToHeader(epr, soapHeader);
}
// processing WSA Action
String action = messageInformationHeaders.getAction();
if (action != null && !isAddressingHeaderAlreadyAvailable(WSA_ACTION, soapHeader)) {
processStringInfo(action, WSA_ACTION, soapHeader);
}
// processing WSA replyTo
if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, soapHeader)) {
epr = messageInformationHeaders.getReplyTo();
if (epr == null) {//optional
// setting anonymous URI. Defaulting to Final.
String anonymousURI = Final.WSA_ANONYMOUS_URL;
if (Submission.WSA_NAMESPACE.equals(addressingNamespace)) {
anonymousURI = Submission.WSA_ANONYMOUS_URL;
}
epr = new EndpointReference(anonymousURI);
}
// add the service group id as a reference parameter
String serviceGroupContextId = msgContext.getServiceGroupContextId();
if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) {
if (epr.getReferenceParameters() == null) {
epr.setReferenceParameters(new AnyContentType());
}
epr.getReferenceParameters().addReferenceValue(new QName(Constants.AXIS2_NAMESPACE_URI,
Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX), serviceGroupContextId);
}
addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, soapHeader);