assertNotNull(service);
try {
HelloWorldPortType greeter = service.getPort(portName, HelloWorldPortType.class);
Map<String, Object> requestContext = ((BindingProvider)greeter).getRequestContext();
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setJMSCorrelationID("JMS_SAMPLE_CORRELATION_ID");
requestHeader.setJMSExpiration(3600000L);
JMSPropertyType propType = new JMSPropertyType();
propType.setName(testReturnPropertyName);
propType.setValue("mustReturn");
requestHeader.getProperty().add(propType);
propType = new JMSPropertyType();
propType.setName(testIgnoredPropertyName);
propType.setValue("mustNotReturn");
requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
String greeting = greeter.greetMe("Milestone-");
assertNotNull("no response received from service", greeting);
assertEquals("Hello Milestone-", greeting);
Map<String, Object> responseContext = ((BindingProvider)greeter).getResponseContext();
JMSMessageHeadersType responseHdr =
(JMSMessageHeadersType)responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
if (responseHdr == null) {
fail("response Header should not be null");
}
assertTrue("CORRELATION ID should match :",
"JMS_SAMPLE_CORRELATION_ID".equals(responseHdr.getJMSCorrelationID()));
assertTrue("response Headers must conain the app property set in request context.",
responseHdr.getProperty() != null);
boolean found = false;
for (JMSPropertyType p : responseHdr.getProperty()) {
if (testReturnPropertyName.equals(p.getName())) {
found = true;
}
}
assertTrue("response Headers must match the app property set in request context.",