Search in sources :

Example 1 with TestHeader5ResponseBody

use of org.apache.header_test.types.TestHeader5ResponseBody in project cxf by apache.

the class HeaderClientServerTest method testReturnHeader.

@Test
public void testReturnHeader() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
    assertNotNull(wsdl);
    SOAPHeaderService service = new SOAPHeaderService(wsdl, serviceName);
    assertNotNull(service);
    TestHeader proxy = service.getPort(portName, TestHeader.class);
    try {
        Holder<TestHeader5ResponseBody> out = new Holder<TestHeader5ResponseBody>();
        Holder<TestHeader5> outHeader = new Holder<TestHeader5>();
        TestHeader5 in = new TestHeader5();
        String val = new String(TestHeader5.class.getSimpleName());
        for (int idx = 0; idx < 2; idx++) {
            val += idx;
            in.setRequestType(val);
            proxy.testHeader5(out, outHeader, in);
            assertEquals(1000, out.value.getResponseType());
            assertEquals(val, outHeader.value.getRequestType());
        }
    } catch (UndeclaredThrowableException ex) {
        throw (Exception) ex.getCause();
    }
}
Also used : TestHeader(org.apache.header_test.TestHeader) Holder(javax.xml.ws.Holder) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) SOAPHeaderService(org.apache.header_test.SOAPHeaderService) TestHeader5(org.apache.header_test.types.TestHeader5) URL(java.net.URL) Endpoint(javax.xml.ws.Endpoint) TestHeader5ResponseBody(org.apache.header_test.types.TestHeader5ResponseBody) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Example 2 with TestHeader5ResponseBody

use of org.apache.header_test.types.TestHeader5ResponseBody in project cxf by apache.

the class TestHeaderImpl method testHeader5.

public void testHeader5(Holder<TestHeader5ResponseBody> out, Holder<TestHeader5> outHeader, org.apache.header_test.types.TestHeader5 in) {
    TestHeader5ResponseBody outVal = new TestHeader5ResponseBody();
    outVal.setResponseType(1000);
    out.value = outVal;
    TestHeader5 outHeaderVal = new TestHeader5();
    outHeaderVal.setRequestType(in.getRequestType());
    outHeader.value = outHeaderVal;
}
Also used : TestHeader5(org.apache.header_test.types.TestHeader5) TestHeader5ResponseBody(org.apache.header_test.types.TestHeader5ResponseBody)

Aggregations

TestHeader5 (org.apache.header_test.types.TestHeader5)2 TestHeader5ResponseBody (org.apache.header_test.types.TestHeader5ResponseBody)2 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 URL (java.net.URL)1 Endpoint (javax.xml.ws.Endpoint)1 Holder (javax.xml.ws.Holder)1 AbstractJaxWsTest (org.apache.cxf.jaxws.AbstractJaxWsTest)1 SOAPHeaderService (org.apache.header_test.SOAPHeaderService)1 TestHeader (org.apache.header_test.TestHeader)1 Test (org.junit.Test)1