Deploying a browser-enabled Managed Code Form Template - InfoPath Dev
in

InfoPath Dev

Deploying a browser-enabled Managed Code Form Template

Last post 01-16-2008 10:20 PM by DavidCrabbe. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-16-2008 12:07 AM

    Deploying a browser-enabled Managed Code Form Template

    I'm just looking to confirm that it is possible to deploy a managed-code form template to InfoPath Forms Services on MOSS 2007 and have it displayed in the browser rather than opening InfoPath when the form makes use of System.DirectoryServices.

    As a test, I've followed the steps outlined within http://msdn2.microsoft.com/en-us/library/bb952744.aspx to extract information from Active Directory for the current user.  This form works when previewed or debugged from VSTA. 

    To deploy to SharePoint I've followed the instructions in this rather informative blog posting: http://platinumdogs.wordpress.com/2007/12/17/deploy-an-infopath-2007-form-with-managed-code-to-a-browser-enabled-sharepoint-document-library/

    The deployed form will open and display information on the current user successfully from the Form Template Library within SharePoint, but does so using the InfoPath client application. 

    Finally I created a new Forms Library on a SharePoint site, added my form as a content type and set the option to have the form open in the browser.  Unfortunately I receive the following error upon opening the form:

    Request for the permission of type 'System.DirectoryServices.DirectoryServicesPermission, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.

    So, to conclude: the form opens in InfoPath without error, but will not open in IE.  I'd just like to know if what I'm trying to do is possible, and, if it is, what is likely to be causing the error observed?  Is it likely to be a security/trust issue given that the form works in InfoPath?  Do browser-enabled forms require higher trust settings to operate than InfoPath client forms?  The form is set to automatically assign the trust level.

    David.

    PS. Just as a test, I tried modifying the .NET Framework 2.0 Configuration to be FullTrust for All_Code on the server hosting SharePoint to see if this fixed anything, however it didn't. 

     

     

  • 01-16-2008 07:41 AM In reply to

    Re: Deploying a browser-enabled Managed Code Form Template

    Hey David.

    DavidAir just posted this link regarding a similar issue, trying to run code in a browser form which requires trust.  It might help.

    http://moldenco.blogspot.com/2007/05/spsecurityrunwithelevatedprivileges-to.html

     

  • 01-16-2008 05:48 PM In reply to

    Re: Deploying a browser-enabled Managed Code Form Template

    Hi Clay,

    I've previously tried using SPSecurity.RunWithElevatedPrivileges, however I'm not actually interacting with SharePoint from within the form so I don't think it'll help me.  If I need to have a full trust form, then so be it but I'm just looking for confirmation that this is the case.

    I'm going to try the same AD query via a web service and see if it can work without requiring full trust.

    Cheers,

    David. 


     

  • 01-16-2008 10:20 PM In reply to

    Re: Deploying a browser-enabled Managed Code Form Template

    Using a web service works fine (eventually... after jumping through UDC hoops and centrally managed data connections).  So I'll adopt that approach for now.

    Thanks,

    David.
     

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.