public void connect(TokenHolder tokenHolder) { for (Class<? extends PublicInterface> interface1 : interfaces) { JaxWsProxyFactoryBean cpfb = new JaxWsProxyFactoryBean(); cpfb.setServiceClass(interface1); cpfb.setAddress(address + "/" + interface1.getSimpleName()); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("mtom-enabled", Boolean.TRUE); cpfb.setProperties(properties); PublicInterface serviceInterface = (PublicInterface) cpfb.create(); client = ClientProxy.getClient(serviceInterface); HTTPConduit http = (HTTPConduit) client.getConduit(); http.getClient().setConnectionTimeout(360000); http.getClient().setAllowChunking(false); http.getClient().setReceiveTimeout(320000); if (!useSoapHeaderSessions) { ((BindingProvider) serviceInterface).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE); } add(interface1.getName(), serviceInterface); } tokenHolder.registerTokenChangeListener(this); notifyOfConnect(); }
Map<String,Object> props = new HashMap<String, Object>(); props.put("mtom-enabled", Boolean.TRUE); JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(UploadSEI.class); factory.setAddress("http://localhost:8080/CxfService/UploadWS"); factory.setProperties(props); UploadSEI client = (UploadSEI) factory.create();
public static void enableSoapClientOutputAttachments(JaxWsProxyFactoryBean pfb){ Map<String,Object> props = new HashMap<String, Object>(); props.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE); pfb.setProperties(props); pfb.getOutInterceptors().add(new SwAOutInterceptor()); pfb.getOutInterceptors().add(new AttachmentOutInterceptor()); }
private void setProperties(JaxWsProxyFactoryBean proxyFactory, UnifiedPortComponentRefMetaData upcmd) { Map<String, Object> properties = proxyFactory.getProperties(); if (properties == null) { properties = new HashMap<String, Object>(); proxyFactory.setProperties(properties); } for (UnifiedStubPropertyMetaData prop : upcmd.getStubProperties()) { properties.put(prop.getPropName(), prop.getPropValue()); } } }
public static XKMSPortType create(String endpointAddress, Bus bus) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setBus(bus); factory.setServiceClass(XKMSPortType.class); factory.setAddress(endpointAddress); Map<String, Object> properties = new HashMap<>(); properties.put("jaxb.additionalContextClasses", new Class[] {ResultDetails.class}); factory.setProperties(properties); return (XKMSPortType)factory.create(); } }
public static XKMSPortType create(String endpointAddress, Bus bus) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setBus(bus); factory.setServiceClass(XKMSPortType.class); factory.setAddress(endpointAddress); Map<String, Object> properties = new HashMap<>(); properties.put("jaxb.additionalContextClasses", new Class[] {ResultDetails.class}); factory.setProperties(properties); return (XKMSPortType)factory.create(); } }
public <T> T createCallbackProxy(final Class<T> proxyInterface) { final JaxWsProxyFactoryBean callback = new JaxWsProxyFactoryBean(); callback.setServiceName(serviceName); callback.setEndpointName(new QName(serviceName.getNamespaceURI(), serviceName.getLocalPart() + "Port")); callback.setAddress(replyToAddress); callback.setServiceClass(proxyInterface); final List<Feature> features = callback.getFeatures(); features.add(new RequestCallbackFeature()); if (logging) { features.add(new LoggingFeature()); } if (serviceActivityMonitoring) { features.add(getEventFeature()); } final Map<String, Object> properties = new HashMap<String, Object>(); properties.put(RequestCallbackFeature.CALLCONTEXT_PROPERTY_NAME, this); callback.setProperties(properties); return callback.create(proxyInterface); }
clientFactory.setUsername(username); clientFactory.setPassword(password); clientFactory.setProperties(props);
clientFactory.setUsername(username); clientFactory.setPassword(password); clientFactory.setProperties(props);
clientFactory.setUsername(username); clientFactory.setPassword(password); clientFactory.setProperties(props);
clientFactory.setUsername(username); clientFactory.setPassword(password); clientFactory.setProperties(props);
private void setupForTest(boolean sec) throws Exception { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(AegisJaxWs.class); if (sec) { factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsUN"); WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor(); wss4jOut.setProperty("action", "UsernameToken"); wss4jOut.setProperty("user", "alice"); wss4jOut.setProperty("password", "pass"); factory.setProperties(new HashMap<String, Object>()); factory.getProperties().put("password", "pass"); factory.getOutInterceptors().add(wss4jOut); } else { factory.setAddress("http://localhost:" + PORT + "/aegisJaxWs"); } factory.getServiceFactory().setDataBinding(new AegisDatabinding()); client = (AegisJaxWs)factory.create(); }