AutoDiscover Service
Introduction
The AutoDiscover Service is specifically used when an external application requires details regarding the K2 application such as:
- Product versions
- Product licenses (this will only indicate if the product is licensed or not)
- K2 URL's

The AutoDiscover Service is installed on the default ServerName/HostHeader URL when installing K2 and can be accessed using this default URL. For example:
http://{ServerName/HostHeader}/AutoDiscover/AutoDiscover
When opening the URL the information is downloaded and can now be used with external applications.
With a few manual configuration steps, AutoDiscover can be added to another URL. This allows the user to open a URL, well known to the company, to return K2 application details.

The JSON structure of the information returned is illustrated below:
Schema Structure
{
"ProductVersions": {
"ServerVersion": "5.1001.0000.0",
"SmartFormsVersion": "5.1001.0000.0"
},
"ProductLicenses": {
"ServerLicense": true,
"SmartFormsLicense": true
},
"Environment": {
"Fields": [
{
"Name": "SmartForms Designer 1",
"Type": "SmartForms Designer URL",
"Value": "http://{ServerName/HostHeader}/Designer",
"IsDefault": "True"
},
{
"Name": "SmartForms Runtime 1",
"Type": "SmartForms Runtime URL",
"Value": "https://{ServerName/HostHeader}/Runtime/Runtime",
"IsDefault": "True"
},
{
"Name": "Web Service URL SSL",
"Type": "Web Service URL",
"Value": "https://{ServerName/HostHeader}",
"IsDefault": "False"
},
{
"Name": "SmartForms Designer 1",
"Type": "SmartForms Runtime URL",
"Value": "http://{ServerName/HostHeader}/Designer/Runtime",
"IsDefault": "False"
},
{
"Name": "SmartForms Designer 1 SSL",
"Type": "SmartForms Designer URL",
"Value": "https://{ServerName/HostHeader}/Designer",
"IsDefault": "False"
},
{
"Name": "Web Service URL",
"Type": "Web Service URL",
"Value": "http://{ServerName/HostHeader}",
"IsDefault": "True"
}
]
}
}

The K2 URL information being returned is set by default at the time of the K2 installation. These values are:
- SmartForms Designer URL
- SmartForms Runtime URL
- Web Service URL
- Forms Server
To add more K2 URL's to return, the value of the AutoDiscover column in the Environment.Field table of the K2 database can be set to 1.
Changing any of the default values to False might result in components not functioning correctly. Setting all of the values to True might result in slow performance when requesting the K2 URL information.

The AutoDiscover Service requires a Microsoft .NET Framework 4.0 Application Pool.

AutoDiscover will be installed on the same machine where K2 Workspace is installed in the environment.
As previously stated, AutoDiscover is installed on the default ServerName/HostHeader URL when installing K2. However, another URL can be used with AutoDiscover but has to be configured manually. Follow the steps below:
- Go to %PROGRAMFILES%\K2\WebServices and copy the AutoDiscover folder. Paste it in a different location.
- Open the Internet Information Services (IIS) Manager.
- Add a new Application Pool. Select Microsoft .NET Framework 4.0 and Integrated as the Managed pipeline mode.
- Ensure that the correct permissions for the new Application Pool are set.
- Add a new Application on the K2 Site.
- Enter an Alias for the new Application and select the newly created Application Pool.
- Point the physical path to the location where the AutoDiscover folder was copied to.
- Ensure to add the correct user details to connect to the new application using the Connect as button.
- The new URL can now be used to retrieve K2 application details.