Connector connector = new Connector(locator);
// creates all the connector's needed resources, such as the server invoker
connector.create();
// create the handler to receive the invocation request from the client for processing
ServerInvocationHandler invocationHandler = new WebInvocationHandler();
// first parameter is sub-system name. can be any String value.
connector.addInvocationHandler("sample", invocationHandler);
// start with a new non daemon thread so
// server will wait for request and not exit