I have an InfoPath form that contain onSubmitRequest function (In .Net CodeForm- C#).
In the function I'm create an object of WebService (which is web reference in my .NET project) that get the form's values and enter them into database.
When I run my form as a preview form, It's all work well. But when I publish the form and run it I get this Error:
"infoPath cannot submit the form.
The onSubmitRequest event handler did not work.
Request for the permission of type System.Net.WebPermission"
Why it's happen and how to fix it????