use of org.apache.camel.non_wrapper.Person in project camel by apache.
the class PayLoadConvertToPOJOTest method testClient.
@Test
public void testClient() throws Exception {
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());
}
use of org.apache.camel.non_wrapper.Person in project camel by apache.
the class TestCamel1145Route method testCamel1145Route.
@Test
public void testCamel1145Route() throws Exception {
URL wsdlURL = new URL("http://localhost:9000/PersonService/?wsdl");
PersonService ss = new PersonService(wsdlURL, new QName("http://camel.apache.org/non-wrapper", "PersonService"));
Person client = ss.getSoap();
GetPerson request = new GetPerson();
request.setPersonId("hello");
GetPersonResponse response = client.getPerson(request);
assertEquals("we should get the right answer from router", "Bill", response.getName());
assertEquals("we should get the right answer from router", "Test", response.getSsn());
assertEquals("we should get the right answer from router", "hello world!", response.getPersonId());
}
use of org.apache.camel.non_wrapper.Person in project camel by apache.
the class CxfNonWrapperTest method testInvokingServiceFromCXFClient.
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
URL wsdlURL = getClass().getClassLoader().getResource("person-non-wrapper.wsdl");
PersonService ss = new PersonService(wsdlURL, new QName("http://camel.apache.org/non-wrapper", "PersonService"));
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
}
}
Aggregations