use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class UDPTransportTest method testFailure.
@Test
public void testFailure() throws Exception {
if ("Mac OS X".equals(System.getProperties().getProperty("os.name")) && !JavaUtils.isJava11Compatible()) {
// Seems to fail fairly consistently on OSX on Java 8 with newer versions of OSX
// java11 seems to be OK
System.out.println("Skipping failure test for OSX");
return;
}
JaxWsProxyFactoryBean fact = new JaxWsProxyFactoryBean();
fact.setAddress("udp://localhost:" + PORT);
Greeter g = fact.create(Greeter.class);
try {
g.pingMe();
fail("Expected SOAPFaultException");
} catch (SOAPFaultException ex) {
// expected
}
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class UDPTransportTest method testLargeRequest.
@Test
public void testLargeRequest() throws Exception {
JaxWsProxyFactoryBean fact = new JaxWsProxyFactoryBean();
fact.setAddress("udp://localhost:" + PORT);
Greeter g = fact.create(Greeter.class);
StringBuilder b = new StringBuilder(100000);
for (int x = 0; x < 6500; x++) {
b.append("Hello ");
}
assertEquals("Hello " + b.toString(), g.greetMe(b.toString()));
((java.io.Closeable) g).close();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class DOMToStaxRoundTripTest method createClientProxy.
private Echo createClientProxy() {
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setServiceClass(Echo.class);
proxyFac.setAddress("local://Echo");
proxyFac.getClientFactoryBean().setTransportId(LocalTransportFactory.TRANSPORT_ID);
return (Echo) proxyFac.create();
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class RoundTripTest method setUpService.
@Before
public void setUpService() throws Exception {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceBean(new EchoImpl());
factory.setAddress("local://Echo");
factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
Server server = factory.create();
Service service = server.getEndpoint().getService();
service.getInInterceptors().add(new SAAJInInterceptor());
service.getInInterceptors().add(new LoggingInInterceptor());
service.getOutInterceptors().add(new SAAJOutInterceptor());
service.getOutInterceptors().add(new LoggingOutInterceptor());
wsIn = new WSS4JInInterceptor();
wsIn.setProperty(ConfigurationConstants.SIG_VER_PROP_FILE, "insecurity.properties");
wsIn.setProperty(ConfigurationConstants.DEC_PROP_FILE, "insecurity.properties");
wsIn.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.getInInterceptors().add(wsIn);
wsOut = new WSS4JOutInterceptor();
wsOut.setProperty(ConfigurationConstants.SIG_PROP_FILE, "outsecurity.properties");
wsOut.setProperty(ConfigurationConstants.ENC_PROP_FILE, "outsecurity.properties");
wsOut.setProperty(ConfigurationConstants.USER, "myalias");
wsOut.setProperty("password", "myAliasPassword");
wsOut.setProperty(ConfigurationConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.getOutInterceptors().add(wsOut);
// Create the client
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setServiceClass(Echo.class);
proxyFac.setAddress("local://Echo");
proxyFac.getClientFactoryBean().setTransportId(LocalTransportFactory.TRANSPORT_ID);
echo = (Echo) proxyFac.create();
client = ClientProxy.getClient(echo);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getInInterceptors().add(wsIn);
client.getInInterceptors().add(new SAAJInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getOutInterceptors().add(wsOut);
client.getOutInterceptors().add(new SAAJOutInterceptor());
}
use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project cxf by apache.
the class DOMToStaxSignatureIdentifierTest method createClientProxy.
private Echo createClientProxy() {
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setServiceClass(Echo.class);
proxyFac.setAddress("local://Echo");
proxyFac.getClientFactoryBean().setTransportId(LocalTransportFactory.TRANSPORT_ID);
return (Echo) proxyFac.create();
}
Aggregations