protected void setupUDP(InterceptorProvider p, EndpointInfo ei) { WSAddressingFeature add = new WSAddressingFeature(); add.setAddressingRequired(true); add.initialize(p, bus);
public final void resolveFeatures() { AddressingFeature addressing = getAddressingFeature(); if (addressing == null) { return; } if (addressing.isEnabled()) { WSAddressingFeature feature = getWSAddressingFeature(); if (feature == null) { feature = new WSAddressingFeature(); addAddressingFeature(feature); } feature.setAddressingRequired(addressing.isRequired()); feature.setResponses(addressing.getResponses().toString()); } else { removeAddressingFeature(); getEndpointInfo().setProperty("org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled", Boolean.TRUE); } }
WSAddressingFeature feature = new WSAddressingFeature(); if (addressingRequired(bindingExtensors) || addressingRequired(portExtensors)) { feature.setAddressingRequired(true);
WSAddressingFeature wsAddressingFeature = new WSAddressingFeature(); wsAddressingFeature.initialize(client, client.getBus());
factory.setServiceClass(...); factory.setAddress(...); factory.getFeatures().add(new WSAddressingFeature()); SomePortType client = (SomePortType) factory.create(); AddressingProperties maps = new AddressingPropertiesImpl(); EndpointReferenceType epr = new EndpointReferenceType(); //Then you can add referenceParameters to the epr ReferenceParametersType ref = new ReferenceParametersType(); List<Object> paras = ref.getAny(); Country ctry = new Country("xx"); JAXBContext ctx = JAXBContext.newInstance(new Class[] {Country.class }); Marshaller marshaller = ctx.createMarshaller(); DOMResult res = new DOMResult(); marshaller.marshal(ctry, res); Element elt = ((Document) res.getNode()).getDocumentElement(); any.add(elt); epr.setReferenceParameters(ref); maps.setTo(epr); ((BindingProvider)client).getRequestContext() .put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, maps);
/** * Initialize JAXWS proxy factory bean * @param factory JAXWS Proxy factory bean */ public void initializeFactory(JaxWsProxyFactoryBean factory) { // set outgoing security (username/password) if (StringUtils.isNotEmpty(getHttpUser())) { factory.setUsername(getHttpUser()); factory.setPassword(getHttpPassword()); } // enable WS-addressing if (StringUtils.isNotEmpty(getWSAddressingToUri())) { factory.getFeatures().add(new WSAddressingFeature()); } }
public Endpoint createEndpoint() throws BusException, EndpointException { Endpoint ep = super.createEndpoint(); new WSAddressingFeature().initialize(ep, getBus()); return ep; } }
WSAddressingFeature feature = new WSAddressingFeature(); if (addressingRequired(bindingExtensors) || addressingRequired(portExtensors)) { feature.setAddressingRequired(true);
private void configureService(ServerFactoryBean svrFactory, Object service) { svrFactory.setServiceClass(wsTransactionConfiguration.getSei()); svrFactory.setServiceName(wsTransactionConfiguration.getServiceName()); svrFactory.setWsdlLocation(wsTransactionConfiguration.getWsdlLocation()); svrFactory.setAddress(serviceAddress); svrFactory.setServiceBean(service); svrFactory.getFeatures().add(new WSAddressingFeature()); if (wsTransactionConfiguration.isMtom()) { svrFactory.setProperties(Collections.singletonMap("mtom-enabled", "true")); } }
protected void setupUDP(InterceptorProvider p, EndpointInfo ei) { WSAddressingFeature add = new WSAddressingFeature(); add.setAddressingRequired(true); add.initialize(p, bus);
public Endpoint createEndpoint() throws BusException, EndpointException { Endpoint ep = super.createEndpoint(); new WSAddressingFeature().initialize(ep, getBus()); return ep; } }
public final void resolveFeatures() { AddressingFeature addressing = getAddressingFeature(); if (addressing == null) { return; } if (addressing.isEnabled()) { WSAddressingFeature feature = getWSAddressingFeature(); if (feature == null) { feature = new WSAddressingFeature(); addAddressingFeature(feature); } feature.setAddressingRequired(addressing.isRequired()); feature.setResponses(addressing.getResponses().toString()); } else { removeAddressingFeature(); getEndpointInfo().setProperty("org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled", Boolean.TRUE); } }
/** * Creates a charging station web service proxy. * * @param chargingStationAddress address of the charging station. * @return charging station web service proxy */ public ChargePointService createChargingStationService(String chargingStationAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ChargePointService.class); factory.setAddress(chargingStationAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); ChargePointService chargePointService = (ChargePointService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) chargePointService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return chargePointService; }
/** * {@inheritDoc} */ @Override protected void initializeProvider(InterceptorProvider provider, Bus bus) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Resolving bus extensions for Request-Callback feature"); } WSAddressingFeature addressing = new WSAddressingFeature(); addressing.setAddressingRequired(true); addressing.initialize(provider, bus); if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Initializing interceptors for Request-Callback feature"); } final RequestCallbackInInterceptor inInterceptor = new RequestCallbackInInterceptor(); final CallbackActionInterceptor cbInterceptor = new CallbackActionInterceptor(); final RequestCallbackOutInterceptor outInterceptor = new RequestCallbackOutInterceptor(); provider.getInInterceptors().add(inInterceptor); provider.getInInterceptors().add(cbInterceptor); provider.getOutInterceptors().add(outInterceptor); } }
/** * {@inheritDoc} * * @see org.jboss.wise.core.wsextensions.EnablerDelegate#visitWSAddressing(Object) */ public void visitWSAddressing(Object endpointInstance) throws UnsupportedOperationException { Bus bus = BusFactory.getThreadDefaultBus(); Client client = ClientProxy.getClient(endpointInstance); WSAddressingFeature feature = new WSAddressingFeature(); feature.initialize(client, bus); }
WSAddressingFeature addressingFeature = new WSAddressingFeature(); addressingFeature.setAddressingRequired(dde.isAddressingRequired()); addressingFeature.setResponses(dde.getAddressingResponses()); endpoint.getFeatures().add(addressingFeature);
/** * Creates a vas subscriber web service proxy based on the delivery address. * * @param deliveryAddress delivery address * @return subscriber web service proxy */ public VasSubscriberService createVasSubscriberService(String deliveryAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(VasSubscriberService.class); factory.setAddress(deliveryAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); VasSubscriberService vasSubscriberService = (VasSubscriberService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) vasSubscriberService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return vasSubscriberService; }
RMClient client = new RMClient(bus, endpoint, cs); WSAddressingFeature wsa = new WSAddressingFeature(); wsa.setAddressingRequired(true); wsa.initialize(client, bus); Map<String, Object> context = client.getRequestContext(); context.put(MAPAggregator.ADDRESSING_NAMESPACE, protocol.getWSANamespace());
@Test public void testEchoProviderAsyncDecoupledEndpoints() throws Exception { String requestString = "<echo/>"; Service service = Service.create(serviceName); service.addPort(fakePortName, javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:" + PORT + "/SoapContext/AsyncEchoProvider"); Dispatch<StreamSource> dispatcher = service.createDispatch(fakePortName, StreamSource.class, Service.Mode.PAYLOAD, new LoggingFeature()); Client client = ((DispatchImpl<StreamSource>)dispatcher).getClient(); WSAddressingFeature wsAddressingFeature = new WSAddressingFeature(); wsAddressingFeature.initialize(client, client.getBus()); dispatcher.getRequestContext().put("org.apache.cxf.ws.addressing.replyto", "http://localhost:" + CLIENT_PORT + "/SoapContext/AsyncEchoClient"); StreamSource request = new StreamSource(new ByteArrayInputStream(requestString.getBytes())); StreamSource response = dispatcher.invoke(request); assertEquals(requestString, StaxUtils.toString(response)); } }
/** * Creates a charging station web service proxy. * * @param chargingStationAddress address of the charging station. * @return charging station web service proxy */ public ChargePointService createChargingStationService(String chargingStationAddress) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ChargePointService.class); factory.setAddress(chargingStationAddress); SoapBindingConfiguration conf = new SoapBindingConfiguration(); conf.setVersion(Soap12.getInstance()); factory.setBindingConfig(conf); factory.getFeatures().add(new WSAddressingFeature()); ChargePointService chargePointService = (ChargePointService) factory.create(); //Force the use of the Async transport, even for synchronous calls ((BindingProvider) chargePointService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE); return chargePointService; }