2014-07-23 58 views
2

親愛的朋友們。我遇到了以下問題: 我使用Mule ESB開發了一個系統服務。目的是處理 大量的記錄,因此在過程中頻繁連接到MS CRM Dynamics Onpremise的 。然而,在治療的中間(後約30分鐘,儘管這 時間變化),每個後續請求與以下錯誤結束:MS CRM動態安全上下文令牌已過期


異常堆棧是: 1.安全上下文令牌過期或無效。該消息未被處理。 (org.apache.cxf.binding.soap.SoapFault) org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor:133(null) 2.安全上下文令牌已過期或無效。該消息未被處理。 (javax.xml.ws.soap.SOAPFaultException) org.apache.cxf.jaxws.JaxWsClientProxy:156(http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/ws/soap/SOAPFaultException.html) 3.無法調用retrieveMultipleByQuery。消息有效載荷類型:HashMap的(org.mule.api.MessagingException) org.mule.module.dynamicscrmonpremise.processors.RetrieveMultipleByQueryMessageProcessor:141(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html


你能告訴我在哪裏,我可以犯錯誤以及如何解決它?

回答

0

這在CRM開發SDK的最佳實踐部分。

https://msdn.microsoft.com/en-us/library/gg509027.aspx

總之,你必須是檢查你的WCF安全令牌,以確保其有效的一類,它到期之前刷新。

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.

+0

此外,由於這是前提...您可以增加您的CRM環境的默認令牌過期。 http://blogs.msdn.com/b/crminthefield/archive/2011/06/13/microsoft-dynamics-crm-timeout-settings.aspx – user2367068