Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
aeoth #1
Member since Apr 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP appears to do nothing?
Using the sample code on the front page, or the GTalk specific sample, I can't seem to get agsXMPP to work.
My test app compiles fine, it just doesn't throw any exceptions, it doesn't fire OnLogin, OnWriteXML, OnMessage, OnError, OnAuthError...etc, other accounts can't see either.

Funnily enough, the Samples all work flawlessly.

Using VS2008, to connect to (existing) gmail.

            XmppClientConnection xmpp = new XmppClientConnection();
            xmpp.Server = "gmail.com";
            xmpp.ConnectServer = "talk.google.com";
            xmpp.Username = "username";
            xmpp.Password = "pw";
            xmpp.AutoResolveConnectServer = true;
            xmpp.Open();

Any thoughts as to what I've done wrong?
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
we need more info. is this code in a windows forms app or in a console app. Can you post the whole app?
And please post your Xml Debug.

Alex
Alexander Gnauck
AG-Software
Avatar
aeoth #3
Member since Apr 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #1
It doesn't matter whether its a Console, WPF, WinForms, or CF app. Its just the standard project types for those, C#, .NET2 (or 3.0 for WPF).
As for XML debug, uhh..where will I find that? (heh, I sure that sounds just a tad n00bish :/)

For my test app at the moment, its winforms. The only object is a ListView (listView1)

the form1.cs is (although I've tried a few different combinations, stemming from the sample pages):

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using agsXMPP;
using agsXMPP.protocol;
using agsXMPP.protocol.iq;
using agsXMPP.protocol.iq.disco;
using agsXMPP.protocol.iq.roster;
using agsXMPP.protocol.iq.version;
using agsXMPP.protocol.iq.oob;
using agsXMPP.protocol.client;
using agsXMPP.protocol.extensions.shim;
using agsXMPP.protocol.extensions.si;
using agsXMPP.protocol.extensions.bytestreams;

using agsXMPP.protocol.x;
using agsXMPP.protocol.x.data;

using agsXMPP.Xml;
using agsXMPP.Xml.Dom;

using agsXMPP.sasl;

namespace test
{
    public partial class Form1 : Form
    {
        XmppClientConnection xmpp;
       
        public Form1()
        {
            InitializeComponent();

            XmppClientConnection xmpp = new XmppClientConnection();
            xmpp.Server = "gmail.com";
            xmpp.ConnectServer = "talk.google.com";
            xmpp.Username = "<username>";
            xmpp.Password = "<password>";
            xmpp.AutoResolveConnectServer = true;
            xmpp.Status = "hi";
            xmpp.Open();
            xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
           
        }

        void xmpp_OnLogin(object sender)
        {
            MessageBox.Show("hai2u");
        }

    }
}
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by aeoth:
As for XML debug, uhh..where will I find that? (heh, I sure that sounds just a tad n00bish :/)

look at the OnReadXml and OnWriteXml events.
And add all your handlers before calling the Open method.

Alex
Alexander Gnauck
AG-Software
Avatar
aeoth #5
Member since Apr 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
Cool, that seems to of "fixed" it for lack of a better word (by changing the handlers before the open)

Thank you Alex, I'm looking forward to playing around with this for WinCE :)
Avatar
Anuj #6
Member since Aug 2011 · 3 posts
Group memberships: Members
Show profile · Link to this post
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using agsXMPP;
  10. using agsXMPP.protocol.client;
  11. using System.Threading;
  12. using agsXMPP.net.dns;
  13. using agsXMPP.Xml.Dom;
  14. using agsXMPP.Xml.xpnet;
  15. using agsXMPP.Xml;
  16. using agsXMPP.sasl;
  17.  
  18.  
  19. namespace IM2
  20. {
  21.     public partial class Login : Form
  22.     {
  23.         XmppClientConnection client = new XmppClientConnection();
  24.         XmlReadMode xmlread = new XmlReadMode();
  25.         XmlWriteMode xmlwrite = new XmlWriteMode();
  26.          
  27.        
  28.         public Login()
  29.         {
  30.             InitializeComponent();
  31.         }
  32.  
  33.         private void textBox2_TextChanged(object sender, EventArgs e)
  34.         {
  35.             textBox2.UseSystemPasswordChar = true;
  36.  
  37.         }
  38.  
  39.         private void button1_Click(object sender, EventArgs e)
  40.         {
  41.             Jid jiduser = new Jid(textBox1.Text);
  42.             client.Password = textBox2.Text;
  43.             client.Server = jiduser.Server;
  44.             client.Username = jiduser.User;
  45.             client.AutoResolveConnectServer = true;
  46.             client.OnReadXml+=new XmlHandler(client_OnReadXml);
  47.             client.OnWriteXml += new XmlHandler(client_OnWriteXml);
  48.             client.Open();
  49.         }
  50.        
  51.  
  52.         void client_OnWriteXml(object sender, string xml)
  53.         {
  54. #pragma warning disable
  55.             throw new NotImplementedException();
  56.             richTextBox1.ReadOnly = true;
  57.             richTextBox1.Text = xmlwrite.ToString();
  58.         }
  59.  
  60.         void client_OnReadXml(object sender, string xml)
  61.         {
  62. #pragma warning disable
  63.             throw new NotImplementedException();
  64.             richTextBox2.Text = xmlread.ToString();
  65.            
  66.         }
  67.  
  68.     }
  69.  
  70.    
  71.     }


This is my code for the gtalk client, i have tried most of the things but it does not seems to login to the gmail server. Please help. I have gone thru the miniclient examples, but i need help at this one. Thank You
This post was edited on 2011-08-26, 09:33 by Alex.
Avatar
Anuj #7
Member since Aug 2011 · 3 posts
Group memberships: Members
Show profile · Link to this post
And also i am not getting any xml data in the richTextboxes. So kindly provide me with a suitable and working solution. Thanks.
Avatar
Alex #8
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There is the MiniClient example and teh Talk example. Both work fine with the GTalk servers for me.
If it does not work for you then please make sure that you run the latests codes from SVN.

Alex
Alexander Gnauck
AG-Software
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 SDK Support RSS