cls = getSEIClass();
}
if (cls != null) {
// create client factory bean
ClientFactoryBean factoryBean = createClientFactoryBean(cls);
// setup client factory bean
setupClientFactoryBean(factoryBean, cls);
// fill in values that have not been filled.
QName serviceQName = null;
try {
serviceQName = factoryBean.getServiceName();
} catch (IllegalStateException e) {
// It throws IllegalStateException if serviceName has not been set.
}
if (serviceQName == null && getServiceLocalName() != null) {
factoryBean.setServiceName(new QName(getServiceNamespace(), getServiceLocalName()));
}
if (factoryBean.getEndpointName() == null && getEndpointLocalName() != null) {
factoryBean.setEndpointName(new QName(getEndpointNamespace(), getEndpointLocalName()));
}
Client client = factoryBean.create();
// setup the handlers
setupHandlers(factoryBean, client);
return client;
} else {
ClientFactoryBean factoryBean = createClientFactoryBean();
// setup client factory bean
setupClientFactoryBean(factoryBean, null);
// fill in values that have not been filled.
QName serviceQName = null;
try {
serviceQName = factoryBean.getServiceName();
} catch (IllegalStateException e) {
// It throws IllegalStateException if serviceName has not been set.
}
if (serviceQName == null && getServiceLocalName() != null) {
factoryBean.setServiceName(new QName(getServiceNamespace(), getServiceLocalName()));
}
if (factoryBean.getEndpointName() == null && getEndpointLocalName() != null) {
factoryBean.setEndpointName(new QName(getEndpointNamespace(), getEndpointLocalName()));
}
checkName(factoryBean.getEndpointName(), "endpoint/port name");
checkName(factoryBean.getServiceName(), "service name");
return factoryBean.create();
}
}