Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
TechAddict #1
Member since Apr 2015 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: File Transfer Error
I am Creating My Chat Client with ejabberd Server running. File Transfer Working fine over miranda but when i do it with my client it gives following error after accept the File Transfer
<iq xmlns="jabber:client" to="test2@hichat.cf/TEst" xml:lang="en" type="result" from="a@hichat.cf/Miranda" id="agsXMPP_7"><si xmlns="http://jabber.org/protocol/si"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
<iq xmlns="jabber:client" to="test2@hichat.cf/TEst" xml:lang="en" type="error" from="a@hichat.cf/Miranda" id="agsXMPP_8"><error type="cancel" code="404"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

I had set JID with the resource. For the File Transfer I am using FileTransfer class form MINICLIent. How can you solve this.
Avatar
TechAddict #2
Member since Apr 2015 · 5 posts
Group memberships: Members
Show profile · Link to this post
I had Fixed Sendfile function but cannot receive file it show no compatible mechanism below is the IQ handler
 
  1. private void OnIq(object sender, agsXMPP.protocol.client.IQ iq)
  2.         {
  3.             if (InvokeRequired)
  4.             {
  5.                    
  6.                 BeginInvoke(new IqHandler(OnIq), new object[] { sender, iq });
  7.                 return;
  8.             }
  9.  
  10.  
  11.             if (iq != null)
  12.             {
  13.                
  14.                if (iq.HasTag(typeof(agsXMPP.protocol.extensions.si.SI)))
  15.                 {
  16.                    if (iq.Type == IqType.set)
  17.                     {
  18.                         agsXMPP.protocol.extensions.si.SI si = iq.SelectSingleElement(typeof(agsXMPP.protocol.extensions.si.SI)) as agsXMPP.protocol.extensions.si.SI;
  19.  
  20.                         agsXMPP.protocol.extensions.filetransfer.File file = si.File;
  21.                         if (file != null)
  22.                         {
  23.                             MessageBox.Show("ok");
  24.                             sendfile frm = new sendfile(x, iq);
  25.                             frm.Show();
  26.                         }
  27.                     }
  28.                 }
  29.                else
  30.                 {
  31.                     Element query = iq.Query;
  32.  
  33.                     if (query != null)
  34.                     {
  35.                         if (query.GetType() == typeof(agsXMPP.protocol.iq.version.Version))
  36.                         {
  37.                            
  38.                             agsXMPP.protocol.iq.version.Version version = query as agsXMPP.protocol.iq.version.Version;
  39.                             if (iq.Type == IqType.get)
  40.                             {
  41.                                
  42.                                 iq.SwitchDirection();
  43.                                 iq.Type = IqType.result;
  44.  
  45.                                 version.Name = "Test APP";
  46.                                 version.Ver = "0.5";
  47.                                 version.Os = Environment.OSVersion.ToString();
  48.  
  49.                                 x.Send(iq);
  50.                             }
  51.                         }
  52.                     }
  53.                 }
  54.             }
  55.         }

and below is the get file function
  1. public sendfile(XmppClientConnection XmppCon, IQ iq)
  2.         {
  3.             InitializeComponent();
  4.             cmdSend.Enabled = false;
  5.             this.Text = "Receive File from " + iq.From.ToString();
  6.  
  7.             siIq = iq;
  8.             si = iq.SelectSingleElement(typeof(agsXMPP.protocol.extensions.si.SI)) as agsXMPP.protocol.extensions.si.SI;
  9.             // get SID for file transfer
  10.             m_Sid = si.Id;
  11.             m_From = iq.From;
  12.  
  13.             file = si.File;
  14.  
  15.             if (file != null)
  16.             {
  17.                 m_lFileLength = file.Size;
  18.  
  19.                 this.lblDescription.Text = file.Description;
  20.                 this.lblFileName.Text = file.Name;
  21.                 this.lblFileSize.Text = HRSize(m_lFileLength);
  22.                 this.txtDescription.Visible = false;
  23.             }
  24.  
  25.             m_XmppCon = XmppCon;
  26.  
  27.  
  28.             this.progress.Maximum = 100;
  29.             //this.Text += iq.From.ToString();
  30.  
  31.             //this.tbFileSize.Text = FileTransferUtils.ConvertToByteString(m_lFileLength);
  32.  
  33.             XmppCon.OnIq += new IqHandler(XmppCon_OnIq);
  34.         }
This post was edited on 2015-04-20, 01:45 by Alex.
Avatar
Alex #3
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I need your Xml logs to see why it fails.
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: agsXMPP RSS