Search in sources :

Example 1 with HWByteMsgService

use of org.apache.cxf.hello_world_jms.HWByteMsgService in project cxf by apache.

the class JMSClientServerTest method testByteMessage.

@Test
public void testByteMessage() throws Exception {
    QName serviceName = new QName("http://cxf.apache.org/hello_world_jms", "HWByteMsgService");
    URL wsdl = getWSDLURL("/wsdl/jms_test.wsdl");
    HWByteMsgService service = new HWByteMsgService(wsdl, serviceName);
    String response1 = new String("Hello Milestone-");
    String response2 = new String("Bonjour");
    HelloWorldPortType greeter = service.getHWSByteMsgPort();
    for (int idx = 0; idx < 2; idx++) {
        String greeting = greeter.greetMe("Milestone-" + idx);
        assertNotNull("no response received from service", greeting);
        String exResponse = response1 + idx;
        assertEquals(exResponse, greeting);
        String reply = greeter.sayHi();
        assertNotNull("no response received from service", reply);
        assertEquals(response2, reply);
    }
    ((java.io.Closeable) greeter).close();
}
Also used : QName(javax.xml.namespace.QName) Closeable(java.io.Closeable) HelloWorldPortType(org.apache.cxf.hello_world_jms.HelloWorldPortType) HWByteMsgService(org.apache.cxf.hello_world_jms.HWByteMsgService) URL(java.net.URL) Endpoint(javax.xml.ws.Endpoint) Test(org.junit.Test)

Aggregations

Closeable (java.io.Closeable)1 URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Endpoint (javax.xml.ws.Endpoint)1 HWByteMsgService (org.apache.cxf.hello_world_jms.HWByteMsgService)1 HelloWorldPortType (org.apache.cxf.hello_world_jms.HelloWorldPortType)1 Test (org.junit.Test)1