Hi Michal, the client side and and jms part is correct (we do it the same way). On the server side we have a AxisServer Instance which we invoke: ... FileProvider provider = new FileProvider(serverConfigFile);
engine = new AxisServer(provider);
...
//value is the string from jms
MessageContext msgContext = new MessageContext(engine);
Message msg = new Message(value.getBytes());
msg.setMessageType(Message.REQUEST);
msgContext.setRequestMessage( msg );
msgContext.setTransportName(transportName);
try
{
/* Invoke the Axis engine... */
engine.invoke( msgContext );
}
catch( Exception e )
{
AxisFault fault = AxisFault.makeFault(e);
msgContext.setResponseMessage( new Message(fault) );
}
/* Send it back along the wire... */
msg = msgContext.getResponseMessage();
String response = null;
if (msg == null)
{
AxisFault fault = AxisFault.makeFault(new VRSAgentException("axis response empty",
VRSAgentException.SYSTEM_ERROR, null));
msg = new Message(fault);
}
try
{
response = (String) msg.getSOAPPartAsString();
}
catch (AxisFault fault)
{
msg = new Message(fault);
try
{
response = (String)msg.getSOAPPartAsString();
}
catch (AxisFault fault2)
{
response = fault2.dumpToString();
}
}
return response;
}
The next step we did is to implement a transport specific handler. Here we decide
which service to invoke (we use a soap header) and call the setTargetService on the
messageContext with the name of the service.
As you can see in the code there is the MessageContext object. But I'am not sure if
you could call the setTargetService at this time.
We used the code from the transport sample.
I hope that brings some light.
Regards
Oliver
-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Mi 12.02.2003 20.18 Uhr
An: [EMAIL PROTECTED]
Cc:
Betreff: Re: AW: How to set JMS transport destination service
Hi Oliver,
thanks for response, but I'm not absolutely about setting
messageContext.
Where this message context should be set. I guess on the server side,
probably.
In my opinion message lifetime looks like this:
Client side
-----------
1.Call object is created
2.Call object is set to use JMS transport layer, with provider
factory and queue name specified.
3.SOAPMessage is created.
4.SOAPMessage is send to its destination (JMS queue) using invoke
function of Call object.
5.SOAPMessage is converted to JMS message when transporting.
JMS Provider
------------
1. Message is stored in queue
Server Part
-----------
1.Message is retrieved from jms queue using JMSListener
2.Message is send to JMSWorker which converts JMS message back to
SOAP Message.
3.Context of the message is created
4.Service is restored from message context and called
The problem is in the steps 3 and 4 of server side. The
messagecontext is created using server axis instance and there's no
information about originating targetservice.
So I think in this point you can assume that in particular queue is
just messages that should be sent to particular service. I this case
you can set to newly created messagecontext targetservice as the name
of service. But I've tried that solution too and seems to be not
working.
Any other idea?
Cheers,
Michal
<<winmail.dat>>
