开发者

Timeout exception calling UserPrincipal.GetGroups from a Windows service

When I run simple console app that calls UserPrincipal.GetGroups, it enumerates the users groups with no problems. However when I run the same code as t开发者_运维技巧he same user on the same server but from a windows service hosting WCF, I get the following chain of errors:

Message : The socket transfer timed out after 00:00:10. You have exceeded the timeout set on your binding. The time allotted to this operation may have been a portion of a longer timeout.

    Inner Exception
    ---------------
    Message : The read operation failed, see inner exception.

                                Inner Exception
                                ---------------
                                Message : The socket transfer timed out after 00:00:10. You have exceeded the timeout set on your binding. The time allotted to this operation may have been a portion of a longer timeout.

                                   Inner Exception
                                   ---------------
                                   Message : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 

Could this have something to do with the WCF thread impersonation? WindowsIdentity.GetCurrent().Name returns the same user, however Thread.CurrentPrincipal.Identity.Name is different - empty string in the case of the console app, but the impersonated WCF user in the case of the Windoes Service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