WSE 3.0 Problem

Hi,

I am using WSE 3.0 Oct CTP. I have following problem:-

Unable to instantiate the WSE class created by adding the web reference. There is an issue with respect to the loading of configuration.

I get the following error:--

An error occurred creating the configuration section handler for microsoft.web.services3: That assembly does not allow partially trusted callers.





Answer this question

WSE 3.0 Problem

  • harlequinben

    This was resolved to a bug in VSTO. Details are below.
    - Mark Fussell

    Bottom line, when talking to WSE 3.0 you also need to explicitly trust the config file (in your case plainsite.dll.config) by its URL.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    e.g. caspol -ag 1.1.3.1 -url c:\plainsite\plainsite\bind\Debug\plainsite.dll.config FullTrust

    The problem is that WSE 3.0 uses a .config file to instantiate an object of type Microsoft.Web.Services3.Security.Tokens.UserNameToken. It seems though the WSE assembly contains non-verifiable code and hence < xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />CLR makes FullTrust permission security demand to instantiate this class.

    But in the process of the instantiation System.Configuration.RuntimeConfiguration.Record.CreateSectionWithRestrictedPermission method is invoked. It calculates the permission set that is granted to the .config file and makes a call to permissionSet.PermitOnly() to only allow security demands on permission sets that are the subset of the permissionSet granted to the .config file.

    This seems like a bug in VSTO IDE where we do automatically grant permissions to all the compiled assemblies but miss out on granting FullTrust to the .config files.



  • Tomel

    Hi Mark,

    Sorry for the delay in replying. But I am having a VSTO excel application. And I am trying to instantiate the web service class from there.

    I have checked for the trust of the assembly using procedure outlined by Misha at
    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=113473

    but it returned that assembly is FullyTrusted.

    What would you suggest in such a scenario

    Regards,
    Anu

  • esc

    The component that you have performed the Add Web Reference with is partially trusted. In order to call the WSE runtime dll, you have to be a full trusted application or component. This is beacuse WSE does several calls to native security APIs that need to run under full trust.

    Can you describe where you are calling the WSE from

    Thanks,
    Mark Fussell
    WSE Program Manager



  • WSE 3.0 Problem