use of org.apache.hello_world_doc_lit.SOAPService2 in project cxf by apache.
the class JMSClientServerSoap12Test method testGzipEncodingWithJms.
@Test
public void testGzipEncodingWithJms() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService8");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort8");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = markForClose(service.getPort(portName, Greeter.class, cff));
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Milestone-" + idx);
Assert.assertEquals(new String("Hello Milestone-") + idx, greeting);
String reply = greeter.sayHi();
Assert.assertEquals("Bonjour", reply);
try {
greeter.pingMe();
Assert.fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
Assert.assertNotNull(ex.getFaultInfo());
}
}
}
use of org.apache.hello_world_doc_lit.SOAPService2 in project cxf by apache.
the class JMSClientServerSoap12Test method testWSAddressingWithJms.
@Test
public void testWSAddressingWithJms() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService8");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort8");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = markForClose(service.getPort(portName, Greeter.class, cff, new AddressingFeature()));
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Milestone-" + idx);
Assert.assertEquals(new String("Hello Milestone-") + idx, greeting);
String reply = greeter.sayHi();
Assert.assertEquals("Bonjour", reply);
try {
greeter.pingMe();
Assert.fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
Assert.assertNotNull(ex.getFaultInfo());
}
}
}
use of org.apache.hello_world_doc_lit.SOAPService2 in project cxf by apache.
the class JMSClientServerTest method testDocBasicConnection.
@Test
public void testDocBasicConnection() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService2");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort2");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
String response1 = new String("Hello Milestone-");
String response2 = new String("Bonjour");
Greeter greeter = service.getPort(portName, Greeter.class);
Client client = ClientProxy.getClient(greeter);
client.getEndpoint().getOutInterceptors().add(new TibcoSoapActionInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getInInterceptors().add(new LoggingInInterceptor());
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
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);
try {
greeter.pingMe();
fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
assertNotNull(ex.getFaultInfo());
}
}
((java.io.Closeable) greeter).close();
}
use of org.apache.hello_world_doc_lit.SOAPService2 in project cxf by apache.
the class JMSClientServerTest method docBasicJmsDestinationTest.
@Test
public void docBasicJmsDestinationTest() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService6");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort6");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = service.getPort(portName, Greeter.class);
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Milestone-" + idx);
assertEquals("Hello Milestone-" + idx, greeting);
String reply = greeter.sayHi();
assertEquals("Bonjour", reply);
try {
greeter.pingMe();
fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
assertNotNull(ex.getFaultInfo());
}
}
((java.io.Closeable) greeter).close();
}
use of org.apache.hello_world_doc_lit.SOAPService2 in project cxf by apache.
the class JaxWsAPITest method testGreeterUsingJaxWSAPI.
@Test
public void testGreeterUsingJaxWSAPI() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService2");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort2");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = markForClose(service.getPort(portName, Greeter.class, cff));
Client client = ClientProxy.getClient(greeter);
client.getEndpoint().getOutInterceptors().add(new TibcoSoapActionInterceptor());
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Chris");
Assert.assertEquals("Hello Chris", greeting);
}
Aggregations