use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class TwoWayJMSImplBase method greetMe.
public String greetMe(String me) {
if (me.startsWith("PauseForTwoSecs")) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// ignore
}
me = me.substring("PauseForTwoSecs".length()).trim();
}
MessageContext mc = wsContext.getMessageContext();
JMSMessageHeadersType responseHeaders = (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
responseHeaders.putProperty("Test_Prop", "some return value " + me);
return "Hello " + me;
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method test1009.
@Test
public void test1009() throws Exception {
TestCaseType testcase = JMSTestUtil.getTestCase("test1009");
final JMSSimplePortType simplePort = getPort("JMSSimpleService1009", "SimplePort", JMSSimpleService1009.class, JMSSimplePortType.class);
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
try {
twoWayTestWithRequestHeader(testcase, simplePort, requestHeader);
} catch (Exception e) {
assertTrue(e.getMessage().contains("Unknow JMS Variant"));
}
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method twoWayTestWithRequestHeader.
private void twoWayTestWithRequestHeader(TestCaseType testcase, final JMSSimplePortType port, JMSMessageHeadersType requestHeader) throws Exception {
closeable = (java.io.Closeable) port;
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;
}
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method test1001.
@Test
public void test1001() throws Exception {
// same to test0002
TestCaseType testcase = JMSTestUtil.getTestCase("test1001");
final JMSSimplePortType simplePort = getPort("JMSSimpleService1001", "SimplePort", JMSSimpleService1001.class, JMSSimplePortType.class);
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setSOAPJMSBindingVersion("0.3");
try {
twoWayTestWithRequestHeader(testcase, simplePort, requestHeader);
} catch (Exception e) {
assertTrue(e.getMessage().contains("Unrecognized BindingVersion"));
}
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method test0002.
@Test
public void test0002() throws Exception {
TestCaseType testcase = JMSTestUtil.getTestCase("test0002");
final JMSSimplePortType simplePort = getPort("JMSSimpleService0001", "SimplePort", JMSSimpleService0001.class, JMSSimplePortType.class);
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setJMSCorrelationID("Correlator0002");
twoWayTestWithRequestHeader(testcase, simplePort, requestHeader);
}
Aggregations