AsdeqServer supports integration with the Mule Enterprise Service Bus.
This consists of an OData Service based on the Apache Olingo library (https://olingo.apache.org/) that allows Mule to accept an OData payload and transform it for consumption by external systems.
This guide provides a step-by-step guide on how to setup a Mule Project to integrate with AsdeqServer in Anypoint Studio.
Software requirements for this guide
- This guide is written for Anypoint Studio 6.1.0 - these steps may differ in later versions.
- MuleSoft Anypoint Studio Version 6.1.0 - https://www.mulesoft.com/platform/studio
- AsdeqServer 5.0+
1. Download the Connector
Download the AsdeqServer odataconnector files:
2. Create a new Anypoint Studio Project
- Place these files in a folder and open Anypoint Studio.
- Go to File --> Import --> Maven-based Mule Project from pom.xml
- Specify the settings for the Mule Project and browse to the pom.xml file in the AsdeqServer odataconnector distribution.
- Click "Finish" when ready.
- A new Maven based project will be created. Anypoint Studio will download the required 3rd party resources from the Internet and setup the project structure.
3. Create an OData Model
- Take the odataconnector-sample-flow.xml and move it to the src/main/app (Flows) folder.
Create a POJO (Plain Old Java Object) to represent your data to be passed from the OData Service. (See example code below). This model should correspond to the entity from the back end system you are integrating with.
Note the Olingo annotations on the class and properties, these specify the data to be exposed by the Service.
- Refer to the Olingo documentation for further information: https://olingo.apache.org/doc/odata2/tutorials/AnnotationProcessorExtension.html
4. Setup the OData Service
- Open the odataconnector-sample-flow.xml file. View the Configuration XML and modify the http listener config as required to set the port number and authentication mechanism.
- Modify the modelPackage property to point to the package where you have create you POJO model. This will be scanned automatically by Mule.
- Note that the IDE may claim the binding configuration is invalid, this is a bug in the Mule Schema definition and can be ignored, it does not effect running of the Mule Flow.
- The Mule readData and writeData endpoint are used to request and write data from the OData service into Mule. The messages sent and received will contain POJO's matching the data model you defined.
- Start the Mule Server and the OData Service for this example service will be available at a url similar to the following: http://hostname:8004/odata.svc/ (note that using localhost as the hostname may not work properly with this example)
The following XML fragment shows a simple flow that reads data from a JSON text file on disk and returns it to the OData service via the readData VM, see the sample flow for further details:
- The following is the cars.JSON sample file that readData is return as an array of Car to the OData service.
- Writing to the OData service is effectively the reverse of the above using the writeData VM. e.g. See below - note this implementation is incomplete.
Basic content filtering is handled internally by the Olingo engine, the filter can be passed into the Flow for more complicated filtering / querying at the Mule ESB level.
Connecting AsdeqServer to Mule
Once you have a basic OData Service running in Mule you can connect AsdeqServer. This is done by creating an OData Source Location as follows:
- Log into AsdeqServer as an Administrator.
- Go to the Source Locations screen.
- Create a new Source Location and select OData:
- Configure the Source Location:
Depending on how you have setup security in Mule your configuration screen may look like the following.
The default endpoint for the OData Service in Mule: /odata.svc/
- Select the Entity / Folder in the Location browser where submissions will be saved.
- Save the Source Location.
- Go to the Forms configuration page and setup your Form Library.
- To use the OData Source Location go to the Submissions tab and specify the OData Entity Folder as the submission location.
- This will now read and write Drafts / Submissions to the OData Service for the Form Library depending on the Form Library configuration.
There is no content with the specified labels