use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class MtomTest method setupForTest.
private void setupForTest(boolean enableClientMTOM) throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
aegisBinding.setMtomEnabled(enableClientMTOM);
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
proxyFac.setDataBinding(aegisBinding);
proxyFac.setAddress("http://localhost:" + PORT + "/mtom");
JaxWsProxyFactoryBean jaxwsFac = new JaxWsProxyFactoryBean();
jaxwsFac.setDataBinding(new AegisDatabinding());
jaxwsFac.setAddress("http://localhost:" + PORT + "/jaxWsMtom");
Map<String, Object> props = new HashMap<>();
if (enableClientMTOM) {
props.put("mtom-enabled", Boolean.TRUE);
}
proxyFac.setProperties(props);
client = proxyFac.create(MtomTestService.class);
jaxwsClient = jaxwsFac.create(MtomTestService.class);
impl = (MtomTestImpl) applicationContext.getBean("mtomImpl");
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class DefaultServiceBuilderFactory method newBuilder.
@Override
public ServiceBuilder newBuilder(FrontendFactory.Style s) {
DataBinding dataBinding;
final String dbn = getDatabindingName();
if (ToolConstants.JAXB_DATABINDING.equals(dbn)) {
dataBinding = new JAXBDataBinding();
} else if (ToolConstants.AEGIS_DATABINDING.equals(dbn)) {
dataBinding = new AegisDatabinding();
} else {
throw new ToolException("Unsupported databinding: " + dbn);
}
AbstractServiceFactory builder = null;
if (Style.Jaxws.equals(s)) {
builder = new JaxwsServiceBuilder();
} else if (Style.Simple.equals(s)) {
builder = new SimpleServiceBuilder();
} else {
throw new ToolException("Unsupported frontend style: " + s);
}
builder.setDataBinding(dataBinding);
builder.setServiceClass(serviceClass);
return builder;
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class AegisClientServerTest method testGenericPair.
@Test
public void testGenericPair() 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();
Pair<String, Integer> ret = service.getReturnGenericPair("ffang", 111);
assertEquals("ffang", ret.getFirst());
assertEquals(new Integer(111), ret.getSecond());
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class AegisClientServerTest method testQualifiedPair.
@Test
public void testQualifiedPair() 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.getQualifiedPair(new Pair<Integer, String>(111, "ffang"));
assertEquals(111, ret);
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class AegisJaxWsTest method setupForTest.
private void setupForTest(boolean sec) throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(AegisJaxWs.class);
if (sec) {
factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsUN");
WSS4JOutInterceptor wss4jOut = new WSS4JOutInterceptor();
wss4jOut.setProperty("action", "UsernameToken");
wss4jOut.setProperty("user", "alice");
wss4jOut.setProperty("password", "pass");
factory.setProperties(new HashMap<String, Object>());
factory.getProperties().put("password", "pass");
factory.getOutInterceptors().add(wss4jOut);
} else {
factory.setAddress("http://localhost:" + PORT + "/aegisJaxWs");
}
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
client = (AegisJaxWs) factory.create();
}
Aggregations