Asmack won't load VCard

I am using the Asmack binary release (I will build it as soon as I have some time as I had problems the first time I tried). I also created my own ejabberd server.

When I try to load any contact VCard, the server returns information, but Asmack doesn't seem to like it (or can't parse it).

This is what I see in debug mode:

<iq from='user@domain' to='admin@domain/Smack' id='I17sI-4' type='result'>
<vCard xmlns='vcard-temp' prodid='-//HandGen//NONSGML vGen v1.0//EN' version='2.0'>
    <FN>Full Name</FN>
    <N>
        <FAMILY>Surname</FAMILY>
        <GIVEN>Nick</GIVEN>
    </N>
    <NICKNAME>Nickname</NICKNAME>
    <URL>http://google.com</URL>
    <ADR>
        <LOCALITY>lanta</LOCALITY>
        <REGION>krabi</REGION>
        <PCODE>81150</PCODE>
        <CTRY>thailand</CTRY>
    </ADR>
    <EMAIL>
        <USERID>user@domain.com</USERID>
    </EMAIL>
</vCard>
</iq>

      

But when I do

VCard card = new VCard();
card.load(xmppConn, "user@domain");

      

All information is set to null, and when I try to view the XML by calling the VCard.toXML () method, I just got empty XML like this

<iq id="I17sI-4" to="user@domain" type="get"><vCard xmlns='vcard-temp'/></iq>

      

So, does anyone know what I am doing wrong, or if this is a binary release that cannot parse the VCard it received from the server?

+1


source to share


1 answer


Add line: ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new VCardProvider());

before loading the business card.



+4


source







All Articles