C# code-behind file doesn't work with Infopath
-
Hi, I found a problem during Infpath Project development in VS 2005. I've created a new project in VS 2005 (Office -> Infopath form), this project is a simple Infopath Form wich will recieve and submit some data to my web-service. First of all I should notice that I didn't created any DataSource in design-time from Infopath Forms Designer, instead I am making all calls to web-service methods and filling Infopath forms controls from C# code-behind file. Then I wrote some C# code in generated Form's code-behind file, also I've added a WebReference to my web-service and wrote code for web service methods calls and Infopath controls filling. When I starting my project from VS (F5 or Ctrl + F5) everything works fine and I see the controls on my Infopath form are filled with data from web service. The problem occurs when I am making Project - Publish Form, the published form (xsn file) contains all dll and other necessary files, but when I runnig published form all controls are empty! It seems like my C# code doesn't executed and no exception or error messages does not appear. Does enybody knows what happens? I suppose that I should change my security configuration setting in .NET Framework configuration, is that correct? Thank you for your help or any ideas. xedom developers team personal web page
-
Hi, I found a problem during Infpath Project development in VS 2005. I've created a new project in VS 2005 (Office -> Infopath form), this project is a simple Infopath Form wich will recieve and submit some data to my web-service. First of all I should notice that I didn't created any DataSource in design-time from Infopath Forms Designer, instead I am making all calls to web-service methods and filling Infopath forms controls from C# code-behind file. Then I wrote some C# code in generated Form's code-behind file, also I've added a WebReference to my web-service and wrote code for web service methods calls and Infopath controls filling. When I starting my project from VS (F5 or Ctrl + F5) everything works fine and I see the controls on my Infopath form are filled with data from web service. The problem occurs when I am making Project - Publish Form, the published form (xsn file) contains all dll and other necessary files, but when I runnig published form all controls are empty! It seems like my C# code doesn't executed and no exception or error messages does not appear. Does enybody knows what happens? I suppose that I should change my security configuration setting in .NET Framework configuration, is that correct? Thank you for your help or any ideas. xedom developers team personal web page
I've found solution! To execute C# code with Web Reference to web-service you must digitally sign your Infopath form. It can be done through Tools -> Form Options - Security: 1. Uncheck Automatically... and select full trust 2. Check sign and create certificate 3. Publish the form or you should create a msi project to install your Infopath form. find out more... xedom developers team personal web page