I am trying to connect my C# application to XMPP server but keep getting error.
I am using jabber-net library to connect. However i was able to connect to XMPP server through pidgin. Following are the screen shot from pidgin:
Following is the code in C# to connect to same server:
private void Form1_Load(object sender, EventArgs e)
{
try
{
jabberClient2.Password = "MyPass";
jabberClient2.User = "9001";
jabberClient2.AutoRoster = true;
jabberClient2.Server = "Some_IP";
jabberClient2.NetworkHost = null;
jabberClient2.Port = 5222;
jabberClient2.PlaintextAuth = true;
jabberClient2.Resource = "pidgin2";
jabberClient2.AutoLogin = true;
jabberClient2.AutoPresence = false;
jabberClient2.AutoStartTLS = true;
jabberClient2.Connect();
}
catch (Exception ex)
{
return;
}
}
I am getting following error:
{jabber.connection.sasl.AuthenticationFailedException: Error binding resource: <error type="modify" code="400"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error>}
Also attached the CS file for the program.