Introduction

When enabling SmartObject Services endpoints on a K2 Server that runs on .NET Framework 4.0, a similar error to “No elements matching the key 'wsHttpBinding+Windows' were found in the configuration element collection” may occur in the server log and the endpoints will not function correctly.

Cause

Under .NET Framework 4.0, the server looks for the ‘serviceModel’ node in K2HostServer.exe.config which it cannot find as it is not present in the configuration file.

 Workaround:

  1. Create a new file in the HostServer\Bin directory called ‘K2HostServer.exe.config’.
  2. Cut the ‘serviceModel’ node from K2HostServer.config and paste it in the new file.
  3. Restart the K2 Server.
  4. <?xml version="1.0" encoding="utf-8"?>

    <configuration>

      <system.serviceModel>

        <bindings>

          <basicHttpBinding>

            <binding name="basicHttpBinding+Windows+HTTPS">

              <security mode="Transport">

                <transport clientCredentialType="Windows" />

              </security>

            </binding>

            <binding name="basicHttpBinding+Basic+HTTPS">

              <security mode="Transport">

                <transport clientCredentialType="Basic" />

              </security>

            </binding>

            <binding name="basicHttpBinding+Windows">

              <security mode="TransportCredentialOnly">

                <transport clientCredentialType="Windows" />

              </security>

            </binding>

            <binding name="basicHttpBinding+Basic">

              <security mode="TransportCredentialOnly">

                <transport clientCredentialType="Basic" />

              </security>

            </binding>

          </basicHttpBinding>

          <wsHttpBinding>

            <binding name="wsHttpBinding+Windows">

              <security mode="Message" />

            </binding>

            <binding name="wsHttpBinding+TWMC+HTTPS">

              <security mode="TransportWithMessageCredential">

                <message clientCredentialType="Windows" />

              </security>

            </binding>

            <binding name="wsHttpBinding+HTTPS">

              <security mode="Transport">

                <transport clientCredentialType="Windows" />

              </security>

            </binding>

          </wsHttpBinding>

          <webHttpBinding>

            <binding name="webHttpBinding+Basic">

              <security mode="TransportCredentialOnly">

                <transport clientCredentialType="Basic" />

              </security>

            </binding>

            <binding name="webHttpBinding+Windows">

              <security mode="TransportCredentialOnly">

                <transport clientCredentialType="Windows" />

              </security>

            </binding>

            <binding name="webHttpBinding+Basic+HTTPS">

              <security mode="Transport">

                <transport clientCredentialType="Basic" />

              </security>

            </binding>

            <binding name="webHttpBinding+Windows+HTTPS">

              <security mode="Transport">

                <transport clientCredentialType="Windows" />

              </security>

            </binding>

          </webHttpBinding>

        </bindings>

      </system.serviceModel>

    </configuration>