3

This is the sample IQ stanza for getting the Roster

<iq from="alice@wonderland.lit/pda" id="rr82a1z7"
type="get">
    <query xmlns="jabber:iq:roster"/>
</iq>

From this standard specification, Iq stanzas can be directed to certain user by setting the "TO" attribute so that xmpp server will forward the IQ stanza to the JID(Full Jabber ID) specified in the "TO" attribute, check specification

But when i query the IQ stanza to suit my needs to this

<iq from="alice@wonderland.lit/pda" id="rr82a1z7"
to="alice@wonderland.lit/Smack"
type="get">
    <UserDetails xmlns="http://www.test.org/User/">
        <userName>username</username>
    </UserDetails>
</iq>

Stanza is forwarded to "alice@wonderland.lit" but I receive an IQ Stanzs with error condition "feature-not-implemented" from the Openfire Server.

Is there any way to get rid of this error and get the result ?

I followed this tutorial to generate clients.

I could see the wireshark traces of custom Stanza being received but could not see "myIQListener" being called ?

Questions :

  • Any other intermediate steps which I am missing ?
  • Any other better example ?
Community
  • 1
  • 1
forum.test17
  • 2,119
  • 6
  • 30
  • 62
  • For sending stanza to another roster , you need to be in roster subscription list. – Greesh Kumar Aug 05 '16 at 12:35
  • @GirishKumar aha, thanks for the info, I will verify – forum.test17 Aug 05 '16 at 12:38
  • That example worked, it was a typo error in the namespace , which took entire day to fix. once again proves that checking your own code for typos should be first priority instead of feeling insecure of the knowledge you have :) – forum.test17 Aug 09 '16 at 10:30

2 Answers2

1

This is how I solved my own problem.

  • Use Full jabber ID (including resource)

  • As smack library does not understand the Custom IQ Stanzas implement own IQProvider , Filter and add it your connection as exactly explained here

forum.test17
  • 2,119
  • 6
  • 30
  • 62
0

You need to send your own <presence type="subscribe" to="alice@wonderland.lit"/> or need to be in another user's roster list :

Refer : here

OR

Deny messages from non-roster users in Openfire

Community
  • 1
  • 1
Greesh Kumar
  • 1,847
  • 3
  • 27
  • 44
  • 1
    I have verified and in wireshark traces I could see the openFire Xmpp server forwarding the request to the client address (full jabber ID) and even in this specification https://tools.ietf.org/html/rfc6120#page-105 it states that "unless the message is being sent to the bare JID of a connected client's account. Upon receiving a message stanza with a 'to' address, a server SHOULD attempt to route or deliver it to the intended recipient (see Section 10 for general routing and delivery rules related to XML stanzas)" – forum.test17 Aug 08 '16 at 19:52