Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsProxyFactoryBean


            + "?jndiInitialContextFactory"
            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
            + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:"
            + JMS_PORT;

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
        factory.setServiceClass(Hello.class);
        factory.setAddress(address);
        Hello client = (Hello)factory.create();
        String reply = client.sayHi(" HI");
        assertEquals(reply, "get HI");
    }
View Full Code Here


        }
        location = EndpointReferenceUtils.getAddress(ref);
        String mexLoc = findMEXLocation(ref);
        if (mexLoc != null) {
            try {
                JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
                proxyFac.setAddress(mexLoc);
                MetadataExchange exc = proxyFac.create(MetadataExchange.class);
                Metadata metadata = exc.get2004();
                for (MetadataSection s : metadata.getMetadataSection()) {
                    if ("http://schemas.xmlsoap.org/wsdl/".equals(s.getDialect())) {
                        //got the wsdl...
                        Definition definition = bus.getExtension(WSDLManager.class)
View Full Code Here

       
        assertTrue("server did not launch correctly", launchServer(Server.class));
    }
    @Test
    public void testSwa() throws Exception {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setWsdlLocation("classpath:wsdl/swa-mime.wsdl");
        factory.setTransportId("http://cxf.apache.org/transports/jms");
        factory.setServiceName(new QName("http://cxf.apache.org/swa", "SwAService"));
        factory.setEndpointName(new QName("http://cxf.apache.org/swa", "SwAServiceHttpPort"));
        factory.setAddress(Server.ADDRESS);
        factory.getOutInterceptors().add(new LoggingOutInterceptor());
        SwAService port = factory.create(SwAService.class);
       
       
        Holder<String> textHolder = new Holder<String>();
        Holder<DataHandler> data = new Holder<DataHandler>();
       
View Full Code Here

            wsdlLocation = wsdlLoc;
        }
        String mexLoc = findMEXLocation(ref, useEPRWSAAddrAsMEXLocation);
        if (mexLoc != null) {
            try {
                JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
                proxyFac.setAddress(mexLoc);
                MetadataExchange exc = proxyFac.create(MetadataExchange.class);
                Metadata metadata = exc.get2004();
                for (MetadataSection s : metadata.getMetadataSection()) {
                    if ("http://schemas.xmlsoap.org/wsdl/".equals(s.getDialect())) {
                        //got the wsdl...
                        Definition definition = bus.getExtension(WSDLManager.class)
View Full Code Here

        assertTrue(saaj);
        assertTrue(logging);

        assertTrue(client.getEndpoint().getService().getDataBinding() instanceof SourceDataBinding);

        JaxWsProxyFactoryBean factory = (JaxWsProxyFactoryBean)ctx.getBean("wsdlLocation.proxyFactory");
        assertNotNull(factory);
        String wsdlLocation = factory.getWsdlLocation();
        assertEquals("We should get the right wsdl location" , wsdlLocation, "wsdl/hello_world.wsdl");

        factory = (JaxWsProxyFactoryBean)ctx.getBean("inlineSoapBinding.proxyFactory");
        assertNotNull(factory);

        BindingConfiguration bc = factory.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);
        assertTrue("the soap configure should set isMtomEnabled to be true",
                   sbc.isMtomEnabled());
View Full Code Here

        endpoint.publish("local://JaxWsEcho");
    }
   
    @Test
    public void talkToJaxWsHolder() throws Exception {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(Echo.class);
        factory.setDataBinding(new AegisDatabinding());
        factory.setAddress("local://JaxWsEcho");
        Echo client = (Echo) factory.create();
        Holder<String> sholder = new Holder<String>();
        client.echo("Channa Doll", sholder);
        assertEquals("Channa Doll", sholder.value);
    }
View Full Code Here

            + "?jndiInitialContextFactory"
            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
            + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:"
            + JMS_PORT;

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
        factory.setServiceClass(Hello.class);
        factory.setAddress(address);
        Hello client = (Hello)factory.create();
        String reply = client.sayHi(" HI");
        assertEquals(reply, "get HI");
    }
View Full Code Here

        Greeter greeter = service.getPort(portName, Greeter.class);
        doService(greeter, true);
    }
    @Test
    public void testNonAopTransaction() throws Exception {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(Greeter.class);
        factory.setAddress("jms://");

        JMSConfiguration jmsConfig = new JMSConfiguration();
        ConnectionFactory connectionFactory
            = new org.apache.activemq.ActiveMQConnectionFactory("tcp://localhost:" + JMS_PORT);
        jmsConfig.setConnectionFactory(connectionFactory);
        jmsConfig.setTargetDestination("greeter.queue.noaop");
        jmsConfig.setPubSubDomain(false);
        jmsConfig.setUseJms11(true);

        JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
        jmsConfigFeature.setJmsConfig(jmsConfig);
        factory.getFeatures().add(jmsConfigFeature);

        Greeter greeter = (Greeter)factory.create();
        doService(greeter, false);
    }   
View Full Code Here

    // CXF-2093 reports an explosion with this case.
    @Test
    public void testClientSetup() throws Exception {

        JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
        clientFactory.setAddress("local:not-really");
        clientFactory.setServiceClass(Service.class);

        AegisDatabinding dataBinding = new AegisDatabinding();

        NoDefaultConstructorBeanTypeRegistrar beanRegistrar
            = new NoDefaultConstructorBeanTypeRegistrar();
        beanRegistrar.setDataBinding(dataBinding);
        beanRegistrar.register();

        NoDefaultConstructorBeanKeyTypeRegistrar beanKeyRegistrar
            = new NoDefaultConstructorBeanKeyTypeRegistrar();
        beanKeyRegistrar.setDataBinding(dataBinding);
        beanKeyRegistrar.register();

        clientFactory.setDataBinding(dataBinding);

        clientFactory.create();
        String uri = dataBinding.getAegisContext().getTypeMapping().getMappingIdentifierURI();
        assertNotSame(DefaultTypeMapping.DEFAULT_MAPPING_URI, uri);
    }
View Full Code Here

        endpoint.publish("local://JaxWsEcho");
    }

    @Test
    public void talkToJaxWsHolder() throws Exception {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setDataBinding(new AegisDatabinding());
        factory.setAddress("local://JaxWsEcho");
        Echo client = (Echo) factory.create(Echo.class);
        Holder<String> sholder = new Holder<String>();
        client.echo("Channa Doll", sholder);
        assertEquals("Channa Doll", sholder.value);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.JaxWsProxyFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.