Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.LoggingOutInterceptor


        WebClient client = bean.createWebClient();
        HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
        conduit.getClient().setReceiveTimeout(1000000);
        conduit.getClient().setConnectionTimeout(1000000);
        WebClient.getConfig(client).getInInterceptors().add(new LoggingInInterceptor());
        WebClient.getConfig(client).getOutInterceptors().add(new LoggingOutInterceptor());
        client.type("multipart/related").accept("multipart/related");
       
        XopType xop = new XopType();
        xop.setName("xopName");
        InputStream is =
View Full Code Here


      bus = bf
          .createBus("/org/apache/servicemix/camel/ws/policy/addr.xml");
        LoggingInInterceptor in = new LoggingInInterceptor();
        bus.getInInterceptors().add(in);
        bus.getInFaultInterceptors().add(in);
        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
        URL wsdl = getClass().getResource("/wsdl/greeter_control.wsdl");
        QName serviceName = new QName("http://cxf.apache.org/greeter_control",
                                      "BasicGreeterService");
View Full Code Here

        bus = bf.createBus("/org/apache/servicemix/camel/ws/rm/decoupled.xml");
      BusFactory.setDefaultBus(bus);
      LoggingInInterceptor in = new LoggingInInterceptor();
        bus.getInInterceptors().add(in);
        bus.getInFaultInterceptors().add(in);
        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
        QName serviceName = new QName("http://cxf.apache.org/greeter_control", "GreeterService");
        URL wsdl = new ClassPathResource("/wsdl/greeter_control.wsdl").getURL();
        GreeterService gs = new GreeterService(wsdl, serviceName);
View Full Code Here

        String address = "http://localhost:9001/providertest";
        factory.setAddress(address);
        Server server = factory.create();
        Endpoint endpoint = server.getEndpoint();
        endpoint.getInInterceptors().add(new LoggingInInterceptor());
        endpoint.getOutInterceptors().add(new LoggingOutInterceptor());
        ServiceInfo service = endpoint.getEndpointInfo().getService();
        assertNotNull(service);
        client = new DefaultServiceMixClient(jbi);
        io = client.createInOutExchange();
        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPServiceProvider"));
        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
        //send message to proxy
        io.getInMessage().setContent(new StringSource(
                "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
              + "<part> "
              + "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
              + "ffang"
              + "</requestType></greetMe>"
              + "</part> "
              + "</message>"));
        client.sendSync(io);
        assertTrue(new SourceTransformer().contentToString(
                io.getOutMessage()).indexOf("Hello ffang 3") >= 0);

        //test exception handle
        io = client.createInOutExchange();
        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPServiceProvider"));
        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
        io.getInMessage().setContent(new StringSource(
                "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
              + "<part> "
              + "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
              + "exception test"
              + "</requestType></greetMe>"
              + "</part> "
              + "</message>"));
        client.sendSync(io);
        assertTrue(new SourceTransformer().contentToString(
                io.getOutMessage()).indexOf("Hello exception test Negative number cant be added!") >= 0);
       
        //test onway
        factory = new JaxWsServerFactoryBean();
        factory.setServiceClass(Greeter.class);
        factory.setServiceBean(new GreeterImpl());
        address = "http://localhost:9002/providertest_oneway";
        factory.setAddress(address);
        server = factory.create();
        endpoint = server.getEndpoint();
        endpoint.getInInterceptors().add(new LoggingInInterceptor());
        endpoint.getOutInterceptors().add(new LoggingOutInterceptor());
        service = endpoint.getEndpointInfo().getService();
        assertNotNull(service);
        io = client.createInOutExchange();
        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPServiceProvider"));
        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
View Full Code Here

                "org/apache/servicemix/camel/ws/security/client.xml");
        BusFactory.setDefaultBus(bus);
        LoggingInInterceptor in = new LoggingInInterceptor();
        bus.getInInterceptors().add(in);
        bus.getInFaultInterceptors().add(in);
        LoggingOutInterceptor out = new LoggingOutInterceptor();
        bus.getOutInterceptors().add(out);
        bus.getOutFaultInterceptors().add(out);
        final javax.xml.ws.Service svc = javax.xml.ws.Service.create(WSDL_LOC,
                new javax.xml.namespace.QName(
                        "http://apache.org/hello_world_soap_http",
View Full Code Here

        QName endpoint = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
        service1.addPort(endpoint,
                SOAPBinding.SOAP12HTTP_BINDING, "http://localhost:19000/SoapContext/SoapPort");
        Greeter greeter = service1.getPort(endpoint, Greeter.class);
        ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
        ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
        String ret = greeter.sayHi();
        assertEquals(ret, "Bonjour");
        String noSuchCodeFault = "NoSuchCodeLitFault";
        String badRecordFault = "BadRecordLitFault";
        try {
View Full Code Here

        QName endpoint = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
        service1.addPort(endpoint,
                SOAPBinding.SOAP12HTTP_BINDING, "http://localhost:19000/SoapContext/SoapPort");
        Greeter greeter = service1.getPort(endpoint, Greeter.class);
        ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
        ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
        greeter.greetMeOneWay("test oneway");
    }
View Full Code Here

        System.out.println(wsdlURL);
        PersonService ss = new PersonService(wsdlURL, new QName("http://servicemix.apache.org/samples/wsdl-first",
      "PersonService"));
        Person client = ss.getSoap();
        ClientProxy.getClient(client).getOutInterceptors().add(new LoggingOutInterceptor());
        ClientProxy.getClient(client).getInInterceptors().add(new LoggingInInterceptor());
        Holder<String> personId = new Holder<String>();
        personId.value = "world";
        Holder<String> ssn = new Holder<String>();
        Holder<String> name = new Holder<String>();
View Full Code Here

        WebClient client = bean.createWebClient();
        HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
        conduit.getClient().setReceiveTimeout(1000000);
        conduit.getClient().setConnectionTimeout(1000000);
        WebClient.getConfig(client).getInInterceptors().add(new LoggingInInterceptor());
        WebClient.getConfig(client).getOutInterceptors().add(new LoggingOutInterceptor());
        client.type("multipart/related").accept("multipart/related");
       
        XopType xop = new XopType();
        xop.setName("xopName");
        InputStream is =
View Full Code Here

   
    @Test
    public void testAddBookJaxbJsonImageWebClientRelated2() throws Exception {
        String address = "http://localhost:" + PORT + "/bookstore/books/jaxbimagejson";
        WebClient client = WebClient.create(address);
        WebClient.getConfig(client).getOutInterceptors().add(new LoggingOutInterceptor());
        WebClient.getConfig(client).getInInterceptors().add(new LoggingInInterceptor());
        client.type("multipart/mixed").accept("multipart/mixed");
      
        Book jaxb = new Book("jaxb", 1L);
        Book json = new Book("json", 2L);
View Full Code Here

TOP

Related Classes of org.apache.cxf.interceptor.LoggingOutInterceptor

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.