2011-02-10 8 views
1

私はIFD経由で公開されているMS CRMにアクセスしようとしていますが、認証の問題があります。RubyとMS Dynamics 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> 

サーバーでこれをデバッグする方法はありますか?より意味のあるエラーメッセージを得るためにチェックできるログはありますか?

<?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:Header> 
    <CrmAuthenticationToken xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\"> 
     <AuthenticationType xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">2</AuthenticationType> 
     <OrganizationName xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">#{CRM_CONFIG[:org_name]}</OrganizationName> 
     <CallerId xmlns=\"http://schemas.microsoft.com/crm/2007/CoreTypes\">#{TOUCH}</CallerId> 
    </CrmAuthenticationToken> 
    </soap:Header> 
    <soap:Body> 
    <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\"> 
     <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\"> 
     <q1:EntityName>contact</q1:EntityName> 
     </query> 
    </RetrieveMultiple> 
    </soap:Body> 
</soap:Envelope> 

答えて

2

[OK]を、問題がセットアップの誤解だった

<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

あなたはby handをトレース、サーバー側またはtoolで回すことができます(CrmService.asmxエンドポイントへのこの時間)、次の依頼をしようとしたときに

また、私は401を取得しています。 C:\ Program Files \ Microsoft Dynamics CRM \ Traceでトレースファイルを探します。トレースファイルを簡単に表示するには、CRM Trace Log Viewerを使用することをお勧めします。

call Dynamics CRM web services from JavaScriptについての記事がたくさんあります。私はそれらが便利になると想像することができます。

私の経験では、http要求と応答をトレースするのにFiddler、Webサービスのテストとデバッグを行うのにさらにSoapUIという2つのツールが便利です。

Dynamics CRM 2011には、SOAPベースに加えてRESTベースのサービスが付属するため、非ネット製品からのCRM Webサービスの使用が大幅に簡素化されます。 CrmAuthenticationTokenはこのように見ている必要があることを意味し、

NTLMを使用して、Active Directory認証を使用する:

関連する問題