Hi Alex,
Thanks for the quick response. I may need 2 logons for the prototype app I working on. One for the user to use while the other is for services. The first logon works and its onlogon event setup the other xmppclient object. The second xmppclient object onlogon event work fine it seem but then it then goes to onError event. On my ejabberd server I am seeing the first xmppclient object signed on without issue however the second xmppclient object is not. Its authenticated but session never opened.
My Button Click event:
_xmppClient.OnLogin += xmppClient_OnLogin;
_xmppClient.OnError += xmppClient_OnError;
_xmppClient.Username = userList[0].JID;
_xmppClient.Password = userList[0].Password;
_xmppClient.XmppDomain = listSystemSettings[0].DomainName;
_xmppClient.Hostname = listSystemSettings[0].Host;
_xmppClient.Resource = "Individual";
_xmppClient.OnAuthError += _xmppClient_OnAuthError;
_xmppClient.Open();
OnLogon Event (for XmppClient Object):
var systemSettingsCrud1
= new CRUDRepository
<SystemSettings
>();
var listSystemSettings = systemSettingsCrud1.GetByQuery("Select * from SystemSettings", _dbConnection);
_xmppAdmin.OnLogin += xmppAdmin_OnLogin;
_xmppAdmin.OnError += xmppAdmin_OnError;
_xmppAdmin.Username = listSystemSettings[0].JIDAdminId;
_xmppAdmin.Password = listSystemSettings[0].JIDAdminPassword;
_xmppAdmin.XmppDomain = listSystemSettings[0].DomainName;
_xmppAdmin.Hostname = listSystemSettings[0].Host;
_xmppAdmin.Open();
xmppAdmin onLogon Event:
No problem here
xmppAdmin onError Event:
var msg = e.Exception.Message; <---This is where the stacktrace was taken
The stacktrace is as follow:
Inner Exception:
"Object reference not set to an instance of an object"
" at Prototype.Droid.MainActivity.xmppAdmin_OnLogin (System.Object sender, Matrix.EventArgs e) [0x00001] in c:\\C# Projects\\Apps Dev\\Your Messengar App\\ServerApps\\Prototype\\MessagePrototype\\Prototype.Droid\\MainActivity.cs:202 \n
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)\n
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295 "
"Exception has been thrown by the target of an invocation."
" at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00050] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:303 \n
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/reflection/methodbase.cs:277 \n
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/corlib/System/Delegate.cs:471 \n
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/corlib/System/MulticastDelegate.cs:66 \n
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/corlib/System/Delegate.cs:416 \n
at Matrix.XmppStream.DoRaiseEvent (System.Delegate del, System.Object[] args) [0x00000] in <filename unknown>:0 \n
at Matrix.XmppStream.DoRaiseEvent (System.Delegate del, System.Object arg1, Matrix.EventArgs arg2) [0x00011] in <filename unknown>:0 \n
at Matrix.XmppStream.FireOnLogin (System.Object sender) [0x0001c] in <filename unknown>:0 \n at Matrix.XmppStream.FireOnLogin () [0x00000] in <filename unknown>:0 \n
at Matrix.Xmpp.Client.XmppClient.SaslHandlerOnSaslSuccess (System.Object sender, Matrix.EventArgs e) [0x0000c] in <filename unknown>:0 \n
at Matrix.SaslHandler.XmppStreamParser_OnStreamElement (System.Object sender, Matrix.StanzaEventArgs e) [0x00029] in <filename unknown>:0 \n
at (wrapper delegate-invoke) System.EventHandler`1[Matrix.StanzaEventArgs]:invoke_void_object_TEventArgs (object,Matrix.StanzaEventArgs)\n
at Matrix.Xml.XmppStreamParser.DoRaiseOnStreamElement (Matrix.Xml.XmppXElement el) [0x00015] in <filename unknown>:0 "
Hopes this helps....
Will
This post was edited on 2015-12-19, 10:33 by
Alex.