Subject: error getting Items from a pubsub Event
Hi,
First, version info:
agsXMPP 1.00
server: Openfire 3.5.2 (Windows)
I have been experimenting with pubsub for use in a client that I am developing. I have been successful in creating a new pubsub node on the server, subscibing to that node, publishing items to the node, and receiving the corresponding notification through the OnMessage event. However, I have an issue while parsing the received event. The @event.Event.Items property is always returning null.
When I receive an OnMessage event, I check to see if the message is a pubsub event using:
agsXMPP.protocol.extensions.pubsub.@event.Event pubSubEvent =
message.SelectSingleElement ( typeof (
agsXMPP.protocol.extensions.pubsub.@event.Event ) ) as
agsXMPP.protocol.extensions.pubsub.@event.Event;
If pubSubEvent is not null, I have a pubsub event, and I then try to extract the "items" from the event using:
agsXMPP.protocol.extensions.pubsub.@event.Items eventItems =
pubSubEvent.Items;
It is at this point, where eventItems is always null.
Looking into this some more, it seems that the "items" tag that is received by the server is being changed to "item" within agsXMPP. When I add handlers for OnReadSocketData and OnReadXml I see the following data:
Socket Read:
<message from="pubsub.laptop02" to="scm@laptop02" id="pubsub_test__scm@laptop02__7s0GX"><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="pubsub_test"><item id="68RpEHF4MnqkM6X"><entry xmlns="http://jabber.org/protocol/pubsub">client5:Available</entry></item></items></event><headers xmlns="http://jabber.org/protocol/shim"><header name="pubsub#subid">74tU1D0gOR21DvUykpm8I4813dSesrKI37BcVXGO</header></headers></message>
XML Read:
<message xmlns="jabber:client" from="pubsub.laptop02" to="scm@laptop02" id="pubsub_test__scm@laptop02__7s0GX"><event xmlns="http://jabber.org/protocol/pubsub#event"><item node="pubsub_test"><item id="68RpEHF4MnqkM6X"><entry xmlns="http://jabber.org/protocol/pubsub">client5:Available</entry></item></item></event><header xmlns="http://jabber.org/protocol/shim"><headers name="pubsub#subid">74tU1D0gOR21DvUykpm8I4813dSesrKI37BcVXGO</headers></header></message>
I have tried fixing the Items by using pubSubEvent.FirstChild.TagName = "items", but I still don't get the @event.Event.Items property to work as would expect. Am I using something incorrectly, or do you think that it might be a bug in the code?
Thanks,
Chris
First, version info:
agsXMPP 1.00
server: Openfire 3.5.2 (Windows)
I have been experimenting with pubsub for use in a client that I am developing. I have been successful in creating a new pubsub node on the server, subscibing to that node, publishing items to the node, and receiving the corresponding notification through the OnMessage event. However, I have an issue while parsing the received event. The @event.Event.Items property is always returning null.
When I receive an OnMessage event, I check to see if the message is a pubsub event using:
agsXMPP.protocol.extensions.pubsub.@event.Event pubSubEvent =
message.SelectSingleElement ( typeof (
agsXMPP.protocol.extensions.pubsub.@event.Event ) ) as
agsXMPP.protocol.extensions.pubsub.@event.Event;
If pubSubEvent is not null, I have a pubsub event, and I then try to extract the "items" from the event using:
agsXMPP.protocol.extensions.pubsub.@event.Items eventItems =
pubSubEvent.Items;
It is at this point, where eventItems is always null.
Looking into this some more, it seems that the "items" tag that is received by the server is being changed to "item" within agsXMPP. When I add handlers for OnReadSocketData and OnReadXml I see the following data:
Socket Read:
<message from="pubsub.laptop02" to="scm@laptop02" id="pubsub_test__scm@laptop02__7s0GX"><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="pubsub_test"><item id="68RpEHF4MnqkM6X"><entry xmlns="http://jabber.org/protocol/pubsub">client5:Available</entry></item></items></event><headers xmlns="http://jabber.org/protocol/shim"><header name="pubsub#subid">74tU1D0gOR21DvUykpm8I4813dSesrKI37BcVXGO</header></headers></message>
XML Read:
<message xmlns="jabber:client" from="pubsub.laptop02" to="scm@laptop02" id="pubsub_test__scm@laptop02__7s0GX"><event xmlns="http://jabber.org/protocol/pubsub#event"><item node="pubsub_test"><item id="68RpEHF4MnqkM6X"><entry xmlns="http://jabber.org/protocol/pubsub">client5:Available</entry></item></item></event><header xmlns="http://jabber.org/protocol/shim"><headers name="pubsub#subid">74tU1D0gOR21DvUykpm8I4813dSesrKI37BcVXGO</headers></header></message>
I have tried fixing the Items by using pubSubEvent.FirstChild.TagName = "items", but I still don't get the @event.Event.Items property to work as would expect. Am I using something incorrectly, or do you think that it might be a bug in the code?
Thanks,
Chris