Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page:  1  2  next
Avatar
gauravbr #1
Member since Mar 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP not Working on Windows Mobile 6 Emulator
Hi,

I created a sample application for WM 6.
I have added the agsXMPP & crypto .dll reference to the project. The dlls I have upgraded to .NET CF v3.5. I tried using the older version it gave error.
I have attached the screenshot of the screen which has one button to login and a label to display the login status of user.

Below is my code.

        private XmppClientConnection _xmppClient;
        delegate void OnMessageDelegate(object sender, agsXMPP.protocol.client.Message msg);
        delegate void OnPresenceDelegate(object sender, Presence pres);
        delegate void OnMessageDelegate1(agsXMPP.protocol.client.Message msg);


        public Form1()
        {
            InitializeComponent();
            _xmppClient = new XmppClientConnection();
            _xmppClient.OnError += new ErrorHandler(_xmppClient_OnError);
            _xmppClient.OnRosterStart += new ObjectHandler(_xmppClient_OnRosterStart);
        }

        void _xmppClient_OnRosterStart(object sender)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new ObjectHandler(_xmppClient_OnRosterStart), new object[] { this });
                lblStatus.Text = "Online";
                return;
            }
          
        }

        void _xmppClient_OnError(object sender, Exception ex)
        {
            lblStatus.Text = "Error.";
        }

 private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
               
                _xmppClient.Username = "test";
                _xmppClient.Password = "test";
                _xmppClient.Priority = 1;
                _xmppClient.Port = 5222;
                _xmppClient.Server = "Machine1";
                _xmppClient.ClientSocket.Connect();
                _xmppClient.Show = agsXMPP.protocol.client.ShowType.NONE;
                _xmppClient.UseCompression = false;
                _xmppClient.UseStartTLS = false;               
                _xmppClient.Open();           
            }
            catch (Exception ex)
            {               
               
            }
       }
    }


My XMPP server is configured on the same machine on which I am doing the development. The server name is Machine1.
When I run the project the _xmppclient.open() works without any error but I don't see the user test being online on the server.

Can anyone help me in executing this code.
Please let me know if I am missing any process of deployment or if the code is Improper.

Waiting for help.
Gaurav Rathod
The author has attached one file to this post:
WM_6_XMPP.JPG 22.4 kBytes
You have no permission to open this file.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The code looks correct.
  • Is your emulator network configured?
  • Can the emulator resolve the domain Machine1?

If yes, can you subscribe to the Xml Debug handlers and post the debug Xml here if there is any? If there is none then you are not able to connect from the emulator to your local server. In this case it may be easier to configure the emulator for internet access and use one of the public available servers for your first tests. If they succeed you can work on the emulator network to connect to your local server.

Alex
Avatar
ayyrk #3
Member since Jul 2007 · 92 posts
Group memberships: Members, Premium
Show profile · Link to this post
Hi, Just some questions and suggestions..

What does the _xmppClient.ClientSocket.Connect() accomplish? I've been working with WIMO 6.1 and using something like this to get the device to connect to the Internet:

WebResponse response;
webRequest = WebRequest.Create("http://www.google.com");
response = webRequest.GetResponse();

Is the ClientSocket.Connect doing something like that?

Also, small thing, but you overlooked calling this on the GUI thread: lblStatus.Text = "Error.";

And Pocket IE is good for testing emulator network connectivity. Try changing the emulated WIMO connection type to WORK and back to Internet - that can trigger it to refresh it's DHCP address. That may help get the network properly configured.

-Ayyrk
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by ayyrk:
WebResponse response;
webRequest = WebRequest.Create("http://www.google.com");
response = webRequest.GetResponse();

Is the ClientSocket.Connect doing something like that?

no, I expect that the device is connected properly to the Internet when xmpp.Open() gets called.

Alex
Avatar
gauravbr #5
Member since Mar 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

The connection to the Jabber server via WM 6 is established.
I don't know why it was earlier not working even though the emulator was connected to the network via Active Sync.

Anyways thanks for the tip.
Avatar
tenneriello #6
Member since Jul 2009 · 2 posts
Group memberships: Members
Show profile · Link to this post
Hi everyone,
I have the same problem of gauravbr  with my client on Windows Mobile 6 device .
XMPPClientConnection seems to run correctly but user is not online and no message is sent.
Client socket is not connected , even after some seconds.
My xmpp server is openfire.

How did you solve this problem?

Thanks

Eugenia
Avatar
Alex #7
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • please post your Xml Logfile
  • to which server are you connecting, are your settings correct?
Avatar
tenneriello #8
Member since Jul 2009 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex the problem was just this.
I used domain wrong settings for my server.
Bye  :-)
Avatar
mikrixara #9
Member since Oct 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Hi all!

I created a mobile project in Visual Studio 2008, Compact Framework v3.5, Windows Mobile 6 and I want to make a connection with an XMPP server (openfire). I followed the instructions such as to add agsXMPP.dll to references and include the appropriate using statements but when I deploy the solution the following error occures:

"THe version of the assembly System, Version=2.0.0.0, Culture=neural, PublicKeyToken=B77A5C561934E089 cannot be located by this version of the Microsoft .NET Compact Framework".

I think that there is a problem with the .dll file. I found this .dll in "C:\Program Files\AG-Software\agsXMPP SDK\agsxmpp\bin\Net35\Release" after downloading the agsXMPP Version 1.10.
Is there any update and where can I find it?


Any help is welcome.
Thanks in advance!  :-)
Avatar
Alex #10
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you are using the wrong libraries. You have to use the libs in the CF2 folder. CF stands for Compact Framework.
Also look at the Windows Mobile example client.

Alex
Avatar
mikrixara #11
Member since Oct 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex for your reply. Now I'm ok with the references but I have another problem...  :rolleyes:

I tried to run the MiniClientWM5 example on a Windows Mobile 5 emulator and it worked perfectly.

Then I tried to copy and paste all the classes of MiniClientWM5 to my Windows Mobile project (which runs on windows mobile 6) and to invoke frmMain class from my project with the following code:

frmMain myclient = new frmMain();
myclient.ShowDialog();

But unfortunately I can't connect to the server because authenticated property is false.

Any ideas? Are there any changes I have to do?

Thanks again.
This post was edited on 2009-10-28, 20:42 by mikrixara.
Avatar
mikrixara #12
Member since Oct 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Nothing yet...
Maybe the problem is very stupid but I still cannot find a solution. So if somebody knows something about it, I will appreciate his help very much!
Avatar
Alex #13
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry, no idea. It works on all Windows Mobile Operating systems. It doesn't matter if it is WM5, 6 or 6.5.
There must be a problem with your code, the emulator, device or Internet connection.

Alex
Avatar
mikrixara #14
Member since Oct 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Ok I just give some more information. I use OpenFire server on localhost. I have attached the screenshot of the debug log where "new-world" is the name of my computer.
The author has attached one file to this post:
DebugLog.png 10.5 kBytes
You have no permission to open this file.
Avatar
Alex #15
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this is a TLS issue. Please set UseTls to false before you connect.

Alex
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:
Page:  1  2  next
Forum: agsXMPP RSS