class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping implements SoapEndpointMapping {

	@Override
	protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
		if (messageContext.getRequest() instanceof SoapMessage) {
			SoapMessage request = (SoapMessage) messageContext.getRequest();
			String soapAction = request.getSoapAction();
			if (StringUtils.hasLength(soapAction) && soapAction.charAt(0) == '"'
					&& soapAction.charAt(soapAction.length() - 1) == '"') {
				return soapAction.substring(1, soapAction.length() - 1);
			} else {
				return soapAction;
			}
		} else {
			return null;
		}
	}

}