Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(bais);
connector.setConfiguration(xml.getDocumentElement());
connector.create();
// Set ServerSocketFactory and SocketFactory in ServerInvoker.
ServerInvoker serverInvoker = connector.getServerInvoker();
ServerSocketFactory ssf2 = getDefaultServerSocketFactory();
serverInvoker.setServerSocketFactory(ssf2);
SocketFactory sf2 = getDefaultCallbackSocketFactory();
serverInvoker.setSocketFactory(sf2);
connector.addInvocationHandler("sample", new SampleInvocationHandler());
connector.start();
// Verify ServerSocketFactory is the one set in ServerInvoker.
assertTrue(ssf2 == serverInvoker.getServerSocketFactory());
/////////////////////////////////////
///// Do client side test. ////
/////////////////////////////////////