private Service getService(Class clazz) { Service service = intf2service.get(clazz); if (service == null) { Map<String,Object> properties = new HashMap<String,Object>(); properties.put(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE); service = serviceFactory.create(clazz, serviceName, wsdlLocation, properties); intf2service.put(clazz, service); } return service; }
public Endpoint(String bindingId, Object implementor) { // Try the BindingType annotation if (bindingId == null) { BindingType type = implementor.getClass().getAnnotation(BindingType.class); if (type != null) { bindingId = type.value(); } } // We now must use the SOAP 1.1 HTTP binding if (bindingId == null || bindingId.length() == 0) { bindingId = SOAPBinding.SOAP11HTTP_BINDING; } this.binding = jaxWsHelper.getBinding(bindingId); if (binding == null) { throw new IllegalStateException("Could not find binding: " + bindingId); } this.implementor = implementor; this.service = jaxWsHelper.getServiceFactory().create(implementor.getClass()); this.service.setInvoker(new BeanInvoker(implementor)); }
public Object getProxy() throws Exception { if (proxy == null) { Map props = new HashMap(); props.put(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE); ServiceFactory factory = ServiceFactoryHelper.findServiceFactory(xfire, serviceClass, null, null); Service service = factory.create(serviceClass, props); JBIClient client; if (factory instanceof JAXWSServiceFactory) { client = new JAXWSJBIClient(xfire, service); } else { client = new JBIClient(xfire, service); } if (interfaceName != null) { client.getService().setProperty(JbiChannel.JBI_INTERFACE_NAME, interfaceName); } if (serviceName != null) { client.getService().setProperty(JbiChannel.JBI_SERVICE_NAME, serviceName); } if (endpoint != null) { client.getService().setProperty(JbiChannel.JBI_ENDPOINT, endpoint); } client.getService().setProperty(JbiChannel.JBI_SECURITY_PROPAGATATION, Boolean.valueOf(propagateSecurityContext)); XFireProxyFactory xpf = new XFireProxyFactory(xfire); proxy = xpf.create(client); } return proxy; }