Refine search
final void initialize(Bus b, URL url, WebServiceFeature ... f) { if (b == null) { b = BusFactory.getThreadDefaultBus(true); bus.getExtension(ServiceContractResolverRegistry.class); if (null != registry) { URI uri = registry.getContractLocation(serviceName); wsdlURL = url == null ? null : url.toString();
@Override public void run() { if(serverFactoryBean.getServer()!= null) { serverFactoryBean.getServer().destroy(); } if(serverFactoryBean.getBus()!=null) { serverFactoryBean.getBus().shutdown(true); } } };
protected DestinationRegistry getDestinationRegistryFromBusOrDefault(final String transportId) { DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); try { String peferredTransportId = transportId; peferredTransportId = (String)getBus().getProperty(AbstractTransportFactory.PREFERRED_TRANSPORT_ID);
@org.junit.Test public void testSignedSAML() throws Exception { SpringBusFactory bf = new SpringBusFactory(); URL busFile = ActionTest.class.getResource("client.xml"); Bus bus = bf.createBus(busFile.toString()); BusFactory.setDefaultBus(bus); BusFactory.setThreadDefaultBus(bus); URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl"); Service service = Service.create(wsdl, SERVICE_QNAME); QName portQName = new QName(NAMESPACE, "DoubleItSignedSAMLPort"); DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class); updateAddressPort(port, PORT); assertEquals(50, port.doubleIt(25)); ((java.io.Closeable)port).close(); bus.shutdown(true); }
@Test public void testHttpWrappedContinuations() throws Exception { SpringBusFactory bf = new SpringBusFactory(); Bus bus = bf.createBus(CLIENT_CONFIG_FILE); BusFactory.setDefaultBus(bus); QName serviceName = new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService"); URL wsdlURL = new URL("http://localhost:" + PORT + "/hellocontinuation?wsdl"); HelloContinuationService service = new HelloContinuationService(wsdlURL, serviceName); assertNotNull(service); final HelloContinuation helloPort = service.getHelloContinuationPort(); doTest(helloPort); bus.shutdown(true); }
@Test public void testClientServer() throws Exception { Bus bus = new SpringBusFactory().createBus("org/apache/cxf/systest/ws/security/handler/client.xml"); BusFactory.setDefaultBus(bus); BusFactory.setThreadDefaultBus(bus); Service service = Service.create(new URL("http://localhost:" + PORT + "/wsse/HelloWorldWS?wsdl"), new QName("http://cxf.apache.org/wsse/handler/helloworld", "HelloWorldImplService")); QName portName = new QName("http://cxf.apache.org/wsse/handler/helloworld", "HelloWorldPort"); HelloWorld port = service.getPort(portName, HelloWorld.class); updateAddressPort(port, PORT); assertEquals("Hello CXF", port.sayHello("CXF")); bus.shutdown(true); }
Bus bus = BusFactory.getThreadDefaultBus(); WSDLManager wsdlManager = bus.getExtension(WSDLManager.class); try { Definition def = wsdlManager.getDefinition(wsdlDocumentLocation); interfaceName = def.getService(serviceName).getPort(portName.getLocalPart()).getBinding() .getPortType().getQName(); } catch (Exception e) { ? serviceName.getNamespaceURI() + " " + wsdlDocumentLocation : wsdlDocumentLocation; writer.writeNamespace(JAXWSAConstants.WSDLI_PFX, JAXWSAConstants.WSAM_INTERFACE_NAME, JAXWSAConstants.NS_WSAM); String portTypePrefix = interfaceName.getPrefix(); if (portTypePrefix == null || portTypePrefix.isEmpty()) { portTypePrefix = "ns1";
protected ClassLoader initClassLoader() { return bus.getExtension(ClassLoader.class); }
private static synchronized MAPCodec createMAPCodec(Bus bus) { MAPCodec mc = bus.getExtension(MAPCodec.class); if (mc == null) { bus.setExtension(new MAPCodec(), MAPCodec.class); mc = bus.getExtension(MAPCodec.class); } return mc; }
@org.junit.Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
public void setUpBus(String port) throws Exception { SpringBusFactory bf = new SpringBusFactory(); bus = bf.createBus("org/apache/cxf/systest/ws/policy/rmwsdl.xml"); BusFactory.setDefaultBus(bus); outRecorder = new OutMessageRecorder(); bus.getOutInterceptors().add(outRecorder); inRecorder = new InMessageRecorder(); bus.getInInterceptors().add(inRecorder); } }
public void loadBus(ServletConfig servletConfig) { this.bus = BusFactory.newInstance().createBus(); Bus bus = getBus(); HeaderManager headerManager = bus.getExtension(HeaderManager.class); headerManager.registerHeaderProcessor(new HeaderProcessor() { @Override BusFactory.setDefaultBus(bus);
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
@org.junit.Before public void setUp() { BusFactory.setThreadDefaultBus(getStaticBus()); BusFactory.getThreadDefaultBus().getOutInterceptors().add(new LoggingOutInterceptor()); BusFactory.getThreadDefaultBus().getInInterceptors().add(new LoggingInInterceptor()); BusFactory.getThreadDefaultBus().getInInterceptors().add(new MalformedResponseInterceptor()); }
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getInInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getInInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getInInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3); chain.add(new ClientResponseFilterInterceptor()); return chain; }
public synchronized void removeBusInterceptors() { bus.getInInterceptors().remove(PolicyInInterceptor.INSTANCE); bus.getOutInterceptors().remove(PolicyOutInterceptor.INSTANCE); bus.getInFaultInterceptors().remove(ClientPolicyInFaultInterceptor.INSTANCE); bus.getOutFaultInterceptors().remove(ServerPolicyOutFaultInterceptor.INSTANCE); bus.getInFaultInterceptors().remove(PolicyVerificationInFaultInterceptor.INSTANCE); addedBusInterceptors = false; }
void registerInterceptorsToBus() { ResponseTimeMessageInInterceptor in = new ResponseTimeMessageInInterceptor(); ResponseTimeMessageInvokerInterceptor invoker = new ResponseTimeMessageInvokerInterceptor(); ResponseTimeMessageOutInterceptor out = new ResponseTimeMessageOutInterceptor(); bus.getInInterceptors().add(in); bus.getInInterceptors().add(invoker); bus.getOutInterceptors().add(out); bus.getOutFaultInterceptors().add(out); bus.setExtension(this, CounterRepository.class); //create CounterRepositroyMoniter to writer the counter log //if the service is stopped or removed, the counters should remove itself }
/** * @param b Bus to encapsulate */ public final void setBus(Bus b) { bus = b; if (bus != null) { bus.setExtension(this, EndpointResolverRegistry.class); } }
public FormattedServiceListWriter(String styleSheetPath, String title, boolean showForeignContexts, Bus bus) { this.styleSheetPath = styleSheetPath; this.title = title; this.showForeignContexts = showForeignContexts; this.bus = bus; if (this.bus != null) { this.atomMap = CastUtils.cast((Map<?, ?>)this.bus.getProperty("org.apache.cxf.extensions.logging.atom.pull")); } }
protected void run() { Bus bus = BusFactory.getDefaultBus(); setBus(bus); Map<String, Object> inProperties = new HashMap<>(); inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SAML_TOKEN_SIGNED); inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new KeystorePasswordCallback()); inProperties.put(ConfigurationConstants.SIG_VER_PROP_FILE, "bob.properties"); WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties); bus.getInInterceptors().add(inInterceptor); broker.updateWsdl(bus, "testutils/jms_test.wsdl"); Endpoint.publish(null, new SecurityGreeterImplTwoWayJMS()); }