I have a big issue that I am trying to resolve for more than a week. Appreciate if you could enlighten me.
If I run the below code directly via VS 2010, it returns me with the correct result.
If I tried to run the same code directly from IIS 7.5 (using CRMAppPool) it reurns "SYSTEM"
If I'm trying to get the logged in User in crm 2011 using WhoAmIRequest class , it always return the system user instead of the logged in user I don't know why??
Thank and really hope to get good answer from you soonest.
My code as below: (I have use the latest DLL file from SDK)
======================================
Public _service AsIOrganizationService
PublicFunction GetOrganization() As
IOrganizationService
Dim organizationUri AsNewUri("http://company:81/XRMServices/2011/Organization.svc"
)
Dim cred AsNew
ClientCredentials
Dim _serviceproxy AsNewOrganizationServiceProxy(organizationUri, Nothing, cred, Nothing
)
Me
._service = _serviceproxy
Dim who AsNewWhoAmIRequest
()
Dim whoResp AsWhoAmIResponse = CType(_serviceproxy.Execute(who), WhoAmIResponse
)
Dim currentUserId AsGuid = whoResp.UserId Response.Write(currentUserId)
ReturnMe
._service
End
Function