// theName = theName.substring(1);
// }
//
if (serviceFactory == null)
{
serviceFactory = new ObjectServiceFactory(xFire.getTransportManager(),
new AegisBindingProvider());
}
ObjectServiceFactory osf = (ObjectServiceFactory) serviceFactory;
SpringServiceConfiguration springConfig = new SpringServiceConfiguration();
springConfig.setMethods(operations);
osf.getServiceConfigurations().add(0, springConfig);
/**
* Use the ServiceInterface if that is set, otherwise use the Class of
* the service object.
*/
Class intf = getServiceClass();
if (intf == null)
{
if (getServiceBean() == null)
throw new RuntimeException("Error creating service " + name +
". The service class or the service bean must be set!");
intf = SpringUtils.getUserTarget(getServiceBean()).getClass();
}
// Lets set up some properties for the service
if (createDefaultBindings)
properties.put(ObjectServiceFactory.CREATE_DEFAULT_BINDINGS, Boolean.TRUE);
else
properties.put(ObjectServiceFactory.CREATE_DEFAULT_BINDINGS, Boolean.FALSE);
if (style != null)
properties.put(ObjectServiceFactory.STYLE, style);
if (use != null)
properties.put(ObjectServiceFactory.USE, use);
if (scope != null)
properties.put(ObjectServiceFactory.SCOPE, scope);
if (implementationClass != null)
{
properties.put(ObjectInvoker.SERVICE_IMPL_CLASS, implementationClass);
}
if (schemas != null)
{
properties.put(ObjectServiceFactory.SCHEMAS, schemas);
}
if (wsdlURL != null)
{
String home = (String) getXfire().getProperty(XFire.XFIRE_HOME);
Resolver resolver = new Resolver(home, wsdlURL);
URL url = resolver.getURL();
if (url == null)
{
throw new XFireRuntimeException("Could not resolve WSDL URL " + wsdlURL);
}
xfireService = serviceFactory.create(intf, null, url, properties);
}
else
{
xfireService = serviceFactory.create(intf, name, namespace, properties);
}
xfireService.setExecutor(executor);
// dirty hack to remove our ServiceConfiguration
osf.getServiceConfigurations().remove(springConfig);
if (bindings != null && serviceFactory instanceof ObjectServiceFactory)
{
initializeBindings();
}