Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
matiasMunoz988 #1
Member since Oct 2010 · 5 posts · Location: Cordoba - Argentina
Group memberships: Members
Show profile · Link to this post
Subject: How to send a message from an external component
Hi everybody. I'm quite new at this technology, and I' m trying to do a PoC for my job. I tried to start making an external component, that connects to the server and then send a message to a Pidging account.
The Server chosen is OpenFire or Ejabberd. With both servers I connect, but i don't get through to send a message to the Pidging account.
This is my code:

public static void Main(string[] args)
        {
            XmppComponent comp = new XmppComponent();

            comp.Hostname = "home";
            comp.XmppDomain = "home";
            comp.Password = "admin";
            comp.Port = System.Int16.Parse("5275");

            try{
            comp.Open();}
                catch (Exception e) {Console.WriteLine(e);}

            System.Console.WriteLine("Press a key to send a message");
            System.Console.ReadKey();

            try
            {
                comp.Send(new Message
                {
                    To = "matias@home/pidging",
                    Type = Matrix.Xmpp.MessageType.chat,
                    Body = "Theres been a setting change"
                });
            }
            catch (Exception e) { System.Console.WriteLine("{0}", e);}

            System.Console.WriteLine("Message send it succesfully");
            System.Console.ReadKey();
        }

Ok, like I explain before, I connect to the Server but I can't send a message to the user. I don't know what I'm doing wrong. I hope you can help me in anyway.
I put a try catch, for see the error, but it seems like there's no error trying to send the message.

Thanks a lot. Matias
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
can you please post your complete xml log?

Alex
Avatar
matiasMunoz988 #3
Member since Oct 2010 · 5 posts · Location: Cordoba - Argentina
Group memberships: Members
Show profile · Link to this post
Hi Alex, to tell you the truth I don't know how to do that. Can you guide me a little bit?
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
see: http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…
This post was edited on 2013-02-25, 21:32 by Alex.
Avatar
matiasMunoz988 #5
Member since Oct 2010 · 5 posts · Location: Cordoba - Argentina
Group memberships: Members
Show profile · Link to this post
Alex I solve my problem. I change a few things in the configuration of the Server, and also add the atribute "From" in the message, and it works just fine with Ejabberd. With OpenFire the same code, didn't work, I don't know if somthing that i have to change on the Server.
I want also to ask about XEP-0033: Extended Stanza Addressing. I have read from an old post, that in that time agsXMPP doesn't support it. I want to know if right it is possible to do this or if is not supported yet. I don't know if i have to create a new post, different from this one, to do that. Also if it is supported, where I can find tutorials or something for it. Thanks a lot Alex
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by matiasMunoz988:
I want also to ask about XEP-0033: Extended Stanza Addressing. I have read from an old post, that in that time agsXMPP doesn't support it. I want to know if right it is possible to do this or if is not supported yet. I don't know if i have to create a new post, different from this one, to do that. Also if it is supported, where I can find tutorials or something for it. Thanks a lot Alex

XEP-0033 is in the latest developer version of MatriX. Contact be email when you need a new release.

Alex
Avatar
matiasMunoz988 #7
Member since Oct 2010 · 5 posts · Location: Cordoba - Argentina
Group memberships: Members
Show profile · Link to this post
Hi alex, I was wondering if there's a way of taking off the message of trial Matrix. This is because I develop a Windows Service to connect to the server a send a message, but when I try to start my service nothings happens. I debug the service and in the EventViewer an errors appears. This is the low when I try to start my service:

Service cannot be started. System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

I don't know if I have to buy Matrix for it, of there's a way of first trying this without the dialog box, and then analyze if I buy it or not.

Thanks a lot Alex.

Matias
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
we can issue temporary evaluation licenses. If you need one contact me directly by email.
But whether your code runs as a simple windows forms app or as a windows service should make no difference for your evaluation.

Alex
Avatar
Nariman #9
Member since Jan 2013 · 1 post
Group memberships: Members
Show profile · Link to this post
Alex, might I suggest you return an exception for the licenses instead of showing a modal dialog? Your component shouldn't have any dependencies on System.Windows.Forms, people may be running this within services or web applications.
Avatar
Alex #10
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
When you have a valid license or evaluation license the System.Windows.Forms code gets never called.
I see no problems here.

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:
Forum: MatriX RSS