Class<?> cls = null;
if (getServiceClass() != null) {
cls = getServiceClass();
// create client factory bean
ClientFactoryBean factoryBean = createClientFactoryBean(cls);
// setup client factory bean
setupClientFactoryBean(factoryBean, cls);
Client client = factoryBean.create();
// setup the handlers
setupHandlers(factoryBean, client);
return client;
} else {
// create the client without service class
checkName(portName, "endpoint/port name");
checkName(serviceName, "service name");
ClientFactoryBean factoryBean = createClientFactoryBean();
// setup client factory bean
setupClientFactoryBean(factoryBean, null);
return factoryBean.create();
}
}