use of org.apache.header_test.rpc.types.HeaderMessage in project cxf by apache.
the class HeaderClientServerTest method testRPCInHeader.
@Test
public void testRPCInHeader() throws Exception {
URL wsdl = getClass().getResource("/wsdl/soapheader_rpc.wsdl");
assertNotNull(wsdl);
SOAPRPCHeaderService service = new SOAPRPCHeaderService(wsdl, new QName("http://apache.org/header_test/rpc", "SOAPRPCHeaderService"));
assertNotNull(service);
TestRPCHeader proxy = service.getSoapRPCHeaderPort();
try {
HeaderMessage header = new HeaderMessage();
header.setHeaderVal("header");
for (int idx = 0; idx < 2; idx++) {
String returnVal = proxy.testHeader1(header, "part");
assertNotNull(returnVal);
assertEquals("part/header", returnVal);
}
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
use of org.apache.header_test.rpc.types.HeaderMessage in project cxf by apache.
the class HeaderClientServerTest method testRPCInOutHeader.
@Test
public void testRPCInOutHeader() throws Exception {
URL wsdl = getClass().getResource("/wsdl/soapheader_rpc.wsdl");
assertNotNull(wsdl);
SOAPRPCHeaderService service = new SOAPRPCHeaderService(wsdl, new QName("http://apache.org/header_test/rpc", "SOAPRPCHeaderService"));
assertNotNull(service);
TestRPCHeader proxy = service.getSoapRPCHeaderPort();
try {
HeaderMessage header = new HeaderMessage();
Holder<HeaderMessage> holder = new Holder<HeaderMessage>(header);
for (int idx = 0; idx < 2; idx++) {
holder.value.setHeaderVal("header" + idx);
String returnVal = proxy.testInOutHeader("part" + idx, holder);
assertNotNull(returnVal);
assertEquals("header" + idx, returnVal);
assertEquals("part" + idx, holder.value.getHeaderVal());
}
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
Aggregations