Wow, I had no idea you could use the XFire client for JMS. That's pretty
cool (if it works).
Um ... the problem here seems to be that you're not setting the ReplyTo.
That may be what MQ is balking on as well. Hmmm.
It looks like JMSChannel.java in XFire sets the JMSReplyTo from a
javax.jms.Destination (say, a Queue) that is stored in the
MessageContext under the key "REPLY_TO". Look here:
http://svn.xfire.codehaus.org/browse/xfire/trunk/xfire/xfire-jms/src/mai
n/org/codehaus/xfire/transport/jms/JMSChannel.java?r=trunk
At approx. lines 194,205.
It looks like the XFire client (org.codehaus.xfire.client.Client)
extends org.codehaus.xfire.AbstractContext, so just calling:
getClient().setProperty("REPLY_TO", <destination>)
might work. I don't have a working MQ setup at the moment, otherwise I'd
try.
Cheers,
Brice
-----Original Message-----
From: Wayne Keenan [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 2:39 PM
To: [email protected]
Subject: Re: [xfire-user] Set JMSChannel replyTo
Thanks for the response. I think I need to set ws addressing on the
dynamic client, but Im a unsure how.
I am registering the JMS transport before creating the dynamic client,
below are the logs. perhaps what im trying
is completely wrong w/ dynamic client as im getting a MQ error:
Caused by: javax.jms.JMSException: MQJMS1013: operation invalid whilst
session is using asynchronous delivery
my test client is:
import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.net.URL;
import javax.jms.QueueConnectionFactory;
import org.codehaus.xfire.DefaultXFire;
import org.codehaus.xfire.XFire ;
import org.codehaus.xfire.client.Client;
import org.codehaus.xfire.client.XFireProxy;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory ;
import org.codehaus.xfire.test.Echo;
import org.codehaus.xfire.transport.jms.JMSTransport;
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQQueueConnectionFactory;
public class JMSWSEchoTest {
private XFire xfire;
private QueueConnectionFactory factory;
private JMSTransport transport;
public void setUp()
throws Exception
{
factory = new MQQueueConnectionFactory();
((MQQueueConnectionFactory)factory).setTransportType(JMSC.MQJMS_TP_BINDI
NGS_MQ);
((MQQueueConnectionFactory)factory).setHostName("localhost");
((MQQueueConnectionFactory)factory).setQueueManager("QM_server");
((MQQueueConnectionFactory)factory).setPort(1414);
xfire = new DefaultXFire();
transport = (JMSTransport) new JMSTransport(xfire, factory);
xfire.getTransportManager ().register(transport);
}
public void testClient1() throws Exception {
// Create a ServiceFactory to create the ServiceModel.
// We need to add the JMSTransport to the list of bindings to
create.
ObjectServiceFactory sf = new
ObjectServiceFactory(xfire.getTransportManager());
sf.addSoap11Transport(JMSTransport.BINDING_ID);
// Create the service model
Service serviceModel = sf.create(Echo.class);
// Create a proxy for the service
XFireProxyFactory factory = new XFireProxyFactory(xfire);
Echo echo = (Echo) factory.create(serviceModel,
"jms://ARSYSTEM_OUTBOUND");
// Since JMS doesn't really have a concept of anonymous
endpoints, we
// need
// need to let xfire know what JMS endpoint we should use
((XFireProxy) Proxy.getInvocationHandler
(echo)).getClient().setEndpointUri("jms://ARSYSTEM_INBOUND");
// run the client!
String resString = echo.echo("hello");
//assertEquals("hello", resString);
System.out.println("response:" + resString);
}
public void testClient2() throws MalformedURLException, Exception
{
Client client = new Client(new URL("
http://localhost:8191/Echo?wsdl <http://localhost:8191/Echo?wsdl> "));
Object[] response = client.invoke("echo", new Object[]
{"hello"});
System.out.println((String) response[0]);
}
public static void main(String args[]) throws Exception
{
try
{
JMSWSEchoTest jwt = new JMSWSEchoTest();
jwt.setUp();
jwt.testClient1();
}
catch (/*MalformedURL*/Exception e)
{
e.printStackTrace();
}
}
}
0 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
0 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
15 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
15 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
15 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
1422 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
1422 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
1422 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
1422 [main] DEBUG org.codehaus.xfire.transport.DefaultTransportManager
- Registered transport
[EMAIL PROTECTED]
2734 [main] DEBUG org.codehaus.xfire.client.XFireProxy - Method [echo]
[hello]
2734 [main] DEBUG org.codehaus.xfire.transport.jms.JMSTransport -
Creating new channel for uri: jms://ARSYSTEM_INBOUND
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - adding
handler [EMAIL PROTECTED] to phase
send
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - adding
handler [EMAIL PROTECTED] to
phase transport
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - adding
handler [EMAIL PROTECTED] to
phase post-invoke
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
phase post-invoke
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline -
Invoking handler org.codehaus.xfire.soap.handler.SoapSerializerHandler
in phase post-invoke
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
phase policy
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline -
Invoking phase user
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
phase transport
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
handler org.codehaus.xfire.soap.handler.SoapActionOutHandler in phase
transport
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
phase send
3875 [main] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking
handler org.codehaus.xfire.handler.OutMessageSender in phase send
4172 [main] DEBUG org.codehaus.xfire.transport.jms.JMSChannel -
ResponseURI:jms://ARSYSTEM_OUTBOUND
4172 [main] DEBUG org.codehaus.xfire.transport.jms.JMSChannel -
msgtxt:<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><soap:Body><echo
xmlns="http://test.xfire.codehaus.org"><in0>hello</in0></echo></soap:Bod
y></soap:Envelope>
4172 [main] DEBUG org.codehaus.xfire.transport.jms.JMSChannel -
corrid:11649131364370-593738066
4172 [main] DEBUG org.codehaus.xfire.transport.jms.JMSChannel -
msgctx.getProp(REPLY_TO):null
org.codehaus.xfire.XFireRuntimeException : Could not invoke service..
Nested exception is org.codehaus.xfire.fault.XFireFault: Error sending
message
org.codehaus.xfire.fault.XFireFault: Error sending message
at org.codehaus.xfire.transport.jms.JMSChannel.send
(JMSChannel.java:246)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java
:26)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
at org.codehaus.xfire.client.Invocation.invoke (Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke (XFireProxy.java:57)
at $Proxy0.echo(Unknown Source)
at
com.turingsmi.messagelogic.net.tests.JMSWSEchoTest.testClient1(JMSWSEcho
Test.java:66)
at com.turingsmi.messagelogic.net.tests.JMSWSEchoTest.main
(JMSWSEchoTest.java:85)
Caused by: javax.jms.JMSException: MQJMS1013: operation invalid whilst
session is using asynchronous delivery
at
com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment
.java :567)
at
com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1193)
at
com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:3123)
at org.codehaus.xfire.transport.jms.JMSChannel.send(JMSChannel.java
:238)
... 9 more
On 30/11/06, Ruth, Brice D <[EMAIL PROTECTED]> wrote:
I'm not sure what you mean w/ dynamic client ... I don't think
the dynamic client understands JMS, does it? Maybe it does and I've
missed something. When we've setup JMS with XFire in an MQ Series
environment, the MQ client application set the ReplyTo in the API calls
to the MQ jars - so its specified in the JMS message. XFire just picks
it up from there and does the right thing. You don't need to specify the
reply-to on the server side, if memory serves.
Cheers,
Brice
-----Original Message-----
From: Wayne Keenan [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 30, 2006 12:15 PM
To: [email protected]
Subject: [xfire-user] Set JMSChannel replyTo
Hi,
Please can someone advise me on how I set the JMS ReplyTo
property on the serverside service.xml and also for a 'DynamicClient'?
Thanks
Wayne