IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Create Kofax TotalAgility (KTA) SDK API in ASP.NET

Overview

Kofax TotalAgility (KTA) is a Smart Process Application (SPA) platform that transforms and simplifies business interactions. Many people thinks Kofax TotalAgility as merely a document capture software but it actually does more than just an OCR software. KTA is an enterprise solution for document management and business process automation platform with OCR is just part of the whole suite.

As in any enterprise-level application, KTA can be easily customized with the provided SDK. This tutorial will show you how to setup a Visual Studio project to create a KTA Web Service in ASP.NET.

Caveat

At this time, you cannot use ASP.NET Core to call KTA SDK. Hopefully this will be addressed in future version.

Requirements

  1. Visual Studio (2019 is used for this example)
  2. Kofax TotalAgility version 7.7 or later
  3. .NET Framework 4.8 (minimum version 4.7)

Steps to Create Visual Studio Project

  1. Launch Visual Studio and create a new Project.

    Visual Studio New Project

  2. On the Create a new project window, select the following settings: C#, Windows, Web. Click Next.

    Visual Studio Project Web Application .NET Framework selection

  3. On the Configure your project screen, type in your Project Name and the Location for your project. Under Framework select .NET Framwework 4.8. Click Create button.

    Visual Studio configure a project for KTA

  4. Select Web API on the Create a new ASP.NET Web Application and click Create button once again.

    Visual Studio Create a new ASP.NET Web Application

  5. Open File Explorer to the project’s bin folder and add the following KTA DLLs. You can copy them from
    C:\Program Files\Kofax\TotalAgility\Agility.Server.Web\bin folder in your KTA installation.

    1. Agility.Sdk.Model.dll
    2. Agility.Server.Common.dll
    3. Agility.Server.Core.dll
    4. Agility.Server.Core.Model.dll
    5. Agility.Server.Integration.Common.dll
    6. TotalAgility.Sdk.dll

    Depending on the need of your application, you may need to copy other DLLs, but I found that this is the minimum you need in order to make it work.

    Copy KTA DLLs to bin folder

  6. Next, we want to right-click on References on the right window and click Add Reference… to all the above DLLs. From time to time, you will encounter an error such as ReferenceManagerPackage package did not load correctly. Make sure you take care of that issue first by following these steps.

    Visual Studio Add Reference

  7. Select Browse on the left and click on Browse button.

    Visual Studio Add Reference Browse Window

  8. Select all the DLLs you just copied from KTA installation by pressing SHIFT-key while clicking on each of them. Click on Add button when done.

    Visual Studio Add Reference KTA DLLs

  9. Press OK button. Make sure all the DLLs are added under the References.

    Visual Studio Add Reference KTA DLLs OK button
    KTA DLLs Check in Visual Studio

Now you are ready to code KTA Web Service in ASP.NET. Happy coding!

Reference

Kofax Knowledgebase

March 22, 2021 Filed Under: How To Tagged With: ASP.NET, Kofax TotalAgility, Visual Studio

How to Use SQL Server Express to Store ASP.NET Session State

ASP.NET Session State SQL Server Mode provides a good way to have a persistent session, especially for server farm configuration. Here are the steps to quickly configure the environment to do so using SQL Server Express edition (because sometimes, you don’t need the full-blown version of SQL Server just to track sessions).

Steps

  1. Download and install SQL Server Express.

  2. Open the file, select install and follow the instructions.

  3. On the Instance Configuration screen, you can change the Named instance if you want to, but for this example, it’s left with the default SQLExpress.

    SQL Server Setup Instance Configuration

  4. On the Server Configuration screen, make sure SQL Server Browser is set to Automatic so you can connect from a remote machine.

    SQL Server Setup Server Configuration

  5. Keep moving along the screens and wait until the installation process completed. Make sure all components are successfully installed and click on Close button.

    SQL Server Setup Complete Installation

Create ASPState Database in SQL Server

In your DB server, open the Command Prompt (Admin) and type in the following command:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql -ssadd -d [DATABASENAME] -S [SERVERNAME]\SqlExpress -sstype c -E

If you use a custom database name (instead of the default ASPState by using option -sstype p), then at the end of the process, you’ll see the following message:

To use this custom session state database in your web application, please specifiy it in the configuration file by using the 'allowCustomSqlDatabase' and 'sqlConnectionString' attributes in the <system.web>\<sessionState> section.

Setup Custom AspState DB

So you have to change your default connectionString from:

<sessionState mode="SQLServer" cookieless="false" timeout="480" sqlConnectionString="Data Source=[SERVERNAME]\SqlExpress;User Id=MySession;Password=MySessionPassword" />

To:

<sessionState mode="SQLServer" cookieless="false" timeout="480" sqlConnectionString="Data Source=[SERVERNAME]\SqlExpress;Initial Catalog=[DATABASENAME];User Id=MySession;Password=MySessionPassword" allowCustomSqlDatabase="true" />

