TestLogger.logger.debug("------------------------------");
TestLogger.logger.debug("Test : " + getName());
BareDocLitService service = new BareDocLitService();
DocLitBarePortType proxy = service.getBareDocLitPort();
BindingProvider p = (BindingProvider) proxy;
p.getRequestContext().put(
BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
p.getRequestContext().put(
BindingProvider.SOAPACTION_URI_PROPERTY, "headerTest");
p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ENDPOINT_URL);
// Don't write a header element when the @WebParam header parameter is null.
p.getRequestContext().put(org.apache.axis2.jaxws.Constants.WRITE_HEADER_ELEMENT_IF_NULL, Boolean.FALSE);
String request = null; // No header
String response = proxy.headerTest(1, request);
assertTrue(response != null);
assertTrue(response.indexOf("No Header") > 0);
// Try the test again
request = null;
response = proxy.headerTest(1,request);
assertTrue(response != null);
assertTrue(response.indexOf("No Header") > 0);
TestLogger.logger.debug("------------------------------");
}