// serialize the parameters
serializeProperties(loadbalanceEndpoint, endpointElement);
serializeCommonAttributes(endpoint,endpointElement);
Dispatcher dispatcher = loadbalanceEndpoint.getDispatcher();
if (dispatcher != null) {
OMElement sessionElement = fac.createOMElement("session", SynapseConstants.SYNAPSE_OMNAMESPACE);
if (dispatcher instanceof SoapSessionDispatcher) {
sessionElement.addAttribute("type", "soap", null);
} else if (dispatcher instanceof HttpSessionDispatcher) {
sessionElement.addAttribute("type", "http", null);
} else if (dispatcher instanceof SimpleClientSessionDispatcher) {
sessionElement.addAttribute("type", "simpleClientSession", null);
} else {
handleException("invalid session dispatcher : " + dispatcher.getClass().getName());
}
long sessionTimeout = loadbalanceEndpoint.getSessionTimeout();
if (sessionTimeout != -1) {
OMElement sessionTimeoutElement = fac.createOMElement("sessionTimeout",