Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

Hello,

I'm working with the QMS API (V. 11), using boiler plate code (taken from a demo project downloaded from this site) in VS 2010, in a C Sharp web solution (.NET Framework 4.0).

My QV server is on another machine and is referenced as http://qlikview:4799/QMS/Service. I have already successfully compiled and run this code as a console application. However, in a web application, although the content of the web.config is identical to the app.config of the console app) I am getting a ConfigurationErrors exception at run time error when creating an instance of the BackEndClient object: it is related to the <serviceKeyBehavior> child element of the ServiceKeyEndpointBehaviour element (highlighted in red below).

<behaviors>

<endpointBehaviors>

<behavior name="ServiceKeyEndpointBehavior">

<serviceKeyBehavior/>

</behavior>

</endpointBehaviors>

</behaviors>

The relevant exception detail is as follows:

The type '[MyNamespace].ServiceKeyBehaviorExtensionElement, [MyNamespace], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' registered for extension 'serviceKeyBehavior' could not be loaded.

This configuration error has been reported by other developers (see http://community.qlik.com/message/169367#169367) but I find no solution to the issue and it baffles me that my console app runs flawlessly but the web app throws this exception when the referenced QMS service is identical and is identically configured in the respective config files.

I would greatly appreciate any help on this irritating error as it has already cost me much time and nerves. I have tried compiling the code under 3.5 to no effect. I see no alternative coding options. So where do I go from here???!!!!

7 Replies
Not applicable

Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

Andrew, did you find the solution? I have the same problem.

cianmcc86
New Contributor II

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

The serviceKeyBehavior issue referenced here: http://community.qlik.com/thread/40541 doesn’t prevent me from running my site or interacting with QlikView but it does cause a build error on any web deployment project added for the website. Any sign of a solution for this?

tom_tierney
New Contributor

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

If you want to get rid of the annoying error message you could modify your DotNetConfig.xsd which is located in ProgramFiles\Microsoft Visual Studio (Version)\Xml\Schemas. You would need to add a new section for serviceKeyBehavior under system.serviceModel > behaviors > endpointBehaviors. You could copy paste the existing viaClient for example, Take a backup of the file first. Personally I just ignore the message.

tom_tierney
New Contributor

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

If you want to get rid of the annoying error message you could modify your DotNetConfig.xsd which is located in ProgramFiles\Microsoft Visual Studio (Version)\Xml\Schemas. You would need to add a new section for serviceKeyBehavior under system.serviceModel > behaviors > endpointBehaviors. You could copy paste the existing viaClient for example, Take a backup of the file first. Personally I just ignore the message.

Not applicable

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

Does this help?

Bug in .NET 3.5

The behaviorExtension for QMSAPI serviceKeyBehavior must be be strongly typed, i.e. must contain Version/Culture/PublicKeyToken that exactly match the assembly. No extra spaces allowed. Version etc must be specified.

  <behaviorExtensions>
    <add name="serviceKeyBehavior" type="MyNamespace.ServiceKeyBehaviorExtensionElement, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>

This causes problems when the version of the assembly is autoincremented during assembly compile/build.

Fixed in .NET 4.0. Version/Culture/PublicKeyToken may be dropped so that the config no longer needs the autoincremented value of the version.

  <behaviorExtensions>
    <add name="serviceKeyBehavior" type="MyNamespace.ServiceKeyBehaviorExtensionElement, MyAssembly"/>
  </behaviorExtensions>

Not applicable

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

Andrew, did you find the solution? I have the same problem.

tnk u.


schlettig
Contributor

Re: Exception due to invalid child element "ServiceKeyBehavior" in QMS Service Config

some time gone by, but:

i found the solution in the following thread:

http://community.qlik.com/message/607033#607033

BR,

Christian