XMPP - user search in iphone sdk ? use of XEP-0055

2019-07-17 16:18发布

问题:

i am sending this IQ to openfire server

< iq type="set" from="admin@localhost.localdomain" to="localhost.localdomain" id="search2" xml:lang="en" > < query xmlns="jabber:iq:search" > < first > admin < /first > < /query > < /iq >

but getting following response from server,

< iq type="error" id="search2" from="localhost.localdomain" to="admin@localhost.localdomain/b91c09e5"><query xmlns="jabber:iq:search" >  < first > admin < /first > < /query > < error code="501" type="cancel" > < feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/ > < /error > < /iq >

even if i have installed search plugin and also enabled user search in openfire server...

Why this is happening ? How to solve this issue ? Any suggestion or help ?

i have also sent disco query to server to check which features are supported:

Input:

here what i get as output:

i didn't find anything related to user search on server in this list....!!

回答1:

urn:ietf:params:xml:ns:xmpp-stanzas

I think you need to handle "stanzas" from your client application.



回答2:

Sometimes you have to send XEP-55 to another component. Use XEP-30 (Disco) to search your local server for a component that implements the jabber:iq:search feature.



回答3:

<iq type='set' id='purple9ae3ed' to='vjud.yourserver.org'>
   <query xmlns='jabber:iq:search'>
     <x xmlns='jabber:x:data' type='submit'>
        <field var='first'><value>Rub*</value></field>
    </x>
  </query>
</iq>