rosterExchangeManager problem

can any 1 help me?

i try to send a roster entry to another user

when i do…

rosterExchangeManager.send(… ,…);

in the message recieved when i do that i get that the enrty i tried to send is null.

but it is not null i check it and it is ok.

when a client like exodus sends me a roster then i get the roster entry but the problem is when i send a roster entry.

i also check at the debug window and got this messages:

****on sending:

<freinds

**when recieving:

<iq from=’‘gilsha@jabber.org/balcony’’ id=’‘v62C2-2’’ type=’‘result’’><query xmlns=’‘jabber:iq:roster’’><item ask=’‘subscribe’’ jid=’‘gilshar21@jabber.org/home’’ name=’‘gilshar21@jabber.org/home’’ subscription=’‘none’’>freinds<item ask=’‘subscribe’’ jid=’‘empty’’ name=’‘empty’’ subscription=’‘none’’/><item jid=’‘gilsharon@jabber.org’’ name=’‘gilsharon@jabber.org’’ subscription=’‘none’’>freinds<item ask=’‘subscribe’’ jid=’‘gilshar21@jabber.org/Home’’ name=’‘gilshar21@jabber.org/Home’’ subscription=’‘none’’>family

Gil,

When you send a roster item to another user the XML stanza that you generate is like this one (similar to your XML):

<message id="f3M23-131" to="gato4@localhost">
  <x xmlns="jabber:x:roster">
    <item jid="gato5@localhost" name="gato5">
      <group>Friends, Coworker</group>
    </item>
    <item jid="gato6@localhost" name="gato6"/>
  </x>
</message>

The user that receives the roster entry will get an XML stanza like this:

<message id="f3M23-131" to="gato4@localhost" from="gato3@localhost/Smack">
  <x xmlns="jabber:x:roster">
    <item jid="gato5@localhost" name="gato5">
      <group>Friends, Coworker</group>
    </item>
    <item jid="gato6@localhost" name="gato6"/>
  </x>
</message>

As you can see this XML is different from the one you are reporting. The XML that you are receiving is the one you receive while retrieving a user’'s roster.

I guess that the confusion could come from assuming that the sent roster entry becomes automatically part of the roster. The user that will receive the entry needs to listen for roster entries receptions and decide if he/she wants to add the received entry to his/her roster. You can follow this link to learn how to listen to roster entries receptions and add them to the roster. http://www.jivesoftware.com/builds/docs/smack/latest/documentation/extensions/ro sterexchange.html#riercventry

Regards,

– Gato

the proble is not on the receving a roster entry because i can recieve… i checked it.

the problem iswhen i try to send a roster entry…

i copied the code needed to send a roster entry from the extention page.

but again it doesnt work.

can u send me an example to how send a roster entry…?

altough i copied the code from th extantion page…

maybe there is a problem in the smack ? because when i try to send to my self a roster entry i see null in the roster recieved.

but when other clients (like exodus) sends me a roster entry i can see the roster entry that wwas sent to me and then i can add it to my roster.

but also when i send a roster entry to the exodus client it doesnt reacte because it doesnt gey anything(null)…

thats why i ask for a code…

Gil,

Let’'s say that user_1 is sending his entries to user_2. Could you paste the XML stanzas that are being sent by user_1 and received by user_2?

To see a running example of roster entries exchange you can download the Developer Edition which includes test cases. Take a look at the test case org.jivesoftware.smackx.RosterExchangeManagerTest.

Regards,

– Gato