Package org.apache.camel.non_wrapper.types

Examples of org.apache.camel.non_wrapper.types.GetPerson


        Person client = ss.getSoap();
        ((BindingProvider)client).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                 "http://localhost:" + port1 + "/CxfNonWrapperTest/PersonService/");
       
        GetPerson request = new GetPerson();
        request.setPersonId("hello");
        GetPersonResponse response = client.getPerson(request);

        assertEquals("we should get the right answer from router", "Bonjour", response.getName());

        request.setPersonId("");
        try {
            client.getPerson(request);
            fail("We expect to get the UnknowPersonFault here");
        } catch (UnknownPersonFault fault) {
            // We expect to get fault here
View Full Code Here


        Person client = ss.getSoap();
        ((BindingProvider)client).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                 "http://localhost:" + port1 + "/PersonService/");
       
        GetPerson request = new GetPerson();
        request.setPersonId("hello");
        GetPersonResponse response = client.getPerson(request);

        assertEquals("we should get the right answer from router", "Bonjour", response.getName());

        request.setPersonId("");
        try {
            client.getPerson(request);
            fail("We expect to get the UnknowPersonFault here");
        } catch (UnknownPersonFault fault) {
            // We expect to get fault here
View Full Code Here

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setAddress("http://localhost:" + getPort1() + "/"
                        + getClass().getSimpleName() + "/CamelContext/RouterPort");
        factory.setServiceClass(Person.class);
        Person person = factory.create(Person.class);
        GetPerson payload = new GetPerson();
        payload.setPersonId("1234");
       
        GetPersonResponse reply = person.getPerson(payload);
        assertEquals("Get the wrong person id.", "1234",  reply.getPersonId());
       
    }
View Full Code Here

                    @Override
                    public void process(Exchange exchange) throws Exception {
                        // just try to turn the payload to the parameter we want
                        // to use
                        GetPerson request = exchange.getIn().getBody(GetPerson.class);

                        GetPersonResponse reply = new GetPersonResponse();
                        reply.setPersonId(request.getPersonId());
                        exchange.getOut().setBody(reply);
                    }

                });
            }
View Full Code Here

        BindingOperationInfo boi = (BindingOperationInfo)exchange.getProperty(BindingOperationInfo.class.getName());
        if (boi != null) {
            LOG.info("boi.isUnwrapped" + boi.isUnwrapped());
        }

        GetPerson person =  exchange.getIn().getBody(GetPerson.class);
        String personId = person.getPersonId();
        GetPersonResponse response = new GetPersonResponse();

        if (personId == null || personId.length() == 0) {
            LOG.info("person id 123, so throwing exception");
            // Try to throw out the soap fault message
View Full Code Here

        Person client = ss.getSoap();
        ((BindingProvider)client).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                 "http://localhost:" + port1 + "/CxfNonWrapperTest/PersonService/");
       
        GetPerson request = new GetPerson();
        request.setPersonId("hello");
        GetPersonResponse response = client.getPerson(request);

        assertEquals("we should get the right answer from router", "Bonjour", response.getName());

        request.setPersonId("");
        try {
            client.getPerson(request);
            fail("We expect to get the UnknowPersonFault here");
        } catch (UnknownPersonFault fault) {
            // We expect to get fault here
View Full Code Here

        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setAddress("http://localhost:" + getPort1() + "/"
                        + getClass().getSimpleName() + "/CamelContext/RouterPort");
        factory.setServiceClass(Person.class);
        Person person = factory.create(Person.class);
        GetPerson payload = new GetPerson();
        payload.setPersonId("1234");
       
        GetPersonResponse reply = person.getPerson(payload);
        assertEquals("Get the wrong person id.", "1234",  reply.getPersonId());
       
    }
View Full Code Here

                    @Override
                    public void process(Exchange exchange) throws Exception {
                        // just try to turn the payload to the parameter we want
                        // to use
                        GetPerson request = exchange.getIn().getBody(GetPerson.class);

                        GetPersonResponse reply = new GetPersonResponse();
                        reply.setPersonId(request.getPersonId());
                        exchange.getOut().setBody(reply);
                    }

                });
            }
View Full Code Here

TOP

Related Classes of org.apache.camel.non_wrapper.types.GetPerson

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.