SimpleMethodEndpointMapping extends AbstractMethodEndpointMapping<String> implements InitializingBean { @Override protected String getLookupKeyForMessage(MessageContext messageContext) throws TransformerException { WebServiceMessage request = messageContext.getRequest(); QName rootQName = PayloadRootUtils.getPayloadRootQName(request.getPayloadSource(), transformerFactory); return rootQName.getLocalPart(); }  Object[] getEndpoints(); void setEndpoints(Object[] endpoints); String getMethodPrefix(); void setMethodPrefix(String methodPrefix); String getMethodSuffix(); void setMethodSuffix(String methodSuffix); @Override final void afterPropertiesSet(); static final String DEFAULT_METHOD_PREFIX; static final String DEFAULT_METHOD_SUFFIX; }
@Test public void testGetLookupKeyForMessageNoNamespace() throws Exception { MockWebServiceMessage request = new MockWebServiceMessage("<MyRequest/>"); MessageContext messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory()); String result = mapping.getLookupKeyForMessage(messageContext); Assert.assertEquals("Invalid lookup key", "MyRequest", result); }
@Test public void testGetLookupKeyForMessageNamespace() throws Exception { MockWebServiceMessage request = new MockWebServiceMessage( "<MyRequest xmlns='http: MessageContext messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory()); String result = mapping.getLookupKeyForMessage(messageContext); Assert.assertEquals("Invalid lookup key", "MyRequest", result); }