3.7.x or higher
Microsoft Dynamics GP Connector - Mule 3
Anypoint Connector for Microsoft Dynamics GP (Microsoft Dynamics GP Connector) enables Mule apps to interact with the Microsoft Dynamics Great Plains (GP) Web Services.
Read the provided user guide to understand how to set up and configure a basic flow using the connector.
Release Notes: Microsoft Dynamics GP Connector Release Notes
Exchange: Microsoft Dynamics GP Connector
Before You Begin
You are familiar with Microsoft Dynamics GP, Mule runtime engine, Anypoint Connectors, Anypoint Studio essentials, elements in a Mule flow, and global elements.
Hardware and Software Requirements
For hardware and software requirements, see Hardware and Software Requirements.
The connector interacts with Dynamics GP web service. To make the integration with Mule, the Dynamics GP instance must be exposed through the Dynamics GP web service. See Web Services Installation and Administration Guide (PDF).
Java Cryptography Extension (JCE) is required for the authentication process. Download JCE-7 from Java Cryptography Extension (JCE).
Install the Connector
-
In Anypoint Studio, click the Exchange icon in the Studio taskbar.
-
Sign in to Exchange with your Anypoint Platform credentials.
-
From Anypoint Exchange, click Provided by MuleSoft.
-
Search for the Mule 3 connector and click Install.
Configure the Global Element
To use the Dynamics GP connector in your Mule app, configure a Global Element for use by all the Dynamics GP connectors in the applications. Global Elements can be of two types:
-
Kerberos Authentication:
Establishes a connection with Microsoft Dynamics GP on-premises using the native Kerberos authentication.
The Kerberos protocol defines how clients interact with a network authentication service. Clients obtain tickets from the Kerberos Key Distribution Center (KDC), and they present these tickets to servers when connections are established. Kerberos tickets represent the client’s network credentials.
-
NTLM Authentication:
Establishes a connection with Microsoft Dynamics GP on-premises using the legacy NTLM authentication.
Windows NT LAN Manager (NTLM) is a challenge and response authentication protocol used in networks that include systems running the Windows operating system and in stand-alone systems. NTLM credentials are based on data obtained during the interactive logon process and consist of a domain name, a user name, and a one-way hash of the user’s password.
Kerberos Authentication
For Kerberos configuration, ensure that the server is configured to use Kerberos authentication. More information can be found in Web Services Installation and Administration Guide (PDF) chapter 8.
-
In Anypoint Studio, click the Global Elements tab at the bottom of the canvas.
-
Click Create to bring up Global Type dialog box.
-
In the Search text box, enter "gp" and fill in the required parameters:
-
Click Test Connection to make sure the connection works correctly.
-
Once the connection is successful, click OK.
Parameter | Description |
---|---|
Username |
The Windows user name to connect to Dynamics GP. |
Password |
The password for the user to connect to Dynamics GP. |
Endpoint URL |
Base URL where the SOAP services are exposed in the form http://<Server>:<WebServicePort>/Dynamics/GPService/GPService. Example: +http://hostname:7047/Dynamics/GPService/GPService+ |
SPN |
The service principal name that identifies the service instance |
Login Conf. Location |
Path to the Kerberos login module. Example: C:\kerberos\login.conf |
Krb5 Conf. Location |
Path to the Kerberos configuration file. Example: C\kerberos\krb5.conf |
A sample Kerberos configuration file is as follows:
[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
The realm and default_domain are case-sensitive and must be specified exactly as defined in Active Directory. Receiving an error during Test Connection stating “Message stream modified (41)” indicates that the domain name is not correctly formed.
More information on how to create the Kerberos configuration file can be found in the MIT Kerberos Documentation.
The Kerberos login module (Krb5LoginModule) can be tuned with scenario-specific configurations by defining a JAAS login configuration file. Following is a sample of the JAAS login configuration file for the Kerberos login module:
Kerberos {
com.sun.security.auth.module.Krb5LoginModule required
debug=true
refreshKrb5Config=true;
};
See how to create the JAAS login configuration file for the Kerberos login module at Krb5LoginModule.
NTLM Authentication
-
Click the Global Elements tab.
-
Click Create to bring up Global Type dialog box.
-
In the Search text box, enter GP and fill in the required parameters.
-
Click Test Connection to make sure the connection works correctly.
-
Once the connection is successful, click OK.
Parameter | Description |
---|---|
Username |
The Windows user name to connect to Dynamics GP. Important: The user must be in the same domain as Dynamics GP and cannot be a local account, it must be a domain account. |
Password |
The password for the user to connect to Dynamics GP. |
Endpoint |
Base URL where the SOAP services are exposed in the form: Example: |
Domain |
Domain of the Dynamics GP instance. |
Use the Connector
See a full list of operations for any version of the connector, see the Microsoft Method Reference.
Connector Namespace and Schema
When designing your application in Studio, dragging the connector from the Mule Palette view to the Anypoint Studio canvas automatically populates the XML code with the connector namespace and schema location.
-
Namespace:
http://www.mulesoft.org/schema/mule/dynamicsgp
-
Schema Location:
http://www.mulesoft.org/schema/mule/dynamicsgp/current/mule-dynamicsgp.xsd
If you are manually coding the Mule app in Studio’s XML editor or other text editor, define the namespace and schema location in the header of your Configuration XML, inside the <mule>
tag.
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dynamicsgp="http://www.mulesoft.org/schema/mule/dynamicsgp"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/dynamicsgp
http://www.mulesoft.org/schema/mule/dynamicsgp/current/mule-dynamicsgp.xsd">
<!-- put your global configuration elements and flows here -->
</mule>
Use the Connector in a Mavenized Mule App
If you are coding a Mavenized Mule app, include this XML snippet in your pom.xml file.
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>ms-dynamics-gp-connector</artifactId>
<version>x.x.x</version>
</dependency>
Replace x.x.x
with the version that corresponds to the connector you are using.
To obtain the most up-to-date pom.xml
file information, access the connector in Anypoint Exchange and click Dependency Snippets.
Demo: Mule Apps Using Connector
You can download fully functional demo apps for the Dynamics GP connector.
Example Use Case
This set of use cases describe how to create a Mule app to use Microsoft Dynamics GP CRUD operations using either Kerberos or NTLM authentication.
Create Customer
-
Drag an HTTP Listener element to the canvas and use the default configuration but with the path set to
/createCustomer
. -
Drag a Transform Message element next to the HTTP Listener, and enter:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, customer: { key: { id: inboundProperties."http.query.params".customerKeyID }, name: inboundProperties."http.query.params".customerName } } as :object { class : "org.mule.modules.dynamics.gp.api.param.CreateCustomerParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Set its configuration to NTLM or Kerberos Connection and fill the required fields, this applies to all the other Dynamics GP connectors that are dragged into the flows.
-
Select the operation Create Customer. Leave the Entity Reference as is.
-
Drag a Set Payload element next to the Connector and set its value as
"Success"
.
Get Customer
-
Drag from the Mule Palette a HTTP Listener element to the canvas and use the default configuration but with the path set to
/getCustomer
. -
Drag a Transform Message element next to the HTTP Listener and write:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, key: { id: inboundProperties."http.query.params".customerKeyID } } as :object { class : "org.mule.modules.dynamics.gp.api.param.GetCustomerByKeyParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Select the operation Get Customer By Key. Leave the Entity Reference as it is.
-
Drag an Object to JSON element next to the connector and leave it as it is.
Update Customer
-
Drag from the Mule Palette a HTTP Listener element to the canvas and use the default configuration but with the path set to
/updateCustomer
. -
Drag a Transform Message element next to the HTTP Listener, and enter:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, key: { id: inboundProperties."http.query.params".keyId } } as :object { class : "org.mule.modules.dynamics.gp.api.param.GetCustomerByKeyParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Select the Get Customer By Key operation. Leave the Entity Reference as is.
-
Drag a Transform Message element next to the connector, and enter:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, customer: { comment1: flowVars.UpdatedComment, key: { id: payload.key.id }, name: payload.name } } as :object { class : "org.mule.modules.dynamics.gp.api.param.UpdateCustomerParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Select the Update Customer operation. Leave the Entity Reference as is.
-
Drag a Set Payload element next to the Connector and set its value to
"Success"
.
Delete Customer
-
Drag from the Mule Palette a HTTP Listener element to the canvas and use the default configuration but with the path set to
/deleteCustomer
. -
Drag a Transform Message element next to the HTTP Listener, and enter:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, key: { id: inboundProperties."http.query.params".customerKeyID } } as :object { class : "org.mule.modules.dynamics.gp.api.param.DeleteCustomerParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Select the Delete Customer operation. Leave the Entity Reference as is.
-
Drag a Set Payload element next to the connector and set its value to
"Success"
.
Get Customer List
-
Drag an HTTP Listener element to the canvas and use the default configuration but with the path set to
/getCustomerList
. -
Drag a Transform Message element next to the HTTP Listener, and enter:
%dw 1.0 %output application/java --- { context: { organizationKey: { id: inboundProperties."http.query.params".companyKeyID } as :object { class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey" } }, criteria: { name: { like: inboundProperties."http.query.params".like } } } as :object { class : "org.mule.modules.dynamics.gp.api.param.GetCustomerListParams" }
-
Drag a Microsoft Dynamics GP connector next to the Transform Message.
-
Select the Get Customer List operation. Leave the Entity Reference as is.
-
Drag an Object to JSON element next to the connector and leave it as is.
Example Use Case - XML
Paste this into Anypoint Studio to interact with the example use case application discussed in this guide.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"
xmlns:dynamicsgp="http://www.mulesoft.org/schema/mule/dynamicsgp"
xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/dw
http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/dynamicsgp
http://www.mulesoft.org/schema/mule/dynamicsgp/current/mule-dynamicsgp.xsd
http://www.mulesoft.org/schema/mule/xml
http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/ee/tracking
http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/json
http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:listener-config
name="HTTP_Listener_Configuration"
host="0.0.0.0"
port="8082"
doc:name="HTTP Listener Configuration"/>
<dynamicsgp:config-kerberos
name="Dynamics_GP__Kerberos_Connection"
username="${gp-kerberos.username}"
password="${gp-kerberos.password}"
endpoint="${gp-kerberos.endpoint}"
spn="${gp-kerberos.spn}"
loginConfLocation="${gp-kerberos.loginConfLocation}"
krb5ConfLocation="${gp-kerberos.krb5ConfLocation}"
doc:name="Microsoft Dynamics GP: Kerberos Connection"/>
<flow name="CreateCustomer">
<http:listener
config-ref="HTTP_Listener_Configuration"
path="/createCustomer"
doc:name="/createCustomer"/>
<dw:transform-message doc:name="Set Create Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
customer: {
key: {
id: inboundProperties."http.query.params".customerKeyID
},
name: inboundProperties."http.query.params".customerName
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.CreateCustomerParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:create-customer config-ref="Dynamics_GP__Kerberos_Connection"
doc:name="Create Customer" params-ref="#[payload]"/>
<set-payload value=""Success"" doc:name="Set Payload"/>
</flow>
<flow name="GetCustomer">
<http:listener config-ref="HTTP_Listener_Configuration" path="/getCustomer"
doc:name="/getCustomer"/>
<dw:transform-message doc:name="Set Get Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
key: {
id: inboundProperties."http.query.params".customerKeyID
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.GetCustomerByKeyParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:get-customer-by-key
config-ref="Dynamics_GP__Kerberos_Connection"
params-ref="#[payload]"
doc:name="Get Customer By Key"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
<flow name="UpdateCustomer">
<http:listener config-ref="HTTP_Listener_Configuration" path="/updateCustomer"
doc:name="/updateCustomer"/>
<set-variable
variableName="UpdatedComment"
value="#[message.inboundProperties.'http.query.params'.updatedComment]"
doc:name="UpdatedComment"/>
<dw:transform-message doc:name="Set GetByKey Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
key: {
id: inboundProperties."http.query.params".keyId
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.GetCustomerByKeyParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:get-customer-by-key
config-ref="Dynamics_GP__Kerberos_Connection"
doc:name="Get Customer by Key"
params-ref="#[payload]"/>
<dw:transform-message doc:name="Set Update Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
customer: {
comment1: flowVars.UpdatedComment,
key: {
id: payload.key.id
},
name: payload.name
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.UpdateCustomerParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:update-customer
config-ref="Dynamics_GP__Kerberos_Connection"
params-ref="#[payload]"
doc:name="Update Customer"/>
<set-payload value=""Success"" doc:name="Set Payload"/>
</flow>
<flow name="DeleteCustomer">
<http:listener config-ref="HTTP_Listener_Configuration" path="/deleteCustomer"
doc:name="/deleteCustomer"/>
<dw:transform-message doc:name="Set Delete Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
key: {
id: inboundProperties."http.query.params".customerKeyID
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.DeleteCustomerParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:delete-customer
config-ref="Dynamics_GP__Kerberos_Connection"
params-ref="#[payload]"
doc:name="Delete Customer"/>
<set-payload value=""Success"" doc:name="Set Payload"/>
</flow>
<flow name="GetCustomerList">
<http:listener
config-ref="HTTP_Listener_Configuration"
path="/getCustomerList"
doc:name="/getCustomerList"/>
<dw:transform-message doc:name="Set GetList Request">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{
context: {
organizationKey: {
id: inboundProperties."http.query.params".companyKeyID
} as :object {
class : "org.mule.modules.dynamics.gp.api.entity.CompanyKey"
}
},
criteria: {
name: {
like: inboundProperties."http.query.params".like
}
}
} as :object {
class : "org.mule.modules.dynamics.gp.api.param.GetCustomerListParams"
}]]></dw:set-payload>
</dw:transform-message>
<dynamicsgp:get-customer-list
config-ref="Dynamics_GP__Kerberos_Connection"
doc:name="Get Customer List"
params-ref="#[payload]"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
</mule>