Ready to get started?

Configure a Receive Location for the CData BizTalk Adapter for Magento

Pull Magento data in BizTalk using the CData BizTalk Adapter for Magento. Use receive locations to execute SQL commands and automate actions in Magento.

You can follow the procedure in this article to connect to Magento data, configure a static one-way receive location, and use it to perform a simple test: retrieving Magento data and writing it to an XML file.

A receive location can execute SQL commands and create BizTalk messages that contain the results. If you want to execute updategram commands, use a send port.

Create the Receive Port

To add a receive location to your application, you first need to add a receive port. Receive ports can receive data from multiple receive locations.

If you have not already done so, open your application in the BizTalk Administration Console.

Magento uses the OAuth 1 authentication standard. To connect to the Magento REST API, you will need to obtain values for the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties by registering an app with your Magento system.
See the "Getting Started" section in the help documentation for a guide to obtaining the OAuth values and connecting.

You will also need to provide the URL to your Magento system. The URL depends on whether you are using the Magento REST API as a customer or administrator.

Customer: To use Magento as a customer, make sure you have created a customer account in the Magento homepage. To do so, click Account -> Register. You can then set the URL connection property to the endpoint of your Magento system.

Administrator: To access Magento as an administrator, set CustomAdminPath instead. This value can be obtained in the Advanced settings in the Admin menu, which can be accessed by selecting System -> Configuration -> Advanced -> Admin -> Admin Base URL.

If the Use Custom Admin Path setting on this page is set to YES, the value is inside the Custom Admin Path text box; otherwise, set the CustomAdminPath connection property to the default value, which is "admin".

Refer to the help documentation for a description of the various properties and their functions.

Use a Send Port to Write Data to an XML File

The Static One-Way Receive Location is now ready for use with a send port: A send port must be associated with the BizTalk message that is created by the receive location. To write data to a file, create a file send port.

Enter a name for the send port at the top of the configuration window and select FILE from the Type menu.

Configure a destination folder; this will be the location where the files are created on disk.

For the file name, a macro can be used to easily identify what day the file was created. By default, %MessageId%.xml is used. However, this is not a very user-friendly name, as it is a randomly generated BizTalk Id. To produce a file in the format Products_yyyy-MM-dd.xml, enter Products_%Date%.xml.

Note: For additional information regarding macros, visit the BizTalk Configuration section in the help documentation.

Click OK. The URI field should now contain a value.

Click Filters in the left-hand side of the configuration screen for the send port.

Set the following properties:

Property: Select "BTS.InboundTransportLocation" from the menu.

Operator: Select "==" from the menu.

Value: Enter the URI of the receive location. The URI is shown in the receive location properties.

You can now use the send port to write files that have been sent from the receive location.

Enlist and Enable the Locations and Ports

The final step is to enlist the send port and enable the receive location: Right-click the send port and click Enlist. Then right-click the receive location and click Enable.

Note: Enable the receive location last: This makes sure the file gets picked up for writing by the send port.

Troubleshooting

To check if errors are occurring, expand "Event Viewer (Local)" in the navigation tree in the Administration Console. Expand Windows Logs and click Applications.

The log will include error messages for all applications on the system, so it is important to check that the source of the error message is "CData BizTalk Magento Receive Adapter". Details of the error message should provide insight into why the error is occurring. For guidance on resolving the error, contact support@cdata.com/jp.