0

I am trying to create an Infopath-formular, which, when filled out properly, should call the lists.asmx webservice to add Data to a certain list. However, the call to the webservice doesnt work properly and i get a SecurityException.

However after debugging i have experienced that the SecurityException is thrown way earlier, when creating the NetworkCredential for logging in. All i do is

NetworkCredential x = new NetworkCredential();
x.UserName = "myUser";
x.Domain = "myDomain";
x.Password = "myPasword";

And i get the following Exception when monitoring x.Domain or x.Password:

Message: Fehler bei der Anforderung des Berechtigungstyps "System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
Source: mscorlib
Stack:
   bei System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   bei System.Security.CodeAccessPermission.Demand()
   bei System.Net.NetworkCredential.get_Password()

What should i do? My Guess is that there is some kind of trust level in Infopath which i have to set down. But no idea how to accomplish that.

Thanks in Advance!

edit: I did find this site: http://www.gleamtech.com/support/forums/2458/net-permission-problem Unfortunately this didnt help me (trust level already set to highest)

efkah
  • 1,628
  • 16
  • 30

1 Answers1

0

You need to make InfoPath form Full trust (unlike suggestion in the article you referenced that makes an ASP.Net web site to run at full trust).

For InfoPath 2010: File->Info-> Form Options->Security and Trust-> Full trust.

Note that Web-enabled Full trust forms must be adminstrator-deployed to SharePoint, you can't publish them as sandbox forms.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179