You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by "Vinh Nguyen (vinguye2)" <vi...@cisco.com> on 2007/05/09 10:32:53 UTC

publish simple strings

Is there a way to publish a simple string as a notification message?
The NotificationProducer has various publish() methods, but ultimately
they all require the message to be in some form of Element.  This
prevents the ability to publish simple types.

RE: publish simple strings

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Thanks Dan,
I agree that the data should be wrapped in some element.  Otherwise,
Muse has to overload a lot of stuff just to know what type of data is
being sent, and how to serialize it, or not serialize at all.  I just
wanted another opinion to see if it made sense to be able to send simple
types:)


-----Original Message-----
From: Daniel Jemiolo [mailto:danjemiolo@us.ibm.com] 
Sent: Wednesday, May 09, 2007 7:08 AM
To: muse-user@ws.apache.org
Subject: Re: publish simple strings

The idea is that even a simple type should be wrapped in some element,
not just free-form text or CDATA - that way we can have multiple values.
If you add a simple string, and then another value (simple or complex),
how would the API be modified to get the data from the
NotificationMessage? 
Right now we have a getMessageContent() that is overloaded to search by
index or by element qname - if free text were permitted under
<wsnt:Message/>, we would need to generalize the API further to be based
on DOM Node rather than DOM Element, and make all the additional checks
that come with that.

Can you do this?

QName topicName = ...
QName elementName = ...
String payload = ...

wsnCap.publish(topicName, XmlUtils.createElement(elementName, payload));



"Vinh Nguyen \(vinguye2\)" <vi...@cisco.com> wrote on 05/09/2007
04:32:53 AM:

> Is there a way to publish a simple string as a notification message?
> The NotificationProducer has various publish() methods, but ultimately

> they all require the message to be in some form of Element.  This 
> prevents the ability to publish simple types.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: publish simple strings

Posted by Daniel Jemiolo <da...@us.ibm.com>.
The idea is that even a simple type should be wrapped in some element, not 
just free-form text or CDATA - that way we can have multiple values. If 
you add a simple string, and then another value (simple or complex), how 
would the API be modified to get the data from the NotificationMessage? 
Right now we have a getMessageContent() that is overloaded to search by 
index or by element qname - if free text were permitted under 
<wsnt:Message/>, we would need to generalize the API further to be based 
on DOM Node rather than DOM Element, and make all the additional checks 
that come with that.

Can you do this?

QName topicName = ...
QName elementName = ...
String payload = ...

wsnCap.publish(topicName, XmlUtils.createElement(elementName, payload));



"Vinh Nguyen \(vinguye2\)" <vi...@cisco.com> wrote on 05/09/2007 
04:32:53 AM:

> Is there a way to publish a simple string as a notification message?
> The NotificationProducer has various publish() methods, but ultimately
> they all require the message to be in some form of Element.  This
> prevents the ability to publish simple types.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org