HelloWorldService introspectableService = context.locateService(HelloWorldService.class, "IntrospectableHelloWorldComponent");
assertEquals(introspectableService.sayHello("petra"), "Hello petra");
}
public void testE4XImplInvocation() throws Exception {
HelloWorldService e4xHelloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponentE4X");
String xmlInput = "<hel:getGreetings xmlns:hel=\"http://helloworld\"> " +
"<hel:name>TuscanyWorld</hel:name> " +
"</hel:getGreetings>";
XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(
new ByteArrayInputStream(xmlInput.getBytes()));
StAXOMBuilder staxOMBuilder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(), xmlReader);
Object response = e4xHelloWorldService.sayE4XHello(staxOMBuilder.getDocumentElement());
assertNotNull(response);
assertTrue(response instanceof OMElement);
assertEquals("e4xHello TuscanyWorld", ((OMElement)response).getFirstElement().getText());
//System.out.println(response);
}