public void testServiceBackReference() throws Exception
{
SOAPService serviceOne = (SOAPService)server.getService("service.one");
assertNotNull("service.one should be non-null!", serviceOne);
Chain serviceOne_responseFlow = (Chain)serviceOne.getResponseHandler();
assertNotNull("service.two/responseFlow should be non-null!",
serviceOne_responseFlow);
Handler serviceOne_responseFlow_handlers[] =
serviceOne_responseFlow.getHandlers();
assertNotNull("service.one/responseFlow/handlers should be non-null!",
serviceOne_responseFlow_handlers);
assertTrue("service.one should have exactly 1 handler!",
(1 == serviceOne_responseFlow_handlers.length));
Handler serviceOne_responseFlow_handler =
serviceOne_responseFlow_handlers[0];
assertNotNull("service.one's handler should be non-null!",
serviceOne_responseFlow_handler);
assertTrue("service.one's handler should be a RPCProvider!",
(serviceOne_responseFlow_handler instanceof
org.apache.axis.providers.java.RPCProvider));
Handler serviceOne_handler_byName = server.getHandler("BackReference");
assertTrue("service.one's 'BackReference' should be same as directly accessed 'BR'!",
(serviceOne_responseFlow_handler ==
serviceOne_handler_byName));
/*******************************************************
<service name="service.two" provider="java:MSG">
<requestFlow>
<handler type="BackReference"/>
</requestFlow>
</service>
******************************************************/
SOAPService serviceTwo = null;
serviceTwo = (SOAPService) server.getService("service.two");
assertTrue("service.two should be non-null!",
(null != serviceTwo));
Chain serviceTwo_requestFlow = (Chain) serviceTwo.getRequestHandler();
assertTrue("service.two/requestFlow should be non-null!",
(null != serviceTwo_requestFlow));
Handler serviceTwo_requestFlow_handlers[] =
serviceTwo_requestFlow.getHandlers();
assertTrue("service.two/requestFlow/handlers should be non-null!",
(null != serviceTwo_requestFlow_handlers));
assertTrue("service.two should have exactly 1 handler!",
(1 == serviceTwo_requestFlow_handlers.length));