} finally {
BusFactory.setThreadDefaultBus(bus);
}
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
sh = new SessionHeader();
sh.setSessionId(loginResult.getSessionId());
// Reset the SOAP endpoint to the returned server URL
((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
// or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,Boolean.TRUE);