Dynamics crm Ruby和MS Dynamics CRM身份验证

Dynamics crm Ruby和MS Dynamics CRM身份验证,dynamics-crm,dynamics-crm-4,Dynamics Crm,Dynamics Crm 4,我正在尝试访问通过IFD公开的MS CRM,我遇到了身份验证问题 SOAP端点位于NTLM后面,我已经能够访问它。问题是,当传递如下请求时,我得到401个响应: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins

我正在尝试访问通过IFD公开的MS CRM,我遇到了身份验证问题

SOAP端点位于NTLM后面,我已经能够访问它。问题是,当传递如下请求时,我得到401个响应:

    <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <Execute xmlns="http://schemas.microsoft.com/crm/2007/CrmDiscoveryService">
            <Request xsi:type="RetrieveCrmTicketRequest">
                <OrganizationName>#{CRM_CONFIG[:org_name]}</OrganizationName>
                <UserId>#{CRM_CONFIG[:username]}</UserId>
                <Password>#{CRM_CONFIG[:password]}</Password>
            </Request>
        </Execute>
    </soap:Body>
</soap:Envelope>

#{CRM_CONFIG[:org_name]}
#{CRM_CONFIG[:username]}
#{CRM_CONFIG[:password]}
有没有办法在服务器上调试这个?我可以检查任何日志以获得更有意义的错误消息吗

我在尝试以下请求时也得到了401(这次是到CrmService.asmx端点):


2.
#{CRM_CONFIG[:org_name]}
#{TOUCH}
接触

您可以打开服务器端跟踪或使用。在C:\Program files\Microsoft Dynamics CRM\trace中查找跟踪文件。为了便于查看跟踪文件,我建议使用

有很多关于如何使用的文章。我可以想象这些会派上用场

根据我的经验,另外两个工具也会派上用场,用于跟踪http请求和响应,以及用于web服务测试和调试


另外请注意,Dynamics CRM 2011除了基于SOAP的服务外,还将提供基于REST的服务,这将大大简化非.net产品的CRM web服务使用。

好的,问题是对设置的误解:

使用NTLM时,将使用Active Directory身份验证,这意味着CrmAuthenticationToken应该如下所示:

<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">
  <AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">0</AuthenticationType>
  <OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">#{CRM_CONFIG[:org_name]}</OrganizationName>
</CrmAuthenticationToken>

0
#{CRM_CONFIG[:org_name]}
请注意,不需要CallerId元素

<CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">
  <AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">0</AuthenticationType>
  <OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">#{CRM_CONFIG[:org_name]}</OrganizationName>
</CrmAuthenticationToken>