Search in sources :

Example 1 with TestHeader6

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

the class HeaderClientServerTest method testHeaderPartBeforeBodyPart.

@Test
public void testHeaderPartBeforeBodyPart() 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);
    TestHeader6 in = new TestHeader6();
    String val = new String(TestHeader6.class.getSimpleName());
    Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
    for (int idx = 0; idx < 1; idx++) {
        val += idx;
        in.setRequestType(val);
        inoutHeader.value = new TestHeader3();
        TestHeader6Response returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
        // inoutHeader copied to return
        // in copied to inoutHeader
        assertNotNull(returnVal);
        assertNull(returnVal.getResponseType());
        assertEquals(val, inoutHeader.value.getRequestType());
        in.setRequestType(null);
        inoutHeader.value.setRequestType(val);
        returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
        assertNotNull(returnVal);
        assertEquals(val, returnVal.getResponseType());
        assertNull(inoutHeader.value.getRequestType());
    }
}
Also used : TestHeader(org.apache.header_test.TestHeader) TestHeader6Response(org.apache.header_test.types.TestHeader6Response) Holder(javax.xml.ws.Holder) SOAPHeaderService(org.apache.header_test.SOAPHeaderService) TestHeader6(org.apache.header_test.types.TestHeader6) URL(java.net.URL) TestHeader3(org.apache.header_test.types.TestHeader3) Endpoint(javax.xml.ws.Endpoint) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Aggregations

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 TestHeader3 (org.apache.header_test.types.TestHeader3)1 TestHeader6 (org.apache.header_test.types.TestHeader6)1 TestHeader6Response (org.apache.header_test.types.TestHeader6Response)1 Test (org.junit.Test)1