If you can’t still see the difference, there are two additions on the sessionState element. The first one is the addition of Initial Catalog=[DATABASENAME] under sqlConnectionString and the second one is at the end of markup, allowCustomSqlDatabase=”true”.

Further Reading

Beginning ASP.NET 4.5 in C#: Chapter 6 – State Management (p. 263-266)
Professional Microsoft IIS 8: Advanced Administration (p. 501-545)
Session-State Modes
Creating the Application Services Database for SQL Server
ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)
ASP.NET Session State

January 5, 2016 Filed Under: How To Tagged With: ASP.NET, SQL Server

How to Fix Obsolete ConfigurationSettings.GetConfig API

When you’re upgrading code from .NET Framework 1.1 to 2.0, you will get a few warnings if you use an obsolete API such as ConfigurationSettings.GetConfig, you may see something similar to this:

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection

To which you have to replace it with ConfigurationManager.GetSection(). Or the same way with ConfigurationSettings.AppSettings.Get() to ConfigurationManager.AppSettings.Get(). The problem is after you made the change, you will encounter another error during compilation such as this:

'ConfigurationManager' is not a member of 'Configuration'.

The solution, while it’s not intuitive is actually very simple. You need to add a reference to System.Configuration.dll to the assembly.

  1. If you’re using a default view, on the right pane of your Visual Studio under your project you can right click on the References and select Add Reference….

    Add reference in Visual Studio's solution explorer

  2. Under Assemblies, look for System.Configuration and make sure it’s checked, then click OK.

    Add System.Configuration.dll reference in Visual Studio

That’s all there is to it.

Further Reading

ConfigurationSettings.GetConfig Method

April 27, 2015 Filed Under: .NET Tagged With: ASP.NET, Microsoft, Visual Studio

How to Resolve Login failed for user ‘DOMAIN\PCNAME$’

When migrating ASP.NET applications from Windows Server 2003 (IIS 6) to 2012 R2 (IIS 8.5), right away, one web application displayed the yellow screen of death with the following error message:

System.Data.SqlClient.SqlException: Login failed for user ‘DOMAIN\SERVERNAME$‘.

If your application is on a private network, depending on your situation, there is a few approaches you can take.

Options

  1. Grant DOMAIN\SERVERNAME$ user id read and write to the SQL Server database. Application pool needs to run under the identity of NetworkService.

    So now the question is how do you add DOMAIN\SERVERNAME$ username as a new login in SQL Server? This may be obvious to many of you, but it tripped a few people including some DBAs here. The key is just to type the DOMAIN\SERVERNAME$ in the Login name: text box without searching it. Click OK button right away. Then you should be able to do the rest to add the roles, etc to the new login.

    SSMS New Login DOMAIN\SERVERNAME$

  2. Change Application Pool Identity to use custom account and have it run under a network service account. Bear in mind, the service account also needs to have access in SQL Server.

  3. Create an SQL Server login and make sure the connectionStrings in the application’s web.config use User Id and Password instead of using integrated security.

    Before

    <connectionStrings>
      <add name="MyConnection" connectionString="Data Source=SERVER;Initial Catalog=ITNOTADB;Integrated Security=SSPI" />
    </connectionStrings>   
    

    After

     
    <connectionStrings>
      <add name="MyConnection" connectionString="Data Source=SERVER;Database=ITNOTADB;User ID=ITNOTA;Password=Pa$$w0rd" />
    </connectionStrings>
    

    The keywords Initial Catalog and Database can be used interchangeably.

After some considerations, we opted for the third option with the acknowledgement that while it was not the best option, it was the quickest to do to resolve the issue.

Further Reading

Error message when you specify configuration database settings on the Set Configuration Database Server page in SharePoint Administration: “Error 18456”
Understanding Kerberos and NTLM authentication in SQL Server Connections
Application Pool Identities
Is using integrated security (SSPI) for accessing SQL Server better for web applications?
Professional Microsoft IIS 8

March 24, 2015 Filed Under: How To Tagged With: ASP.NET, IIS, Internet Information Services, Windows Server

Set ENTER key to submit Form using jQuery

This is based on a project using a ASP.NET Web Forms search page with a textbox txtSearchID and a search button btnSearch. The request was to make the submit button enabled by default when a user pressed on the ENTER key.

<asp:TextBox ID="txtSearchID" runat="server" MaxLength="10" />
<asp:Button ID="btnSearch" runat="server" Text="Search" />

The quickest solution is by adding a jQuery snippet at the end of the HTML doc, just before the closing </body> tag:

<script>
$(document).keypress(function(e) {
	if (e.keyCode === 13) {
		$("#<%= btnSearch.ClientID %>").click();
		return false;
	}
});
</script>

July 22, 2014 Filed Under: How To Tagged With: ASP.NET, jQuery

Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure