Search in sources :

Example 1 with TestHeader2Response

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

the class HeaderClientServerTest method testOutHeader.

@Test
public void testOutHeader() 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 {
        TestHeader2 in = new TestHeader2();
        String val = new String(TestHeader2Response.class.getSimpleName());
        Holder<TestHeader2Response> out = new Holder<TestHeader2Response>();
        Holder<TestHeader2Response> outHeader = new Holder<TestHeader2Response>();
        for (int idx = 0; idx < 2; idx++) {
            val += idx;
            in.setRequestType(val);
            proxy.testHeader2(in, out, outHeader);
            assertEquals(val, out.value.getResponseType());
            assertEquals(val, outHeader.value.getResponseType());
        }
    } catch (UndeclaredThrowableException ex) {
        ex.printStackTrace();
        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) TestHeader2Response(org.apache.header_test.types.TestHeader2Response) TestHeader2(org.apache.header_test.types.TestHeader2) URL(java.net.URL) Endpoint(javax.xml.ws.Endpoint) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Example 2 with TestHeader2Response

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

the class TestHeaderImpl method testHeader2.

/**
 * @param out
 * @param outHeader
 * @param in
 */
public void testHeader2(TestHeader2 in, Holder<TestHeader2Response> out, Holder<TestHeader2Response> outHeader) {
    TestHeader2Response outVal = new TestHeader2Response();
    outVal.setResponseType(in.getRequestType());
    out.value = outVal;
    TestHeader2Response outHeaderVal = new TestHeader2Response();
    outHeaderVal.setResponseType(in.getRequestType());
    outHeader.value = outHeaderVal;
}
Also used : TestHeader2Response(org.apache.header_test.types.TestHeader2Response)

Aggregations

TestHeader2Response (org.apache.header_test.types.TestHeader2Response)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 TestHeader2 (org.apache.header_test.types.TestHeader2)1 Test (org.junit.Test)1