+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Error while trying to access forms service

Error while trying to access forms service

4 posts, 0 answered
  1. Majid
    Majid avatar
    10 posts
    Registered:
    17 Jan 2012
    03 May 2015
    Link to this post

    Hi Everyone.

    I am getting an strange error sometimes when i try to access the forms service.

    This goes away when i recycle the application pool on iis.

     

    [KeyNotFoundException: The given key was not present in the dictionary.] System.Collections.Generic.Dictionary`2.get_Item(TKey key) +11165993 Telerik.Sitefinity.Utilities.TypeConverters.TypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +1141 Telerik.Sitefinity.Data.WcfHelpers.WcfContext.get_ItemType() +138 Telerik.Sitefinity.Data.WcfHelpers.DynamicFieldsDataContractSurrogate.GetDataContractType(Type type) +15 System.Runtime.Serialization.DataContractSurrogateCaller.GetDataContractType(IDataContractSurrogate surrogate, Type type) +35 System.Runtime.Serialization.XsdDataContractExporter.GetSurrogatedType(Type type) +1904466 System.Runtime.Serialization.XsdDataContractExporter.GetSchemaTypeName(Type type) +40 System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ValidateType(Type parameterType, IDataContractSurrogate surrogate, IEnumerable`1 knownTypes) +214 System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter..ctor(OperationDescription operation, Type parameterType, Boolean isRequestFormatter, Boolean useJsonFormat, DataContractSerializerOperationBehavior dcsob) +385 System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.CreateXmlFormatter(OperationDescription operation, Type type, Boolean isRequestFormatter, UnwrappedTypesXmlSerializerManager xmlSerializerManager) +73 System.ServiceModel.Description.WebHttpBehavior.GetReplyDispatchFormatter(OperationDescription operationDescription, ServiceEndpoint endpoint) +377 System.ServiceModel.Description.WebHttpBehavior.ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) +1766 Telerik.Sitefinity.Utilities.MS.ServiceModel.Web.WebHttpBehavior2.ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) +29 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +3292 System.ServiceModel.ServiceHostBase.InitializeRuntime() +65 System.ServiceModel.ServiceHostBase.OnBeginOpen() +34 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +308 System.ServiceModel.Channels.CommunicationObject.Open() +36 System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +90 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598 [ServiceActivationException: The service '/Sitefinity/Services/Forms/FormsService.svc' cannot be activated due to an exception during compilation. The exception message is: The given key was not present in the dictionary..] System.Runtime.AsyncResult.End(IAsyncResult result) +485948 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +174 System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6 System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129​

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    30 Sep 2016
    06 May 2015
    Link to this post
    Hi Majid,

    Can you please let me know when the issue started appearing? Has the issue started appearing after you have moved your project to another environment? If so, what I can suggest is to take a look at the following articles from our documentation and make sure that you have configured your environment to host Sitefinity projects:

    http://docs.sitefinity.com/configure-the-iis-to-host-sitefinity-projects
    http://docs.sitefinity.com/run-projects-on-iis

    In addition to this, can you please provide more details about the issue and when it reproduces? Is it when you try to access the forms section in the Sitefinity backend under Content -> Forms or when trying to manage the forms programatically? Can you please provide the exact steps you take to reproduce the issue?

    Furthermore, are you in a load balancing environment?

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Majid
    Majid avatar
    10 posts
    Registered:
    17 Jan 2012
    14 May 2015 in reply to Sabrie Nedzhip
    Link to this post

    Hi Sabrie,

     

    Thanks for your reply.

     We have load two load balanced production servers and one content publishing server. Content is created on CPS and is synced to both production servers. Each of the production server has its own separate database. 

    As we don't want the content publishers or anyone else to access the backend of production servers to avoid any inconsistencies.

    Problem is we need to export the form entries. and for that i have created some code that talks to both servers using rest API, fetches the form entries and displays in a user control on CPS.

    Sometimes functionality works fine but sometimes i start getting this error. I debugged the code and found that while calling the form service on the remote server, it returns this error. 

  4. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    30 Sep 2016
    18 May 2015
    Link to this post
    Hi Majid,

    Thank you for the details you have provided.

    Since you have disabled the access to the Sitefinity backend for the production nodes you will also not be able to access the backend services as well. This is the reason why you are not able to access the /Sitefinity/Services/Forms/FormsService.svc and thus causing the issue.

    What I can suggest is that you try to get the form responses using the API as demonstrated in the samples from the following article. This way you should not have any issues to retrieve the form responses and display them on the frontend.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered