}
// Create factory
ObjectServiceFactory factory = null;
if (wa == null) {
factory = new ObjectServiceFactory(xfire.getTransportManager(),
new AegisBindingProvider(tm));
} else if (selectedAnnotations.equals(AN_JAVA5) &&
selectedTypeMapping.equals(TM_JAXB2)) {
try {
Class clazz = Class.forName("org.codehaus.xfire.jaxws.JAXWSServiceFactory");
Constructor ct = clazz.getDeclaredConstructor(new Class[] { TransportManager.class });
factory = (ObjectServiceFactory) ct.newInstance(new Object[] { xfire.getTransportManager() });
} catch (Exception e) {
factory = new AnnotationServiceFactory(wa,
xfire.getTransportManager(),
new AegisBindingProvider(tm));
}
} else {
factory = new AnnotationServiceFactory(wa,
xfire.getTransportManager(),
new AegisBindingProvider(tm));
}
// Register only JBI transport in the factory
factory.getSoap11Transports().clear();
factory.getSoap12Transports().clear();
factory.getSoap11Transports().add(JbiTransport.JBI_BINDING);