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; } }  @Override final void setActorOrRole(String actorOrRole); @Override final void setActorsOrRoles(String[] actorsOrRoles); @Override final void setUltimateReceiver(boolean ultimateReceiver);  }
@Test public void testGetLookupKeyForMessage() throws Exception { String soapAction = "http: ((SoapMessage) context.getRequest()).setSoapAction(soapAction); Assert.assertEquals("Invalid lookup key", soapAction, mapping.getLookupKeyForMessage(context)); }
@Test public void testGetLookupKeyForMessageQuoted() throws Exception { String soapAction = "http: ((SoapMessage) context.getRequest()).setSoapAction(soapAction); Assert.assertEquals("Invalid lookup key", soapAction, mapping.getLookupKeyForMessage(context)); }