InvocationHandler handler = Proxy.getInvocationHandler(port);
BindingProvider bp = (BindingProvider)handler;
Map<String, Object> requestContext = bp.getRequestContext();
if (requestHeader == null) {
requestHeader = new JMSMessageHeadersType();
}
requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
Exception e = null;
try {
String response = port.echo("test");
assertEquals(response, "test");
} catch (WebServiceException ew) {
throw ew;
} catch (Exception e1) {
e = e1;
}
Map<String, Object> responseContext = bp.getResponseContext();
JMSMessageHeadersType responseHeader = (JMSMessageHeadersType)responseContext
.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
checkJMSProperties(testcase, requestHeader, responseHeader);
if (e != null) {
throw e;
}