// try w3c version of ws-a first, then member submission version
final MessageHeaders headers = requestMsg.getHeaders();
String action = AddressingUtils.getAction(headers, AddressingVersion.W3C, soapVersion);
AddressingVersion wsaVersion = AddressingVersion.W3C;
if (action == null) {
action = AddressingUtils.getAction(headers, AddressingVersion.MEMBER, soapVersion);
wsaVersion = AddressingVersion.MEMBER;
}
if (action == null) {
// TODO: Better error message
throw new WebServiceException("No wsa:Action specified");
}
else if (action.equals(GET_REQUEST)) {
final String toAddress = AddressingUtils.getTo(headers, wsaVersion, soapVersion);
return processGetRequest(requestMsg, toAddress, wsaVersion, soapVersion);
}
else if (action.equals(GET_MDATA_REQUEST)) {
String faultText = MessagesMessages.MEX_0017_GET_METADATA_NOT_IMPLEMENTED(GET_MDATA_REQUEST, GET_REQUEST);
logger.warning(faultText);
final Message faultMessage = createFaultMessage(faultText, GET_MDATA_REQUEST,
wsaVersion, soapVersion);
wsContext.getMessageContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, wsaVersion.getDefaultFaultAction());
return faultMessage;
}
// If here, either action is unsupported
// TODO: Better error message
throw new UnsupportedOperationException(action);