Ok I need an example to help get me started here
Dim client As RemotedWebsiteAdministratorClient = New RemotedWebsiteAdministratorClient() client.Open() client.Close()
Dim client As RemotedWebsiteAdministratorClient = New RemotedWebsiteAdministratorClient() client.Open()
client.Open()
client.Close()
I want to beable to request if any agent is available
Hi Clint. Below is an example of how to login and find the available operators in C#. I hope this helps. The status of all objects on the server is obtained through either a syncdataspool of an Operator or System Administrator. The spool is initialized through the Login method demonstrated below and all updates to the server will come through on a call to Sync for the operator.
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.Text; namespace WindowsDemo { class Program { static ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator> _factoryOp = null; static void Main(string[] args) { _factoryOp = new ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator>(); Version m_GuiVersion = new Version("6.0.0.0"); SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_AccountCannedResponses; SmartMax.SightMax.Chat.AccountCannedResponseAssociationCollection m_AccountCannedResponseAssociations; SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponses; SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponseShortcuts; int m_nOperatorTimeoutSeconds; bool m_bPreviouslyLoggedIn; bool m_whiteboxversion; SmartMax.SightMax.Agent.Operator.OperatorAgentSharedData data = null; SmartMax.SightMax.Agent.Operator.SyncDataSpool initialSpool = null; SmartMax.SightMax.Agent.Operator.SecurityIdentifier sid = new SmartMax.SightMax.Agent.Operator.SecurityIdentifier(-1, -1, Guid.Empty); Version serverVersion = null; using (SmartMax.SightMax.Agent.Operator.ClientOperator client = new SmartMax.SightMax.Agent.Operator.ClientOperator(_factoryOp)) { data = client.IOperator.Login( m_GuiVersion, "OpertorName", SmartMax.SightMax.Utility.Encryption.Encrypt("OpertorPassword"), "MyAccount", out initialSpool, out sid, out serverVersion, out m_AccountCannedResponses, out m_AccountCannedResponseAssociations, out m_OperatorCannedResponses, out m_OperatorCannedResponseShortcuts, out m_nOperatorTimeoutSeconds, out m_bPreviouslyLoggedIn, out m_whiteboxversion); client.IOperator.Logout(sid); } //output operators and their availability foreach(var op in initialSpool.OperatorAgents) Console.WriteLine("Operator: {0}, Availability: {1}", op.Name, op.Availability); //out operators that are account administrators var acctAdmins = initialSpool.OperatorAgents .Where(o => o.Permissions.IsAccountAdmin); foreach (var admin in acctAdmins) { Console.WriteLine("Account Admin: {0}", admin.Name); } } } } Filed under: LoginExample C#
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
namespace WindowsDemo
{
class Program
static ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator> _factoryOp = null;
static void Main(string[] args)
_factoryOp = new ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator>();
Version m_GuiVersion = new Version("6.0.0.0");
SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_AccountCannedResponses;
SmartMax.SightMax.Chat.AccountCannedResponseAssociationCollection m_AccountCannedResponseAssociations;
SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponses;
SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponseShortcuts;
int m_nOperatorTimeoutSeconds;
bool m_bPreviouslyLoggedIn;
bool m_whiteboxversion;
SmartMax.SightMax.Agent.Operator.OperatorAgentSharedData data = null;
SmartMax.SightMax.Agent.Operator.SyncDataSpool initialSpool = null;
SmartMax.SightMax.Agent.Operator.SecurityIdentifier sid = new SmartMax.SightMax.Agent.Operator.SecurityIdentifier(-1, -1, Guid.Empty);
Version serverVersion = null;
using (SmartMax.SightMax.Agent.Operator.ClientOperator client = new SmartMax.SightMax.Agent.Operator.ClientOperator(_factoryOp))
data = client.IOperator.Login(
m_GuiVersion,
"OpertorName",
SmartMax.SightMax.Utility.Encryption.Encrypt("OpertorPassword"),
"MyAccount",
out initialSpool,
out sid,
out serverVersion,
out m_AccountCannedResponses,
out m_AccountCannedResponseAssociations,
out m_OperatorCannedResponses,
out m_OperatorCannedResponseShortcuts,
out m_nOperatorTimeoutSeconds,
out m_bPreviouslyLoggedIn, out m_whiteboxversion);
client.IOperator.Logout(sid);
}
//output operators and their availability
foreach(var op in initialSpool.OperatorAgents)
Console.WriteLine("Operator: {0}, Availability: {1}", op.Name, op.Availability);
//out operators that are account administrators
var acctAdmins = initialSpool.OperatorAgents
.Where(o => o.Permissions.IsAccountAdmin);
foreach (var admin in acctAdmins)
Console.WriteLine("Account Admin: {0}", admin.Name);
What namespace is Encryption.Encrypt under?
Ive edited my post to include full namespaces
Using a VB.NET Website and generating the code using svcutil.exe only exposes SmartMax.SightMax.Utility.PointInTime
Using a VB app and adding a service reference to the project, I don't have the utility namespace.
Sorry, I had assumed the dll had been referenced within the project (SmartMax.SightMax.Common). If you are going strictly from the wsdl, the encryption method is below
/// <summary> /// </summary> public static Byte[] Encrypt(String s) { MD5 md5 = new MD5CryptoServiceProvider(); ASCIIEncoding myAscii = new ASCIIEncoding(); Byte[] ba = md5.ComputeHash(myAscii.GetBytes(s)); return ba; }
/// </summary>
public static Byte[] Encrypt(String s)
MD5 md5 = new MD5CryptoServiceProvider();
ASCIIEncoding myAscii = new ASCIIEncoding();
Byte[] ba = md5.ComputeHash(myAscii.GetBytes(s));
return ba;
Thanks, I'm getting something new now when attempting the login:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Do you know how to fix this?
nevermind, found it in the .config file