Search in sources :

Example 1 with PingMeFault

use of org.apache.hello_world_soap12_http.PingMeFault 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());
    }
}
Also used : PingMeFault(org.apache.hello_world_soap12_http.PingMeFault) Greeter(org.apache.hello_world_soap12_http.Greeter) FaultDetail(org.apache.hello_world_soap12_http.types.FaultDetail) Test(org.junit.Test)

Example 2 with PingMeFault

use of org.apache.hello_world_soap12_http.PingMeFault in project cxf by apache.

the class GreeterImpl12 method pingMe.

public void pingMe() throws PingMeFault {
    FaultDetail faultDetail = new FaultDetail();
    faultDetail.setMajor((short) 2);
    faultDetail.setMinor((short) 1);
    LOG.info("Executing operation pingMe, throwing PingMeFault exception");
    System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
    throw new PingMeFault("PingMeFault raised by server", faultDetail);
}
Also used : PingMeFault(org.apache.hello_world_soap12_http.PingMeFault) FaultDetail(org.apache.hello_world_soap12_http.types.FaultDetail)

Example 3 with PingMeFault

use of org.apache.hello_world_soap12_http.PingMeFault in project cxf by apache.

the class GreeterImpl method pingMe.

public void pingMe() throws PingMeFault {
    FaultDetail faultDetail = new FaultDetail();
    faultDetail.setMajor((short) 2);
    faultDetail.setMinor((short) 1);
    LOG.info("Executing operation pingMe, throwing PingMeFault exception");
    // System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
    throw new PingMeFault("PingMeFault raised by server", faultDetail);
}
Also used : PingMeFault(org.apache.hello_world_soap12_http.PingMeFault) FaultDetail(org.apache.hello_world_soap12_http.types.FaultDetail)

Example 4 with PingMeFault

use of org.apache.hello_world_soap12_http.PingMeFault 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());
        StackTraceElement[] element = ex.getStackTrace();
        assertEquals("org.apache.cxf.systest.soapfault.details.GreeterImpl12", element[0].getClassName());
    }
}
Also used : PingMeFault(org.apache.hello_world_soap12_http.PingMeFault) Greeter(org.apache.hello_world_soap12_http.Greeter) FaultDetail(org.apache.hello_world_soap12_http.types.FaultDetail) Test(org.junit.Test)

Aggregations

PingMeFault (org.apache.hello_world_soap12_http.PingMeFault)4 FaultDetail (org.apache.hello_world_soap12_http.types.FaultDetail)4 Greeter (org.apache.hello_world_soap12_http.Greeter)2 Test (org.junit.Test)2