QName portName = new QName(SERVICE_NS, "GreeterPort");
URL wsdl = getWSDLURL(WSDL);
JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
JMSGreeterPortType greeter = markForClose(service.getPort(portName, JMSGreeterPortType.class, cff));
BindingProvider bp = (BindingProvider)greeter;
Map<String, Object> requestContext = bp.getRequestContext();
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setSOAPJMSBindingVersion("0.3");
requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
try {
greeter.greetMe("Milestone-");
Assert.fail("Should have thrown a fault");
} catch (SOAPFaultException ex) {
Assert.assertTrue(ex.getMessage().contains("0.3"));
Map<String, Object> responseContext = bp.getResponseContext();
JMSMessageHeadersType responseHdr = (JMSMessageHeadersType)responseContext
.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
if (responseHdr == null) {
Assert.fail("response Header should not be null");
}