gpt4 book ai didi

wcf - CRM 2011 : Reauthentication with _serviceProxy. 验证()

转载 作者:行者123 更新时间:2023-12-04 05:33:39 27 4
gpt4 key购买 nike

我已经使用 WCF channel 和组织服务为 ms dynamics 2011 开发了一个客户端软件。创建 channel 后,我将其放入字典 Dictionary<string, OrganizationServiceProxy>等待 8 小时后,安全 token 不再有效。现在我打电话serviceProxy.Authenticate()方法(serviceProxy 是从我的集合中检索的对象)并且什么也没有发生。我的 token 尚未更新,我无法使用我的 channel 从动态中检索数据。正如我在 msdn 中看到的,Authenticate()方法应该给我一个新的 token ,我做错了什么?

最佳答案

您是否尝试过像 Performance Best Practices 中描述的那样监控 token ? ?

In addition, monitor your WCF security token (Token) and refresh it before it expires so that you do not lose the token and have to start over with authentication. To check the token, create a custom class that inherits from the OrganizationServiceProxy or DiscoveryServiceProxy class and that implements the business logic to check the token. Or wrap the proxy classes in a new class. Another technique is to explicitly check the token before each call to the web service. Example code that demonstrates these techniques can be found in the ManagedTokenDiscoveryServiceProxy, ManagedTokenOrganizationServiceProxy, and AutoRefreshSecurityToken classes in the Helper Code: ServerConnection Class topic.



您将在此类中找到有关如何自动更新 token 的示例。

关于wcf - CRM 2011 : Reauthentication with _serviceProxy. 验证(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12258908/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com