SimpleProvider provider = new SimpleProvider();
// register the service with the engine
SOAPService target = new SOAPService(new RPCProvider());
target.setOption(JavaProvider.OPTION_CLASSNAME, "test.encoding.TestBody");
provider.deployService(new QName(null,namespace), target);
// setup
AxisEngine engine = new AxisServer(provider);
engine.init();
// create a message in context
MessageContext msgContext = new MessageContext(engine);
Message message = new Message(request);
message.setMessageContext(msgContext);
// ensure that the message is parsed
SOAPEnvelope envelope = message.getSOAPEnvelope();
RPCElement body = (RPCElement) envelope.getFirstBody();
// This is not necessarily true anymore...
//assertEquals("Namespace does not equal the message context target service.", namespace, msgContext.getTargetService());
// verify the service is set
assertEquals("The target is not the same as the message context service handler", target, msgContext.getService());