assembler.createApplication(ejbJar);
ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo("EchoBean");
assertNotNull(deploymentInfo);
assertEquals("ServiceEndpointInterface", EchoServiceEndpoint.class, deploymentInfo.getServiceEndpointInterface());
// OK, Now let's fake a web serivce invocation coming from any random
// web service provider. The web serivce provider needs supply
// the MessageContext and an interceptor to do the marshalling as
// the arguments of the standard container.invoke signature.
// So let's create a fake message context.
MessageContext messageContext = new FakeMessageContext();
// Now let's create a fake interceptor as would be supplied by the
// web service provider. Instead of writing "fake" marshalling
// code that would pull the arguments from the soap message, we'll
// just give it the argument values directly.
Object wsProviderInterceptor = new FakeWsProviderInterceptor("Hello world");
// Ok, now we have the two arguments expected on a JAX-RPC Web Service
// invocation as per the OpenEJB-specific agreement between OpenEJB
// and the Web Service Provider
Object[] args = new Object[]{messageContext, wsProviderInterceptor};
// Let's grab the container as the Web Service Provider would do and
// perform an invocation
RpcContainer container = (RpcContainer) deploymentInfo.getContainer();
Method echoMethod = EchoServiceEndpoint.class.getMethod("echo", String.class);
String value = (String) container.invoke("EchoBean", echoMethod.getDeclaringClass(), echoMethod, args, null);