use of org.apache.cxf.jaxws.service.AddNumbers in project cxf by apache.
the class SEIWithJAXBAnnoTest method testXMLList.
@Test
public void testXMLList() throws Exception {
AddNumbersImpl serviceImpl = new AddNumbersImpl();
Endpoint.publish("local://localhost:9000/Hello", serviceImpl);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setBus(BusFactory.getDefaultBus());
factory.setServiceClass(AddNumbers.class);
factory.setAddress(address);
AddNumbers proxy = (AddNumbers) factory.create();
StringWriter strWriter = new StringWriter();
LoggingOutInterceptor log = new LoggingOutInterceptor(new PrintWriter(strWriter));
ClientProxy.getClient(proxy).getOutInterceptors().add(log);
List<String> args = new ArrayList<>();
args.add("str1");
args.add("str2");
args.add("str3");
List<Integer> result = proxy.addNumbers(args);
String expected = "<arg0>str1 str2 str3</arg0>";
assertTrue("Client does not use the generated wrapper class to marshal request parameters", strWriter.toString().indexOf(expected) > -1);
assertEquals("Get the wrong result", 100, (int) result.get(0));
}
Aggregations