Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
anas.zgh #1
Member since Feb 2014 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Request a User's Vcard
I'm requesting a VCARD for a user but it returns an error

  1. <iq type="error" id="MX_14" from="XXXXX" to="XXXXX" xmlns="jabber:client">
  2.  <vCard xmlns="vcard-temp" />
  3.  <error code="503" type="cancel">
  4.     <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  5.  </error>
  6. </iq>
This post was edited on 2014-02-16, 11:34 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I need the request and the reply. And please don't xxx out the complete from and to attributes, because they are important and seem to be your problem.

Alex
Avatar
anas.zgh #3
Member since Feb 2014 · 6 posts
Group memberships: Members
Show profile · Link to this post
here is the code to request the VCARD
  1. private void RequestVcardSynchronous(string jid)
  2.         {
  3.             var viq = new VcardIq(IqType.get) { To = jid };
  4.             Singlton.instance.client.IqFilter.SendIq(viq, VCardResult);
  5.         }
The XML Sent is
  1. <iq id="MX_11" type="get" to="962785579783@esal.com/Smack" xmlns="jabber:client">
  2.  <vCard xmlns="vcard-temp" />
  3. </iq>
and the received XML is
  1. <iq type="error" id="MX_14" from="962785579783@esal.com/Smack" to="962798479529@esal.com/Smack" xmlns="jabber:client">
  2.  <vCard xmlns="vcard-temp" />
  3.  <error code="503" type="cancel">
  4.     <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  5.  </error>
  6. </iq>
This post was edited 2 times, last on 2014-02-16, 13:23 by Alex.
Edit reason: fixed code formating
Avatar
Alex #4
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
a vcard is requested from the server, and its not specific to a resource.
This means the to property must be a bare Jid, not a full Jid. Once you fix this it will work.

Alex
Avatar
anas.zgh #5
Member since Feb 2014 · 6 posts
Group memberships: Members
Show profile · Link to this post
Thanks it works fine now
Avatar
Alex #6
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
great, a small hint.

When you are on WP8 I suggest the TAP pattern instead of a synchronous call like yu have now.

See also:
http://www.ag-software.net/2013/08/27/await-matrix/
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS