PayloadRootQNameEndpointMapping extends AbstractQNameEndpointMapping { @Override protected QName resolveQName(MessageContext messageContext) throws TransformerException { return PayloadRootUtils.getPayloadRootQName(messageContext.getRequest().getPayloadSource(), transformerFactory); }  static void setTransformerFactory(TransformerFactory transformerFactory);  }
@Test public void testResolveQNames() throws Exception { MockWebServiceMessage request = new MockWebServiceMessage("<root/>"); MessageContext context = new DefaultMessageContext(request, new MockWebServiceMessageFactory()); QName qName = mapping.resolveQName(context); Assert.assertNotNull("mapping returns null", qName); Assert.assertEquals("mapping returns invalid qualified name", new QName("root"), qName); }
@Test public void testGetQNameNameNamespace() throws Exception { MockWebServiceMessage request = new MockWebServiceMessage("<prefix:localname xmlns:prefix=\"namespace\"/>"); MessageContext context = new DefaultMessageContext(request, new MockWebServiceMessageFactory()); QName qName = mapping.resolveQName(context); Assert.assertNotNull("mapping returns null", qName); Assert.assertEquals("mapping returns invalid method name", new QName("namespace", "localname", "prefix"), qName); }