MuleSoft Connector for WooCommerce

Build 20.0.7587

Establishing a Connection

This section describes how to connect to WooCommerce from your AnyPoint Studio project. You can use wizards or the XML editor in AnyPoint Studio to define connection properties in a global element. Global elements can be reused across other building blocks in your project.

Create a Connection in the Visual Editor

Complete the following steps to visually add the connector to your project and create a connection:

  1. Create a new Mule Project in Anypoint Studio.
  2. From the palette, drag the connector into your Mule flow.
  3. On the Message Flow canvas, double-click the connector icon to open the connector properties in the Properties pane.
  4. In the General section, click Add and define the WooCommerce connection properties. Note that the user name and Password properties always appear here. The user name must be set as it is used as the key for the connection if connection pooling is enabled.

Create a Connection in the XML Editor

Set connection properties in the <cdata-woocommerce:config> element in the root of the project's XML.

Note: The user name attribute must always be included here and serves as the key for the connection if connection pooling is enabled.

  <cdata-woocommerce:config name="CData_WooCommerce_Configuration" username="MyName" connectionProperty1="MyProperty" ... doc:name="CData WooCommerce: Configuration"/> 

Connecting to WooCommerce

WooCommerce supports the following authentication methods: Basic Authentication, one-legged OAuth1.0 Authentication and standard OAuth2.0 Authentication.

Additionally, in order to connect to WooCommerce, you also must specify the URL of the instance to connect to.

Connecting using Basic Authentication

Some plugins and some servers may interfere with the Authorization header, if not configured properly.

For these cases, Basic authentication may be used. In this authentication mode, the user provides the consumer_key and the consumer_secret as user and password respectively.

These credentials are then sent as query parameters with each request.

Specify the following properties:

  • User - Set this to your consumer key
  • Password - Set this to your consumer secret
  • Url - Set this to the base URL of the WooCommerce instance to connect to.

Connecting using one-legged OAuth 1.0 Authentication

Specify the following properties (NOTE: the below credentials are generated from WooCommerce settings page and should not be confused with the credentials generated by using WordPress OAuth2.0 plugin):

  • ConsumerKey
  • ConsumerSecret
  • Url - Set this to the base URL of the WooCommerce instance to connect to.

Connecting using WordPress OAuth 2.0 Authentication

After having configured the OAuth2 Plugin plugin, you may connect to WooCommerce by providing the following connection proeprties:

  • OAuthClientId
  • OAuthClientSecret
  • CallbackURL
  • InitiateOAuth - Set this to either GETANDREFRESH or REFRESH
  • Url - Set this to the base URL of the WooCommerce instance to connect to.

In addition to the above connection parameters, you can optionally set the AuthScheme parameter to force the preferred authentication scheme.

  • AuthScheme - Set this to either Basic, OAuth or OAuthOneLegged, depending on your preferred authentication method.

Configure Connector Operations

The connector is an operation-based connector; its operations correspond to SQL statements and expose other functionality such as Schema Discovery. See Using the Connector (Mule 3.8+) for more information on executing SQL to WooCommerce in Mule applications.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7587