use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.
the class Soap12ClientServerTest method testPingMeFault.
@Test
public void testPingMeFault() throws Exception {
Greeter greeter = getGreeter();
try {
greeter.pingMe();
fail("Should throw Exception!");
} catch (PingMeFault ex) {
FaultDetail detail = ex.getFaultInfo();
assertEquals((short) 2, detail.getMajor());
assertEquals((short) 1, detail.getMinor());
assertEquals("PingMeFault raised by server", ex.getMessage());
}
}
use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.
the class Soap12ClientServerTest method testFaultMessage.
@Test
public void testFaultMessage() throws Exception {
Greeter greeter = getGreeter();
try {
greeter.sayHi();
fail("Should throw Exception!");
} catch (SOAPFaultException ex) {
assertEquals("sayHiFault Caused by: Get a wrong name <sayHi>", ex.getMessage());
StackTraceElement[] element = ex.getCause().getStackTrace();
assertEquals("org.apache.cxf.systest.soapfault.details.GreeterImpl12", element[0].getClassName());
}
}
use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.
the class Soap12ClientServerTest method getGreeter.
private Greeter getGreeter() throws NumberFormatException, MalformedURLException {
URL wsdl = getClass().getResource("/wsdl/hello_world_soap12.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull("Service is ull ", service);
Greeter g = service.getPort(portName, Greeter.class);
updateAddressPort(g, PORT);
return g;
}
use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.
the class Soap12ClientServerTest method testBasicConnection.
@Test
public void testBasicConnection() throws Exception {
Greeter greeter = getGreeter();
for (int i = 0; i < 5; i++) {
String echo = greeter.sayHi();
assertEquals("Bonjour", echo);
}
}
use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.
the class Soap12ClientServerTest method getGreeter.
private Greeter getGreeter() throws NumberFormatException, MalformedURLException {
URL wsdl = getClass().getResource("/wsdl/hello_world_soap12.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull("Service is ull ", service);
Greeter g = service.getPort(portName, Greeter.class);
updateAddressPort(g, PORT);
return g;
}
Aggregations