[jbossws-issues] [JBoss JIRA] Commented: (JBWS-670) Provide JMS transport for JAX-WS client
Wojciech Oczkowski (JIRA)
jira-events at lists.jboss.org
Thu May 21 08:20:57 EDT 2009
[ https://jira.jboss.org/jira/browse/JBWS-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12468640#action_12468640 ]
Wojciech Oczkowski commented on JBWS-670:
-----------------------------------------
anyway, at least timeout value and connection factory name shouldn't be hardcoded.
> Provide JMS transport for JAX-WS client
> ---------------------------------------
>
> Key: JBWS-670
> URL: https://jira.jboss.org/jira/browse/JBWS-670
> Project: JBoss Web Services
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Components: jbossws-native
> Reporter: Thomas Diesler
>
> Currently, the client will have to use the JMS API directly
> InitialContext context = new InitialContext();
> QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
> Queue reqQueue = (Queue)context.lookup("queue/RequestQueue");
> Queue resQueue = (Queue)context.lookup("queue/ResponseQueue");
> QueueConnection con = connectionFactory.createQueueConnection();
> QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
> QueueReceiver receiver = session.createReceiver(resQueue);
> ResponseListener responseListener = new ResponseListener();
> receiver.setMessageListener(responseListener);
> con.start();
> TextMessage message = session.createTextMessage(reqMessage);
> message.setJMSReplyTo(resQueue);
> waitForResponse = true;
>
> QueueSender sender = session.createSender(reqQueue);
> sender.send(message);
> sender.close();
> int timeout = 5000;
> while (waitForResponse && timeout > 0)
> {
> Thread.sleep(100);
> timeout -= 100;
> }
> assertNotNull("Expected response message", responseListener.resMessage);
> assertEquals(DOMUtils.parse(resMessage), DOMUtils.parse(responseListener.resMessage));
> con.stop();
> session.close();
> con.close();
> Instead, the client should use the standard JAX-WS API to consume a wsdl that defines the jms binding
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbossws-issues
mailing list