Can this Program# implement in Web interface (.aspx)?
I tried to using AIMLBot as reference in an aspx website while processing an input from user there is an error occured:
NullReferenceExeption was unhandled by user code
But if I use Windows Form (AIMLGui) to proccess same AIML file. It works normally.
Take a look at the web-service example code - its very basic but demonstrates a very simple working example. It shouldn't be too different to adapt the implementation into an ASP.NET 2.0 web application. The important thing to remember to do is:
1. Instantiate your bot at the start of the application's life cycle and make it available to your application - check out the Global.asax file to see how I've done it.
2. Have some means of storing your users - perhaps in a database or in throw-away sessions.
3. Have some way to identify the user - session is probably the simplest way to do this.
Best of luck!
I'm trying to have the aimlbot working on the web.
I got the webservice example and I have a new project called botService.
The bot Service project contains:
the aiml files (aiml folder)
config files (config folder)
a reference for aimlbet.dll
Service Class (the same that i got in the example)
UserSession Class (the same that i got in the example)
When I try to work with the available methods (acessing a asmx file by localhost) I am able to create a user, to get the GUID, but the chat method returns "".
I create another web apllication, using just the webservice class provided by wsdl.exe file.
I don't have any reference for aimlbot.dll and there is no code in the global asax file either.
I have just this code in the load method (in order to test):
Session["username"] = "Mike";
string username = Session["username"].ToString();
string answer = "";
string guiID = "";
wsService wsBotService = new wsService();
bool userCreation = wsBotService.createUser(username);
guiID = wsBotService.getGUIDForUser(username);
Session["sessionguiId"] = guiID;
answer = wsBotService.Chat("Hi",Session["sessionguiId"].ToString());
answer = wsBotService.Chat("How are you?",Session "sessionguiId"].ToString());
answer = wsBotService.Chat("My name is Mike",Session["sessionguiId"].ToString());
Everything works, but there is no answer from the bot.
Thanks a lot
It was my fault.
The problem was change the path in the config.xml file.