XEP - 0055 with iOS and ejabberd?

2019-02-20 20:15发布

问题:

I am trying to implement XEP-0055 which is supported by ejabbed as shown here in supported xeps

This is my request:

XMPPIQ *iq = [[XMPPIQ alloc] init];
[iq addAttributeWithName:@"type" stringValue:@"get"];
[iq addAttributeWithName:@"from" stringValue:@"testuser1@company.com"];
[iq addAttributeWithName:@"to" stringValue:@"company.com"];
[iq addAttributeWithName:@"id" stringValue:@"search1"];
XMPPElement *query = [XMPPElement elementWithName:@"query"];
[query setXmlns:@"jabber:iq:search"];
[iq addChild:query];
[self.xmppStream sendElement:iq];

I am getting this response:

<iq xmlns="jabber:client" from="company.com" to="testuser1@company.com/2834146151141475281662718" type="error" id="search1">
<query xmlns="jabber:iq:search"/>
<error code="501" type="cancel">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>

Why am I receiving feature-not-implemented? Link to official XEP description.

回答1:

In ejabberd, the search functionality is delegated to a subdomain, by default using the vjud prefix. Try sending the search request to vjud.company.com instead.