ASP.NET Interface

Requirements

The ASP.NET interface is designed to run under Windows' IIS, Internet Information Server, and Microsoft's .NET platform.

Running Under IIS

The ASP.NET web server interface is located in the runtime/asp.net subdirectory. To run it:

  1. Create a new directory in InetPub\wwwroot named 'KW'.
  2. Copy the contents of the runtime\asp.net directory to KW (this includes the \bin subdirectory).
  3. In the Control Panel | Administrative Tools, use the .NET Framework Configuration tool to add 'amzinet.dll' in the /bin subdirectory into the Assembly Cache, then Configure the amzinet.dll assembly from the cache.
  4. Copy amzi.dll, amzi.cfg, aosutils.lsx and aodbc.lsx from knowledgewright4\workshop to your InetPub\wwwroot\KW\bin directory. You may need to copy these files to your Windows\System32 or WINNT\System32 directory instead (this is a 'limitation' in the current version of .NET).
  5. Copy a jig, either basic.xpl or support.xpl, from knowledgewright4\workshop\jigs to your InetPub\webapps\KW directory.
  6. Copy your knowledgebase to InetPub\wwwroot\KW modified as described in the following section.
  7. Open the IIS (Internet Services) Manager in your Control Panel. Add a new virtual directory named 'KW' and browse to the InetPub\wwwroot\KW directory created above. For permissions make sure click read, execute (ASP.NET) and write (for KnowledgeWright's session files).
  8. In the IIS Manager, make sure your Web site is running. If not, start it.

Question_Top and Output_Continue

There are two options for using the ASP.NET interface. One method is to put all the HTML for your page layout (e.g. headers, footers, decorative graphics) in the main knowledgebase object. The advantage to this approach is the ASP.NET interface can be used out-of-the-box without further modification.

The other is to put the minimum amount of HTML in the main knowledgebase object, and use Visual Studio .NET or some other tool to modify the ASP page. This requires modifying the ASP.NET interface, but is much easier for pages with many additional elements in addition to KnowledgeWright's inputs and outputs.

In your main knowledgebase object, you must have these minimal HTML elements which are inserted above and below all questions asked of the user:

Property Name Minimal Value
question_top
 
question_bottom
<INPUT NAME="Submit" TYPE="Submit" 
VALUE="Continue"> </INPUT> 
output_continue 
(not in all Jigs)
<INPUT NAME="Submit" TYPE="Submit" VALUE="Continue"> 

</INPUT>

In addition, some jigs (notably Basic) also have an output_continue property in the knowledgebase object. This is used when there is output for the user and the reasoning process is not complete. That is, some intermediate results or information are being displayed for the user. In this case the output_continue contents are added to the web page and are an empty HTML form that continues the reasoning process.

In addition the following properties are passed to your web server:

Parameter
Description
Examples
charset

The character set used in your knowledgebase

ISO-8859-1 big5

Running in Your Web Browser

To run your knowledgebase, type into your browser the following URL:

http://localhost/KW/KWForm.aspx?kb_file=hello.kb

Replace the 'localhost' with the name (www.company.com) or IP address of the server you have installed the KnowledgeWright ASP.NET page on.

ASP.NET Page Parameters

There are additional parameters that you can specify in the query string. Separate each of the parameters by ampersands (&) and encode them with standard URL encoding. The full set of parameters are:

Parameter
Description
Examples
kb_file

The name of the knowledgebase file (no quotes)

amzi_website_advisor.kb
directory

The directory where the kb_file is located.

c:\InetPub\webapps\KW
temp_directory

The directory where the temporary session files are created as well as log files (if you have specified one) and any other temporary files needed by KnowledgeWright. Note ASP.NET pages must have write access to this directory.

c:\InetPub\webapps\KW\temp 
log_file

The name of the log file that details the execution. It will have the same contents as the log in the KnowledgeWright Workshop.

kwrun.log

Debugging ASP.NET Problems

Cannot find amzinet.dll or one of its dependencies

If you get the error that ASP.NET cannot find amzinet or one of its dependencies, it is likely because amzi.cfg, amzi.dll, aosutils.lsx and/or aodbc.lsx were not copied to the windows/system32 directory.

Stop/Restart IIS

Also you might have to stop/restart IIS and/or use Task Manager to stop the aspnet_wp process.

Specify a Log File

The next thing to do when you encounter a problem is to specify a log_file in the query string where you invoke the web page.

To specify your kb file and a log file:

http://localhost/KW/KWForm.aspx?kb_file=hello.kb&log_file=kwrun.log

This will create a log file in the same directory as your knowledgebase file. Study its contents, especially at the bottom to see if the problem is explained.

Use an Empty Form

If your knowledgebase is not working the same as in the Workshop, then remove all extra elements from the KWForm.aspx file (in other words use the version provided in the runtime/asp.net directory) so you are running on a blank page. If that works, one of your additional elements is causing GET requests.

Turn on ASP.NET's Trace Facility

In the Web.config file under trace set enabled="true" and pageOutput="true"and if needed localOnly="false", e.g.

<trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="false" />

Run Under Visual Studio in Debug Mode

To Debug under Visual Studio, in the Web.config file under compilation, set Debug="true" as follows:

    <compilation defaultLanguage="vb" debug="true" />

and build the Debug version of the project. To display KnowledgeWright's ASP.NET Debug Log at the bottom of each screen set the KW_DEBUG constant in KWForm.aspx.vb to True.

You might also want to try setting the KW_SAVE_SESSION constant in KWForm.aspx.vb to True. This will save the state of the reasoning engine on disk (in the specified temp_directory) after each page submit.

Open an Amzi! Logic Server Trace File for Amzi! Tech Support

If none of the above items do not make the problem clear, the next step is to specify a log file in Amzi! Prolog + Logic Server. To do this, add the following lines to your amzi.cfg file in the /bin subdirectory:

apitrace = on 
logfile = c:\amziapi.log

If you need technical support, please e-mail the browser output when you run KW, your KnowledgeWright log file and Amzi! Logic Server trace file along with your knowledgebase to tech support.

Modifying the ASP.NET Page

To modify and rebuild the web page you can use the VB.NET project, KW.sln.

References

See Microsoft's ASP.NET Website.

 


Copyright ©1996-2002 Amzi! inc. All Rights Reserved. Amzi!, KnowledgeWright and WebLS are registered trademarks and Subscription Plus and Logic Server are trademarks of Amzi! inc.