Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
CRM异步服务需要和CRM web service (platform)进行通信来知道如何处理后台任务 (Async Jobs). 在一些复杂的配置环境里比如使用了NLB负载均衡,或者有多台平台服务的基于角色(role-based)的安装,理解CRM异步服务如何同CRM Web Service 通信对查找后台系统工作失败原因有重要的帮助。
CrmAsyncService.exe是如何构造webservice URL来决定和哪台 crmwebservice 通信呢? 其算法如下:
1. 第一步是计算平台服务机器名字。
CrmAsyncService.exe启动后将察看MSCRM_CONFIG库表 deploymentproperties的 AsyncSDKRootDomain来决定访问哪台CRM平台服务机器, 如果AsyncSDKRootDomain=NULL那么localhost将会被使用;
2. 第二步是计算网络端口port.
HKLM\Software\Microsoft\MSCRM\LocalSDKPort
如果LocalSDKPort为空那么使用默认端口80
3. 第三步是计算使用HTTP还是HTTPS。
查看MSCRM_CONFIG库表 deploymentproperties的AdRootDomainScheme. 该值不允许为空,否则系统将报错!
默认下典型的构造URL为
.asmx">https://localhost:80/mscrmservices/2007/<servicename>.asmx
==典型排错==
大量系统工作没有被执行,都处于等待状态
这种症状通常都代表通信机制出了问题。详细的错误记载在AsyncOperationBase.ErrorCode和Message栏。在排错过程中你可以手工构造此URL后直接在IE中打开执行看看是否有问题 -- 通常HTTP的错误是一致的。
a. “System.Net.WebException: The request failed with HTTP status 401: Unauthorized”
如果IE弹出安全对话框那么CRMAsyncSErvice.exe通常没法正常执行(401 错误) -- 因为CrmAsyncService.exe是作为后台程序执行的,没有人可以输入用户名和密码的。
可能的解决办法:修改AsyncSDKRootDomain,若CrmAsyncService.exe和CRM Web Service在同一台机器,建议AsyncSdkRootDomain设为空值; 或者把AsyncSDKRootDomain里的地址加到IE的local intranet安全区内。基本思想是保证不弹出密码对话框自动登录。另外情况是设置 DisableLoopbackCheck (KB896861 You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version)
b. “An existing connection was forcibly closed by the remote host”.
这个通常代表CRM平台服务器的网络端口号资源耗尽,通常这类错误在压力下才能显现。这个并不是由CRM来控制的,而是Windows 操作系统决定的 -- 在典型的TCP/IP通信中,通常有3个端口要被使用到. 服务器有个公开端口(比如80),客户端首先选择一个端口 (1025 -5000)向远端的服务器公开端口发出连接请求,一旦成功服务器通常分配一个单独的额外端口和客户继续通信。通信完毕后网络端口并非马上被释放重用,而是要等待240秒 (这个通过注册表TcpTimedWaitDelay控制,参看TcpTimedWaitDelay)。系统可用端口号资源是通过MaxUserPort控制的(默认为5000)。
解决办法是加快端口释放频率(TcpTimedWaitDelay 推荐从240改为30秒),增大系统可用网络端口资源 (MaxUserPort 推荐修改默认5000到 30000 - 60000)。
注册表位置: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
thanks
Clifford Zhang
Comments
- Anonymous
April 14, 2011
China Mail Services , Direct marketing china, Customer relationship marketing china,CRM china, communication china, ... advertising china, one to one Marketing , Advertising and Marketing in China ,China one to one , Targeted Marketing , Communications Graphics , Mail Marketing , Manufacture printing , Calendar & Greeting Card , Direct Mail Services , China Direct Mail in Beijing , Creative design , Print Services , Packaging & Decoration , Marketing & Promotion Printing , Stationery printing 010-51292074