use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class TestUtils method createResourceClient.
protected static Resource createResourceClient(EndpointReferenceType ref) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(Resource.class);
factory.setAddress(ref.getAddress().getValue());
Resource proxy = (Resource) factory.create();
// Add reference parameters
AddressingProperties addrProps = new AddressingProperties();
addrProps.setTo(ref);
((BindingProvider) proxy).getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
return proxy;
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class AegisClientServerTest method testComplexMapResult.
@Test
public void testComplexMapResult() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
Map<String, Map<Integer, Integer>> result = service.testComplexMapResult();
assertEquals(result.size(), 1);
assertTrue(result.containsKey("key1"));
assertNotNull(result.get("key1"));
assertEquals(result.toString(), "{key1={1=3}}");
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class AegisClientServerTest method testCollection.
@Test
public void testCollection() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setWsdlLocation("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
Collection<Team> teams = service.getTeams();
assertEquals(1, teams.size());
assertEquals("Patriots", teams.iterator().next().getName());
// CXF-1251
String s = service.testForMinOccurs0("A", null, "b");
assertEquals("Anullb", s);
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class AegisClientServerTest method testReturnGenericPair.
@Test
public void testReturnGenericPair() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
int ret = service.getGenericPair(new Pair<Integer, String>(111, "String"));
assertEquals(111, ret);
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class AegisClientServerTest method testGenericCollection.
@Test
public void testGenericCollection() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
List<String> list = new ArrayList<>();
list.add("ffang");
String ret = service.getGeneric(list);
assertEquals(ret, "ffang");
}
Aggregations