String action = hl.getAction(binding.getAddressingVersion(), binding.getSOAPVersion());
if(action != null) {
//assume that all the WSA headers are set by the user
return;
}
AddressingVersion addressingVersion = binding.getAddressingVersion();
//seiModel is passed as null as it is not needed.
WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding);
// wsa:Action
String effectiveInputAction = wsaHelper.getEffectiveInputAction(packet);
if (effectiveInputAction == null || effectiveInputAction.equals("")) {
throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION());
}
boolean oneway = !packet.expectReply;
if (wsdlPort != null) {
// if WSDL has <wsaw:Anonymous>prohibited</wsaw:Anonymous>, then throw an error
// as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to
// disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft
// the SOAP message with non-anonymous ReplyTo/FaultTo.
if (!oneway && packet.getMessage() != null)
{
WSDLBoundOperation wbo = wsdlPort.getBinding().get(packet.getWSDLOperation());
if (wbo != null && wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) {
throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED());
}
}
}
if (!binding.isFeatureEnabled(OneWayFeature.class)) {
// standard oneway
fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), oneway, effectiveInputAction,addressingVersion.isRequired(binding));
} else {
// custom oneway
fillRequestAddressingHeaders(packet, addressingVersion, binding.getSOAPVersion(), binding.getFeature(OneWayFeature.class), effectiveInputAction);
}
}