假冒帮助! PSI 2010 SDK示例:\ Sample \Impersonation \ WCFImpersonationTest_VS9 [英] Impersonation Help! Sample PSI 2010 SDK: \Sample\Impersonation\WCFImpersonationTest_VS9
问题描述
我有一个自定义Web应用程序,我需要将项目任务,资源和分配导入我的产品(正在运行),但是我需要将TimeSheets上传到Project Server 2010. 从本论坛中的其他用户问题来看,使用CreateTimesheets
我听说你有两个选择:
I have a custom Web application and I need to import Project Tasks, Resources and Assignments to my product (which are working) but I need to Upload TimeSheets to Project Server 2010. From other user questions in this forum for using CreateTimesheets I heard you have 2 options:
OPTION1 - 代表(你不能成为一个以上用户的代表?! )
OPTION1 - Delegates (you can't be a delegate for more than 1 user?!)
OPTION2 - 假冒。
OPTION2 - Impersonation.
我的环境&问题:当我使用Project.svc,Resource.svc等时,我有一个完整的凭据用户,但在尝试使用TimeSheet.svc时,这个完整的凭据用户无法代表其他用户创建时间表。
My Environment & Problem: I have a full credential user I use when I consume Project.svc, Resource.svc etc. but this full credential user when trying to consume TimeSheet.svc cannot create timesheets on behalf of other users.
所以我想让模拟工作,但我甚至无法让Sample工作(\ Sample\Impersonation \WCFImpersonationTest_VS9)。
So I want to get impersonation working but I can't even get the Sample to work (\Sample\Impersonation\WCFImpersonationTest_VS9).
正如你在没有模仿的情况下看到的那样,我从我的Project Server中获取Guids但是当模拟尝试时我得到了未经授权的错误,所以我错过了什么?
As you can see under no impersonation I am getting Guids back from my Project Server but when the impersonation tries I get an unauthorized error so what am I missing?
帐户假冒:
测试1:没有模仿
现场点数的指示\ tklostermann
 从GetCurrentUserUid:9fe1f5e1-1f9e-49ae-b205-265de7f51df6
Account for impersonation:
Test 1: No impersonation
GUID of fieldpoint\tklostermann
from GetCurrentUserUid: 9fe1f5e1-1f9e-49ae-b205-265de7f51df6
的用户冒充,
&NBSP GUID;     &NBSP ;来自ReadResources: a36ef6c2-9d62-454f-89d7-6d5b58b54ce5
GUID of user to impersonate,
from ReadResources: a36ef6c2-9d62-454f-89d7-6d5b58b54ce5
测试2:简单模仿
*** CommunicationException:
***CommunicationException:
System.ServiceModel.Security.MessageSecurityException:HTTP请求未通过客户端身份验证方案"Ntlm"进行了
。来自服务器的身份验证标题是'NTLM'。 ---> System.Net.WebException:远程服务器
返回错误:(401)未经授权。
在System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
---内部异常堆栈跟踪结束---
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unaut
horized with client authentication scheme 'Ntlm'. The authentication header rece
ived from the server was 'NTLM'. ---> System.Net.WebException: The remote server
returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
服务器堆栈跟踪:
在System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(H
ttpWebRequest请求,响应HttpWebResponse,引发WebException responseException,
  HttpChannelFactory工厂)
  在System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResp
ONSE(HttpWebRequest的请求,响应HttpWebResponse,HttpChannelFactory因子
$ B $通过,引发WebException responseException,ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
在System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeS
pan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e,TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean on b $ b eway,ProxyOperationRuntime operation,Object [] ins,Object [] outs,TimeSpan tim
eout )
在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall,ProxyOperationRuntime operation)
在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(H
ttpWebRequest request, HttpWebResponse response, WebException responseException,
HttpChannelFactory factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResp
onse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factor
y, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS
pan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
在[0]处重新抛出异常:
在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg,IMessage retMsg)
在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta,Int32 type)
在SvcResource.Resource.GetCurrentUserUid()
在SvcResource.ResourceClient.GetCurrentUserUid()在C:\Temp\Impersonation\WC
FImpersonationTest_VS9\wcf.Resource.cs:线14149
 &NBSP ;在WCFImpersonationTest.ImpersonationTest.SimpleImpersonation()在C:\Temp\Im
personation\WCFImpersonationTest_VS9\ImpersonationTest.cs:线100
  在WCFImpersonationTest.Program.RunTests()在C:\Temp\Impersonation\WCFImpers
onationTest_VS9\Program.cs:线80
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at SvcResource.Resource.GetCurrentUserUid()
at SvcResource.ResourceClient.GetCurrentUserUid() in C:\Temp\Impersonation\WC
FImpersonationTest_VS9\wcf.Resource.cs:line 14149
at WCFImpersonationTest.ImpersonationTest.SimpleImpersonation() in C:\Temp\Im
personation\WCFImpersonationTest_VS9\ImpersonationTest.cs:line 100
at WCFImpersonationTest.Program.RunTests() in C:\Temp\Impersonation\WCFImpers
onationTest_VS9\Program.cs:line 80
Todd Klost
Todd Klost
推荐答案
Hey Todd,
Hey Todd,
可能您的用户没有Project Server服务应用程序的"完全访问权限"权限。您可以在管理中心设置它 - >管理服务应用程序 - > Project Server服务 - >权限。
Probably your user doesn't have 'Full Access' permission on Project Server Service Application. You can set it in Central Administration -> Manage Service Applications -> Project Server Service -> Permissions.
希望它会有所帮助!
最好的问候,
Alexander Bylinsky
Best Regards,
Alexander Bylinsky
这篇关于假冒帮助! PSI 2010 SDK示例:\ Sample \Impersonation \ WCFImpersonationTest_VS9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!