protected String getConfiguredName() { QName name = getEndpointName(); if (name == null) { JaxWsServiceFactoryBean sfb = (JaxWsServiceFactoryBean)getClientFactoryBean().getServiceFactory(); name = sfb.getJaxWsImplementorInfo().getEndpointName(); } return name + ".jaxws-client.proxyFactory"; }
public ReflectionServiceFactoryBean getServiceFactory() { return clientFactoryBean.getServiceFactory(); }
public ReflectionServiceFactoryBean getServiceFactory() { return clientFactoryBean.getServiceFactory(); }
/** * Specifies the URL where the proxy can find the WSDL defining the * service the proxy implements. * * @param wsdlURL a string containing the WSDL's URL */ public void setWsdlURL(String wsdlURL) { clientFactoryBean.getServiceFactory().setWsdlURL(wsdlURL); }
public String getWsdlURL() { return clientFactoryBean.getServiceFactory().getWsdlURL(); }
public String getWsdlURL() { return clientFactoryBean.getServiceFactory().getWsdlURL(); }
/** * Specifies the URL where the proxy can find the WSDL defining the * service the proxy implements. * * @param wsdlURL a string containing the WSDL's URL */ public void setWsdlURL(String wsdlURL) { clientFactoryBean.getServiceFactory().setWsdlURL(wsdlURL); }
public QName getEndpointName() { QName qn = clientFactoryBean.getEndpointName(); if (qn == null) { qn = clientFactoryBean.getServiceFactory().getEndpointName(false); } return qn; }
public QName getEndpointName() { QName qn = clientFactoryBean.getEndpointName(); if (qn == null) { qn = clientFactoryBean.getServiceFactory().getEndpointName(false); } return qn; }
public Client create() { getServiceFactory().reset(); if (getServiceFactory().getProperties() == null) { getServiceFactory().setProperties(properties); } else if (properties != null) { getServiceFactory().getProperties().putAll(properties); } Client client = null; Endpoint ep = null; try { ep = createEndpoint(); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep); applyProperties(ep); client = createClient(ep); initializeAnnotationInterceptors(ep, getServiceClass()); } catch (EndpointException | BusException e) { throw new ServiceConstructionException(e); } applyFeatures(client); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep); return client; }
public Client create() { getServiceFactory().reset(); if (getServiceFactory().getProperties() == null) { getServiceFactory().setProperties(properties); } else if (properties != null) { getServiceFactory().getProperties().putAll(properties); } Client client = null; Endpoint ep = null; try { ep = createEndpoint(); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep); applyProperties(ep); client = createClient(ep); initializeAnnotationInterceptors(ep, getServiceClass()); } catch (EndpointException | BusException e) { throw new ServiceConstructionException(e); } applyFeatures(client); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep); return client; }
@Override public <T> T getPort(String address, Class<T> serviceInterface, Class<?>... extraClasses) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { if (setClassLoader) { Thread.currentThread().setContextClassLoader(WSNHelper.class.getClassLoader()); } JaxWsProxyFactoryBean jwfb = new JaxWsProxyFactoryBean(); jwfb.getClientFactoryBean().setWsdlURL(WSNWSDLLocator.getWSDLUrl().toExternalForm()); jwfb.setServiceName(new QName("http://cxf.apache.org/wsn/jaxws", serviceInterface.getSimpleName() + "Service")); jwfb.setEndpointName(new QName("http://cxf.apache.org/wsn/jaxws", serviceInterface.getSimpleName() + "Port")); jwfb.setAddress(address); if (extraClasses != null && extraClasses.length > 0) { Map<String, Object> props = new HashMap<>(); props.put("jaxb.additionalContextClasses", extraClasses); jwfb.getClientFactoryBean().getServiceFactory().setProperties(props); } return jwfb.create(serviceInterface); } finally { Thread.currentThread().setContextClassLoader(cl); } } public Endpoint publish(String address, Object o, Class<?> ... extraClasses) {
protected String getConfiguredName() { QName name = getEndpointName(); if (name == null) { JaxWsServiceFactoryBean sfb = (JaxWsServiceFactoryBean)getClientFactoryBean().getServiceFactory(); name = sfb.getJaxWsImplementorInfo().getEndpointName(); } return name + ".jaxws-client.proxyFactory"; }
clientFactory.getServiceFactory().getServiceConfigurations().add(0, new AbstractServiceConfiguration() { @Override public Boolean isOperation(Method method) {
protected Object getProxy(Class<?> sinkInterface, Class<?>... extraClasses) { //needed SOAP handlers ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler( target.getNotificationReferenceParams()); JaxWsProxyFactoryBean service = new JaxWsProxyFactoryBean(); service.getOutInterceptors().add(new LoggingOutInterceptor()); service.setServiceClass(sinkInterface); service.setAddress(target.getTargetURL()); service.getHandlers().add(handler); // do we need to apply a filter? if (target.getFilter() != null && target.getFilter().getContent().size() > 0) { service.getOutInterceptors().add(new FilteringInterceptor(target.getFilter())); } if (extraClasses != null && extraClasses.length > 0) { Map<String, Object> props = new HashMap<>(); props.put("jaxb.additionalContextClasses", extraClasses); service.getClientFactoryBean().getServiceFactory().setProperties(props); } return service.create(); }
clientFactory.getServiceFactory().getServiceConfigurations().add(0, new AbstractServiceConfiguration() { @Override public Boolean isOperation(Method method) {
protected Object getProxy(Class<?> sinkInterface, Class<?>... extraClasses) { //needed SOAP handlers ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler( target.getNotificationReferenceParams()); JaxWsProxyFactoryBean service = new JaxWsProxyFactoryBean(); service.getOutInterceptors().add(new LoggingOutInterceptor()); service.setServiceClass(sinkInterface); service.setAddress(target.getTargetURL()); service.getHandlers().add(handler); // do we need to apply a filter? if (target.getFilter() != null && target.getFilter().getContent().size() > 0) { service.getOutInterceptors().add(new FilteringInterceptor(target.getFilter())); } if (extraClasses != null && extraClasses.length > 0) { Map<String, Object> props = new HashMap<>(); props.put("jaxb.additionalContextClasses", extraClasses); service.getClientFactoryBean().getServiceFactory().setProperties(props); } return service.create(); }
private static WinRm doCreateServiceWithBean(Bus bus) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.getClientFactoryBean().getServiceFactory().setWsdlURL(WinRmService.WSDL_LOCATION); factory.setServiceName(WinRmService.SERVICE); factory.setEndpointName(WinRmService.WinRmPort); factory.setBus(bus); return factory.create(WinRm.class); }
protected EET getPort(final EndpointType endpointType) throws DnsTimeoutException, DnsLookupFailedException { if (wsConfiguration.getDnsLookupTimeout() > 0) { final DnsLookup resolver = new DnsLookupWithTimeout(wsConfiguration.getDnsResolver(), wsConfiguration.getDnsLookupTimeout()); final String ip = resolver.resolveAddress(endpointType.getWebserviceUrl()); logger.info(String.format("DNS lookup resolved %s to %s", endpointType, ip)); } final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(EET.class); factory.getClientFactoryBean().getServiceFactory().setWsdlURL(WEBSERVICE.getWSDLDocumentLocation()); factory.setServiceName(WEBSERVICE.getServiceName()); final EET port = (EET) factory.create(); final Client clientProxy = ClientProxy.getClient(port); ensureHTTPSKeystorePassword(); configureEndpointUrl(port, endpointType.getWebserviceUrl()); configureSchemaValidation(port); configureTimeout(clientProxy); configureLogging(clientProxy); configureSigning(clientProxy); return port; }