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
______________________________________________________________
> Od: "Oliver Adler" <[EMAIL PROTECTED]>
> Komu: <[EMAIL PROTECTED]>
> CC: 
> Datum: Wed, 12 Feb 2003 19:05:45 +0100
> Předmět: AW: How to set JMS transport destination service
>
> Hi Michal,
>  
> what you have to do is to call the messageContext.setTargetService 
Method on the MessageContext object( in your case 
with "MessageService" as parameter). How you find the servicename in 
a "real" application is up to you. we weren't able to find 
a "standard" for jms. If you want to look at some source code, have a 
look at the org.apache.axis.handlers.http.URLMapper. Here it is done 
for http.
>  
> I hope that help !
>  
> Oliver
> 
>       -----Ursprüngliche Nachricht----- 
>       Von: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]] 
>       Gesendet: Mi 12.02.2003 18.37 Uhr 
>       An: [EMAIL PROTECTED] 
>       Cc: 
>       Betreff: How to set JMS transport destination service
>       
>       
> Hello,
> I'm trying to implement JMS transport layer for SOAP messages using
> openJMS provider.
> I'm able to send SOAP message from client application using JMS. The
> message is stored in JMS queue succesfully.
> I wrote a second application (simillar to SimpleJMSListener) which
> listens for incomming JMS messages. My own implementation of
> onMessage function is succesfully invoked. But here comes a
> problematic part. SimpleJMSWorker isn't able to find my service and
> error is returned to client.
> 
> Here's piece of error message:
> AxisFault
> faultCode: {http://xml.apache.org/axis/}Server.NoService
> faultSubcode:
> faultString: The AXIS engine could not find a target service to
> invoke! targetService is null
> faultActor:
> faultNode:
> faultDetail:
> {http://xml.apache.org/axis/}stackTrace: AxisFault
> faultCode: {http://xml.apache.org/axis/}Server.NoService
> faultSubcode:
> faultString: The AXIS engine could not find a target service to
> invoke! targetService is null
> faultActor:
> faultNode:
> faultDetail:
> The AXIS engine could not find a target service to invoke!
> targetService is null
> 
> I don't know how to let the SOAP message know what service should be
> called after transfering to serverside using JMS transport.
> 
> For ilustration here's my client code:
> ...
> 
> String wsdd =
> "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\"; " +
> "xmlns:java=\"" + WSDDConstants.URI_WSDD_JAVA + "\">\n" +
> " <transport name=\"JMSTransport\"
> pivot=\"java:org.apache.axis.transport.jms.JMSSender\"/>\n" +
> " <service name=\"" + WSDDConstants.URI_WSDD + "\"
> provider=\"java:MSG\">\n" +
> " <parameter name=\"allowedMethods\" value=\"AdminService\"/>\n" +
> " <parameter name=\"className\"
> value=\"org.apache.axis.utils.Admin\"/>\n" +
> " </service>\n" +
> "</deployment>";
> 
> HashMap connectorMap = new HashMap();
> HashMap cfMap = new HashMap();
> cfMap.put
> 
("transport.jms.ConnectionFactoryJNDIName","JmsQueueConnectionFactory"
> );
> cfMap.put(Context.PROVIDER_URL,"rmi://127.0.0.1:1099/JndiServer");
> cfMap.put
> 
(Context.INITIAL_CONTEXT_FACTORY,RmiJndiInitialContextFactory.class.ge
> tName());
> 
> Service service = new Service(new XMLStringProvider(wsdd));
> JMSTransport transport = new JMSTransport(connectorMap, cfMap);
> Call call = (Call) service.createCall();
> //call.setTargetEndpointAddress( new URL
> ("http://localhost:8080/axis/services/MessageService";));
> call.setProperty(JMSConstants.DESTINATION, "queue1");
> call.setTimeout(new Integer(10000));
> call.setTransport(transport);
> 
> SOAPBodyElement[] input = new SOAPBodyElement[3];
> input[0] = new SOAPBodyElement(XMLUtils.StringToElement
> ("urn:foo", "e1", "Hello"));
> input[1] = new SOAPBodyElement(XMLUtils.StringToElement
> ("urn:foo", "e1", "World"));
> DocumentBuilder builder = DocumentBuilderFactory.newInstance
> ().newDocumentBuilder();
> Document doc = builder.newDocument();
> Element cdataElem = doc.createElementNS("urn:foo", "e3");
> CDATASection cdata = doc.createCDATASection("Text with\n\tImportant
> <b> whitespace </b> and tags! ");
> cdataElem.appendChild(cdata);
> 
> input[2] = new SOAPBodyElement(cdataElem);
> 
> Vector elems = (Vector) call.invoke( input );
> ....
> 
> And here's my server side code:
> ...
> static final String wsdd =
> "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\"; " +
> "xmlns:java=\"" + WSDDConstants.URI_WSDD_JAVA + "\">\n" +
> " <service name=\"MessageService\" style=\"message\">\n" +
> " <parameter name=\"className\"
> value=\"samples.message.MessageService\"/>\n" +
> " <parameter name=\"allowedMethods\" value=\"echoElements\"/>\n" +
> " </service>\n" +
> "</deployment>";
> 
> HashMap connectorMap = new HashMap();
> HashMap cfMap = new HashMap();
> 
> String modeType = RmiJndiInitialContextFactory.class.getName();
> cfMap.put
> 
("transport.jms.ConnectionFactoryJNDIName","JmsQueueConnectionFactory"
> );
> cfMap.put(Context.PROVIDER_URL,"rmi://127.0.0.1:1099/JndiServer");
> cfMap.put(Context.INITIAL_CONTEXT_FACTORY,modeType);
> Service service = new Service(new XMLStringProvider(wsdd));
> 
> SimpleJMSListener listener = new SimpleJMSListener
> (connectorMap,cfMap,"queue1","","",false);
> listener.start();
> ....
> 
> And finaly my service
> ....
> public class MessageService {
> public Element[] echoElements(Element [] elems) {
> return elems;
> }
> }
> ....
> Thanks for any help.
> 
> Cheers,
> Michal
> 
> --------------------
> Poslouchejte Radio Impuls a vyhrajte víkendy pro dva v evropských
> metropolích. Více na Radiu Impuls a http://www.netimpuls.cz!
> 
> 
> 
> 
> 
> 


--------------------
PŘÍLOHA O DANÍCH! Interaktivní on-line formuláře pro daňová přiznání a tiskopisy ke 
stažení, adresář finančních úřadů na http://finance.centrum.cz/dane2



Reply via email to