[xgws-user] Problem with WS-Messenger

Yi Huang yihuan_at_cs.indiana.edu
Wed, 21 Mar 2007 12:20:43 -0400


Hi,

-----Original Message-----
From: Alex Piqueras [mailto:apm6_at_alu.um.es] 
Sent: Tuesday, March 20, 2007 5:42 AM
To: Yi Huang
Subject: Re: [xgws-user] Problem with WS-Messenger

Hi,
Thank you. I didn't know that "WsmgUtil.getTopicLocalString" worked in 
this way.
Since the topic element could be in the SOAP header or SOAP content, 
depending on WS-Eventing or WS-Notification, I modified your code to 
support this and it works successfully:

        XmlElement messageAsXml = 
WsmgUtil.convertStringMessageToXmlElement(message);
        Iterator iter1 = messageAsXml.children();
        while (iter1.hasNext()) {
            XmlElement elem1 = (XmlElement)iter1.next();
            Iterator iter2 = elem1.children();
            while (iter2.hasNext()) {
                XmlElement elem2 = (XmlElement)iter2.next();
                if (elem2.getName().equalsIgnoreCase("Topic")) {
                    topic = WsmgUtil.getTopicLocalString(elem2);
                }
            }
        }

Nice to learn you made it work. Thanks for sending me your generic topic
checking code. 


On the other hand, When I use topic and XPath-based subscriptions the 
examples in API User Guide fails.

For example:

subscriptionId1 = 
client.subscribe(producer,consumer,topic,"//content[text()=\"Hello\"]");

client.unSubscribe(producer,subscriptionId1);

I don't see anything wrong here. What error message/exception do you get? Do
you have the stack trace?

Thanks,

Yi

Am I doing something wrong?

Thank you very much.

-- 
-------------------------------------------------------
Alejandro Piqueras Meseguer (apiqueras_at_dif.um.es)
Dept. Ingeniería de la Información y las Comunicaciones
Facultad de Informática
Universidad de Murcia