1 Reply Latest reply on Apr 18, 2013 1:55 PM by Gregor

    Using AFSDK with WCF Service and impersonation

    eignert

      Hi,

       

      I'm currently working on a WCF service that uses the AFSDK to access PI (AF).
      I'd like to work with impersonation for some methods the service provides.

       

      Calling methods from the AFSDK works fine without impersonation, but as soon as I set the

       
      [OperationBehavior(Impersonation = ImpersonationOption.Required)]
      

       attribute on the method of the WCF service I'm getting the following error:

       

      Could not load file or assembly 'OSIsoft.AFSDK, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6238be57836698e6' or one of its dependencies. Exception from HRESULT: 0x80070542

       

      It might be that this is more a basic configuration issue with WCF services and third party dlls but maybe someone already experienced the same problem?

       

      Thanks,
      Thomas

       

       

       

       

        • Re: Using AFSDK with WCF Service and impersonation

          Hello Thomas,

           

          "HRESULT: 0x80070542" translates "Either a required impersonation level was not provided, or the provided impersonation level is invalid."

           

          Do you provide an "Impersonation level" within your code or do you possibly intend to delegate impersonation?

           

          As your issue is pretty general with WCF service and Impersonation, I expect you would succeed finding a solution within the World Wide Web.

           

          Can you provide a bit more than just that single line of code? Possibly enough to immediately being able to reproduce?