use of javax.xml.ws.Holder in project cxf by apache.
the class ClientServerMiscTest method runDocLitTest.
private void runDocLitTest(DocLitWrappedCodeFirstService port) throws Exception {
assertEquals("snarf", port.doBug2692("snarf"));
CXF2411Result<CXF2411SubClass> o = port.doCXF2411();
assertNotNull(o);
assertNotNull(o.getContent());
Object[] ar = o.getContent();
assertTrue(ar[0] instanceof CXF2411SubClass);
Foo foo = new Foo();
foo.setName("blah");
assertEquals("blah", port.modifyFoo(foo).getName());
assertEquals("hello", port.outOnly(new Holder<String>(), new Holder<String>()));
long start = System.currentTimeMillis();
port.doOneWay();
assertTrue((System.currentTimeMillis() - start) < 500);
assertEquals("Hello", port.echoStringNotReallyAsync("Hello"));
Set<Foo> fooSet = port.getFooSet();
assertEquals(2, fooSet.size());
assertEquals("size: 2", port.doFooList(new ArrayList<>(fooSet)));
assertEquals(24, port.echoIntDifferentWrapperName(24));
String echoMsg = port.echo("Hello");
assertEquals("Hello", echoMsg);
List<String> rev = new ArrayList<>(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA));
Collections.reverse(rev);
String s;
String[] arrayOut = port.arrayOutput();
assertNotNull(arrayOut);
assertEquals(3, arrayOut.length);
for (int x = 0; x < 3; x++) {
assertEquals(DocLitWrappedCodeFirstServiceImpl.DATA[x], arrayOut[x]);
}
List<String> listOut = port.listOutput();
assertNotNull(listOut);
assertEquals(3, listOut.size());
for (int x = 0; x < 3; x++) {
assertEquals(DocLitWrappedCodeFirstServiceImpl.DATA[x], listOut.get(x));
}
s = port.arrayInput(DocLitWrappedCodeFirstServiceImpl.DATA);
assertEquals("string1string2string3", s);
s = port.listInput(java.util.Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA));
assertEquals("string1string2string3", s);
s = port.multiListInput(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA), rev, "Hello", 24);
assertEquals("string1string2string3string3string2string1Hello24", s);
s = port.listInput(new ArrayList<>());
assertEquals("", s);
s = port.listInput(null);
assertEquals("", s);
s = port.multiListInput(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA), rev, null, 24);
assertEquals("string1string2string3string3string2string1<null>24", s);
Holder<String> a = new Holder<String>();
Holder<String> b = new Holder<String>("Hello");
Holder<String> c = new Holder<String>();
Holder<String> d = new Holder<String>(" ");
Holder<String> e = new Holder<String>("world!");
Holder<String> f = new Holder<String>();
Holder<String> g = new Holder<String>();
s = port.multiInOut(a, b, c, d, e, f, g);
assertEquals("Hello world!", s);
assertEquals("a", a.value);
assertEquals("b", b.value);
assertEquals("c", c.value);
assertEquals("d", d.value);
assertEquals("e", e.value);
assertEquals("f", f.value);
assertEquals("g", g.value);
List<Foo> foos = port.listObjectOutput();
assertEquals(2, foos.size());
assertEquals("a", foos.get(0).getName());
assertEquals("b", foos.get(1).getName());
List<Foo[]> foos2 = port.listObjectArrayOutput();
assertNotNull(foos2);
assertEquals(2, foos2.size());
assertEquals(2, foos2.get(0).length);
assertEquals(2, foos2.get(1).length);
int[] ints = port.echoIntArray(new int[] { 1, 2, 3 }, null);
assertEquals(3, ints.length);
assertEquals(1, ints[0]);
if (new ASMHelper().createClassWriter() != null) {
// doing the type adapter things and such really
// requires the ASM generated helper classes
assertEquals("Val", port.createBar("Val").getName());
}
testExceptionCases(port);
}
use of javax.xml.ws.Holder in project cxf by apache.
the class ClientServerMiscTest method testOrderedParamHolder.
@Test
public void testOrderedParamHolder() throws Exception {
OrderedParamHolder_Service service = new OrderedParamHolder_Service();
OrderedParamHolder port = service.getOrderedParamHolderSOAP();
updateAddressPort(port, PORT);
try {
Holder<ComplexStruct> part3 = new Holder<ComplexStruct>();
part3.value = new ComplexStruct();
part3.value.setElem1("elem1");
part3.value.setElem2("elem2");
part3.value.setElem3(0);
Holder<Integer> part2 = new Holder<Integer>();
part2.value = 0;
Holder<String> part1 = new Holder<String>();
part1.value = "part1";
port.orderedParamHolder(part3, part2, part1);
assertNotNull(part3.value);
assertEquals("check value", "return elem1", part3.value.getElem1());
assertEquals("check value", "return elem2", part3.value.getElem2());
assertEquals("check value", 1, part3.value.getElem3());
assertNotNull(part2.value);
assertEquals("check value", 1, part2.value.intValue());
assertNotNull(part1.value);
assertEquals("check value", "return part1", part1.value);
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
use of javax.xml.ws.Holder in project cxf by apache.
the class ClientServerXMLTest method verifyOutHeader.
public void verifyOutHeader(HeaderTester proxy) throws Exception {
OutHeader me = new OutHeader();
me.setRequestType("OutHeaderRequest");
Holder<OutHeaderResponse> outHeaderHolder = new Holder<OutHeaderResponse>();
Holder<SOAPHeaderData> soapHeaderHolder = new Holder<SOAPHeaderData>();
proxy.outHeader(me, outHeaderHolder, soapHeaderHolder);
assertNotNull(outHeaderHolder.value);
assertNotNull(soapHeaderHolder.value);
assertEquals("check out value", "requestType=OutHeaderRequest", outHeaderHolder.value.getResponseType());
assertEquals("check out value", "message=outMessage", soapHeaderHolder.value.getMessage());
assertEquals("check out value", "orginator=outOriginator", soapHeaderHolder.value.getOriginator());
}
use of javax.xml.ws.Holder in project tomee by apache.
the class CalculatorTest method outParams.
@Test
public void outParams() throws Exception {
final Service calculatorService = Service.create(new URL("http://localhost:" + port + "/webservice-holder/Calculator?wsdl"), new QName("http://superbiz.org/wsdl", "CalculatorService"));
assertNotNull(calculatorService);
final CalculatorWs calculator = calculatorService.getPort(CalculatorWs.class);
final Holder<Integer> sum = new Holder<Integer>();
final Holder<Integer> multiply = new Holder<Integer>();
calculator.sumAndMultiply(4, 6, sum, multiply);
assertEquals(10, (int) sum.value);
assertEquals(24, (int) multiply.value);
}
use of javax.xml.ws.Holder in project cxf by apache.
the class AbstractHeaderServiceDocLitTest method verifyInOutHeaderParts.
protected void verifyInOutHeaderParts(HeaderTester ht) {
getLogger().debug("Client: calling inoutHeader");
InoutHeaderT inoutHeader = new InoutHeaderT();
inoutHeader.setRequestType(HeaderTesterUtil.INOUT_REQUEST_TYPE_IN);
HeaderInfo headerInfo = new HeaderInfo();
headerInfo.setMessage(HeaderTesterUtil.INOUT_MESSAGE_IN);
headerInfo.setOriginator(HeaderTesterUtil.INOUT_ORIGINATOR_IN);
Holder<HeaderInfo> holder = new Holder<HeaderInfo>();
holder.value = headerInfo;
InoutHeaderResponseT inoutHeaderResponse = ht.inoutHeader(inoutHeader, holder);
assertEquals(HeaderTesterUtil.INOUT_REQUEST_TYPE_OUT, inoutHeaderResponse.getResponseType());
assertNotSame(HeaderTesterUtil.INOUT_REQUEST_TYPE_OUT, inoutHeader.getRequestType());
assertEquals(HeaderTesterUtil.INOUT_MESSAGE_OUT, holder.value.getMessage());
assertEquals(HeaderTesterUtil.INOUT_ORIGINATOR_OUT, holder.value.getOriginator());
}
Aggregations