Flex Gateway新着情報
Governance新着情報
Monitoring API ManagerMicrosoft Dynamics GP Connector v2.1
Microsoft Dynamics GP 用 Anypoint Connector を使用して、Mule アプリケーションは Microsoft Dynamics Great Plains (GP) Web サービスとやりとりすることができます。
リリースノート: Microsoft Dynamics GP Connector リリースノート
Exchange: Microsoft Dynamics GP Connector
この情報を使用するには、Microsoft Dynamics GP、Mule Runtime Engine (Mule)、Anypoint Connector、Anypoint Studio、Mule の概念、Mule フローの要素、グローバル要素に精通している必要があります。
このコネクタを使用するには次が必要です。
Microsoft Dynamics GP インスタンス。
Kerberos 接続に使用する有効なログイン情報。
MuleSoft Enterprise ライセンス。
<dependency>
<groupId>com.mulesoft.connectors</groupId>
<artifactId>mule-microsoft-dynamics-gp-connector</artifactId>
<version>x.x.x</version>
<classifier>mule-plugin</classifier>
</dependency>
x.x.x
を使用しているコネクタに対応するバージョンに置き換えます。
最新の pom.xml
ファイル情報を取得するには、 Anypoint Exchange でコネクタにアクセスし、[Dependency Snippets (連動関係スニペット)] をクリックします。
Design Center で、HTTP リスナーやスケジューラーなどのトリガーをクリックします。
コネクタの HTTP グローバル要素を作成するには、Mule アプリケーションがリスンするパスを設定します。
[Edit (編集)] をクリックし、次の項目を設定します。
項目 | 説明 |
---|---|
プロトコル |
HTTP エンドポイントのプロトコル。HTTP または HTTPS (セキュア) を選択できます。 |
Host (ホスト) |
Mule アプリケーションが要求をリスンする IP アドレス。 |
Port (ポート) |
Mule アプリケーションが要求をリスンするポートアドレス。 |
Base Path (ベースパス) |
省略可能なベースパス。Mule アプリケーションは、ベースパス + パスをリスンします。 |
トリガーの横にあるプラス記号を選択してコンポーネントを追加します。
コンポーネントとしてコネクタを選択します。
操作を選択します。
コネクタのグローバル要素を設定します。
項目 | 説明 |
---|---|
Username (ユーザー名) |
|
Password (パスワード) |
Dynamics GP に接続するユーザーのパスワード。 |
Endpoint URL (エンドポイント URL) |
SOAP サービスが公開されるベース URL。形式は次のとおりです。 |
SPN |
サービスインスタンスを識別するサービスプリンシパル名。 |
Login Conf. Location (ログイン設定の場所) |
Kerberos ログインモジュールへのパス。 |
Krb5 Conf. Location (Krb5 設定の場所) |
Kerberos 設定ファイルへのパス。 |
サンプルの Kerberos 設定ファイル:
[libdefaults]
default_realm = MYREALM.COM
[realms]
MYREALM.COM = {
kdc = mydomaincontroller.myrealm.com
default_domain = MYREALM.COM
}
[domain_realm]
.myrealm.com = MYREALM.COM
myrealm.com = MYREALM.COM
注意: realm と default_domain は大文字と小文字が区別されます。Active Directory で定義されたとおりに正確に指定する必要があります。テスト接続中に受信する「Message stream modified (41) (メッセージストリームが変更されました (41))」というエラーは、ドメイン名の形式が正しくないことを示しています。
Kerberos 設定ファイルの作成方法についての詳細は、 『MIT Kerberos Documentation (MIT Kerberos ドキュメント)』の「krb5.conf」を参照してください。
Kerberos ログインモジュール (Krb5LoginModule) は、シナリオ固有の設定を使用し、JAAS ログイン設定ファイルを定義して調整できます。以下は、Kerberos ログインモジュールの JAAS ログイン設定ファイルのサンプルです。
Kerberos {
com.sun.security.auth.module.Krb5LoginModule required
debug=true
refreshKrb5Config=true;
};
Kerberos ログインモジュールの JAAS ログイン設定ファイルの作成方法についての詳細は、 Java ドキュメント『Class Krb5LoginModule (クラス Krb5LoginModule)』を参照してください。
Anypoint Studio には、Studio プロジェクトにコネクタを追加する 2 つの方法があります。Studio タスクバーの Exchange ボタンから追加するか、[Mule Palette (Mule パレット)] ビューから追加します。
Studio で Mule プロジェクトを作成します。
Studio タスクバーの左上にある Exchange アイコン (X) をクリックします。
Exchange で、[Login (ログイン)] をクリックし、Anypoint Platform のユーザー名とパスワードを指定します。
Exchange で、「gp」を検索します。
コネクタを選択して [Add to project (プロジェクトに追加)] をクリックします。
画面の指示に従ってコネクタをインストールします。
[Mule Palette (Mule パレット)] から、[HTTP Listener (HTTP リスナー)] 要素をキャンバスにドラッグし、デフォルトの設定を使用しますが、パスは /createCustomer に設定します。
[HTTP Listener (HTTP リスナー)] 要素の横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#CreateCustomer: {
ns0#customer: {
ns02#Key: {
ns02#Id: attributes.queryParams.customerKeyID
},
ns02#Name: attributes.queryParams.customerName
},
ns0#context: {
ns01#OrganizationKey @(xsi#"type": "ns01:CompanyKey") : {
ns01#Id: attributes.queryParams.companyKeyID
}
}
}
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
設定を行い、必須項目を入力します。これは、フローにドラッグされる他の Dynamics GP Connector にも当てはまります。
[Create Entity (エンティティを作成)] 操作を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Set Payload (ペイロードを設定)] 要素をドラッグし、値を Success
に設定します。
[Mule Palette (Mule パレット)] から、[HTTP Listener (HTTP リスナー)] 要素をキャンバスにドラッグし、デフォルトの設定を使用しますが、パスは /getCustomer に設定します。
[HTTP Listener (HTTP リスナー)] 要素の横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#GetCustomerByKey: {
ns0#key: {
ns01#Id: attributes.queryParams.customerKeyID
},
ns0#context: {
ns02#OrganizationKey @(xsi#"type": "ns02:CompanyKey") : {
ns02#Id: attributes.queryParams.companyKeyID
}
}
}
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
[Get Entity By Key (キーでエンティティを取得)] 操作を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/json
---
payload
[Mule Palette (Mule パレット)] から、[HTTP Listener (HTTP リスナー)] 要素をキャンバスにドラッグし、デフォルトの設定を使用しますが、パスは /updateCustomer に設定します。
[HTTP Listener (HTTP リスナー)] 要素の横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#GetCustomerByKey: {
ns0#key: {
ns02#Id: attributes.queryParams.keyId
},
ns0#context: {
ns01#OrganizationKey @(xsi#"type": "ns01:CompanyKey") : {
ns01#Id: attributes.queryParams.companyKeyID
}
}
}
}
この [Transform Message (メッセージを変換)] に「updatedComment」という変数を作成し、次の値を設定します。
%dw 2.0
output application/java
---
{
comment1: payload.customer.comment1
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
[Get Entity By Key (キーでエンティティを取得)] 操作を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/java
---
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#UpdateCustomer: {
ns0#customer: {
ns02#Comment1: vars.comment1,
ns02#Key: {
ns02#Id: payload.key.id
},
ns02#Name: payload.name
},
ns0#context: {
ns01#OrganizationKey @(xsi#"type": "ns01:CompanyKey") : {
ns01#Id: attributes.queryParams.companyKeyID
}
}
}
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
[Update Entity (エンティティを更新)] 操作を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Set Payload (ペイロードを設定)] 要素をドラッグし、値を Success
に設定します。
[Mule Palette (Mule パレット)] から、[HTTP Listener (HTTP リスナー)] 要素をキャンバスにドラッグし、デフォルトの設定を使用しますが、パスは /deleteCustomer に設定します。
[HTTP Listener (HTTP リスナー)] 要素の横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#DeleteCustomer: {
ns0#key: {
ns01#Id: attributes.queryParams.customerKeyID
},
ns0#context: {
ns02#OrganizationKey @(xsi#"type": "ns02:CompanyKey") : {
ns02#Id: attributes.queryParams.companyKeyID
}
}
}
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
[Delete Entity (エンティティを削除)] を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Set Payload (ペイロードを設定)] 要素をドラッグし、値を Success
に設定します。
[Mule Palette (Mule パレット)] から、[HTTP Listener (HTTP リスナー)] 要素をキャンバスにドラッグし、デフォルトの設定を使用しますが、パスは /getCustomerList に設定します。
[HTTP Listener (HTTP リスナー)] 要素の横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/xml
ns ns0 http://schemas.microsoft.com/dynamics/gp/2010/01
ns ns01 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.Common
ns ns02 http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.GP
ns xsi http://www.w3.org/2001/XMLSchema-instance
---
{
ns0#GetCustomerList: {
ns0#criteria: {
ns02#Name: {
ns01#Like: attributes.queryParams.like
}
},
ns0#context: {
ns01#OrganizationKey @(xsi#"type": "ns01:CompanyKey") : {
ns01#Id: attributes.queryParams.companyKeyID
}
}
}
}
[Transform Message (メッセージを変換)] 要素の横に Microsoft Dynamics GP Connector をドラッグします。
[Get Entity List (エンティティリストを取得)] を選択します。ドロップダウンリストから [Customer (顧客)] エンティティを選択します。[Input Reference (入力参照)] はそのままにします。
コネクタの横に [Transform Message (メッセージを変換)] 要素をドラッグし、以下を追加します。
%dw 2.0
output application/json
---
payload