Search code examples
xmppejabberd

Setting EjabberD XMPP VCard nickname


I am trying to set the VCard on my Ejabberd server nd I am getting the following error.

<iq type="error" xml:lang="en" xmlns="jabber:client" id="PLLMV88my7zc" from="[email protected]" to="[email protected]/CCCC.nY4z">
    <vcard xmlns="vcard-temp">
        <NICKNAME xmlns="vcard-temp">Ar [CCCC]</NICKNAME>
    </vcard>
    <error type="modify" code="400" xmlns="jabber:client">
        <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
        <text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Unknown tag &lt;vcard/&gt; qualified by namespace &apos;vcard-temp&apos;
       </text>
    </error>
</iq>

Also changed the vcard namespace to urn:ietf:params:xml:ns:vcard-4.0 Which returns

<iq type="error" xml:lang="en" xmlns="jabber:client" id="vVsKxiCW2l-o" from="[email protected]" to="[email protected]/CCCC.nY4z">
    <vcard xmlns="urn:ietf:params:xml:ns:vcard-4.0">
        <NICKNAME xmlns="urn:ietf:params:xml:ns:vcard-4.0">Ar [CCCC]</NICKNAME>
    </vcard>
    <error type="cancel" code="503" xmlns="jabber:client">
        <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
        <text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No module is handling this query</text>
    </error>
</iq>

My Request packet was something like below picked up from XEP 0054

Exact Packet sent

<iq type="set" id="Ie9IID3Xc82E" from="[email protected]/CCCC.nY4z">
    <vcard xmlns="vcard-temp">
        <NICKNAME>Ar [CCCCC]</NICKNAME>
    </vcard>
</iq>

Can someone point me to how I can fix this. Server configuration - Ejabberd [docker] Client - Java custom code.


Solution

  • Found out what the problem was instead of vcard i needed the node to be vCard The xmlns to use is xmlns="vcard-temp"

    Do note that the above request needs all the elements available with you in the vcard since its works like a replace and not an update of the delta.