use of org.apache.intfault.BadRecordLitFault in project cxf by apache.
the class GreeterImpl method testDocLitFault.
public BareDocumentResponse testDocLitFault(String in) throws BadRecordLitFault {
// System.out.println("Executing testDocLitFault sayHi\n");
List<Header> headers = new ArrayList<>();
Header header = null;
try {
header = new Header(new QName("http://test", "test"), new String("test"), new JAXBDataBinding(String.class));
} catch (JAXBException e) {
e.printStackTrace();
}
headers.add(header);
context.getMessageContext().put(Header.HEADER_LIST, headers);
throw new BadRecordLitFault("int fault", 5);
}
use of org.apache.intfault.BadRecordLitFault in project cxf by apache.
the class IntFaultClientServerTest method testBasicConnection.
@Test
public void testBasicConnection() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world_fault.wsdl");
assertNotNull("WSDL is null", wsdl);
SOAPService service = new SOAPService(wsdl, serviceName);
assertNotNull("Service is null", service);
Greeter greeter = service.getSoapPort();
ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
updateAddressPort(greeter, PORT);
try {
greeter.testDocLitFault("fault");
} catch (BadRecordLitFault e) {
assertEquals(5, e.getFaultInfo());
assertSoapHeader((BindingProvider) greeter);
}
}
Aggregations