Search in sources :

Example 1 with SOAPServiceTest1

use of org.apache.hello_world_soap_http.SOAPServiceTest1 in project cxf by apache.

the class JSClientServerTest method testJSPayloadMode.

@Test
public void testJSPayloadMode() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
    assertNotNull(wsdl);
    QName serviceName = new QName(NS, "SOAPService_Test1");
    QName portName = new QName(NS, "SoapPort_Test1");
    SOAPServiceTest1 service = new SOAPServiceTest1(wsdl, serviceName);
    assertNotNull(service);
    String response1 = new String("TestGreetMeResponse");
    String response2 = new String("TestSayHiResponse");
    try {
        Greeter greeter = service.getPort(portName, Greeter.class);
        updateAddressPort(greeter, JSX_PORT);
        String greeting = greeter.greetMe("TestGreetMeRequest");
        assertNotNull("no response received from service", greeting);
        assertEquals(response1, greeting);
        String reply = greeter.sayHi();
        assertNotNull("no response received from service", reply);
        assertEquals(response2, reply);
    } catch (UndeclaredThrowableException ex) {
        ex.printStackTrace();
        throw (Exception) ex.getCause();
    }
}
Also used : QName(javax.xml.namespace.QName) SOAPServiceTest1(org.apache.hello_world_soap_http.SOAPServiceTest1) Greeter(org.apache.hello_world_soap_http.Greeter) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) URL(java.net.URL) Test(org.junit.Test)

Aggregations

UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Greeter (org.apache.hello_world_soap_http.Greeter)1 SOAPServiceTest1 (org.apache.hello_world_soap_http.SOAPServiceTest1)1 Test (org.junit.Test)1