Connect ERP-System to C#

April 13, 2014
As the community of Mobile Field Report (MFR) is growing, we are also trying to provide the best tools and extensibility points for developers. In the recent post we have introduced MFR OData API endpoint that provides very flexible way how to get data from MFR. Today we are releasing completely new section in MFR portal dedicated for developers.

You can find OData endpoint URL there as well as links to further examples. But what is brand new and what I will introduce today is MFR support for AMQP Messaging.

AMQP in Mobile Field Report

AMQP (link stays for Advanced Message Queuing Protocol which is a new standard for inter-portable, cross-platform messaging. MFR is using this protocol to broadcast events (like job created, job deleted and others) and to notify other potential systems or plugins. This means that every system can listen to MFR events and operate on them. The example could be propagating changes from MFR to company ERP system. I will show how to get started with MFR messaging in few steps.

To start using MFR messaging you need to activate it first. To do this open MFR portal and navigate to Account Settings / Developers section. Than click Activate button at the bottom commands section. This action should prepare a message bus and provide all the necessary credentials for you.

Next step is to create a subscription. Subscription defines a consumer of events. MFR is broadcasting events to all specified subscriptions therefor you need to have at least one. You will typically create a separate subscription for every system that you will integrate with MFR. To create it navigate to Subscriptions tab and create one.

Now you have everything prepared for integrating with MFR. I will post here a quick example how to consume MFR events in c# but you can use any other language that has a port to AMQP. For java you can take a look at this document describing how to bridge JMS to AMQP (

C# example

Start with creating a c# console application in visual studio. Next step is to add a reference to Microsoft.ServiceBus. You can do this using a NuGet package or direct downloading assembly.

Install Package with NuGet

Install Package with NuGet

Next you need to get credentials and connection strings from MFR portal.

Install Package with NuGet

The sample has a very simple functionality. It just loops and reads a message from MFR and writes it to the console. To be actually able to read a message from MFR message bus, you need to create a SubscriptionClient. To create SubscriptionClient you need to get a MessagingFactory based on the credentials located in the portal.

If you run this console application, it should be writing the events from MFR to the console. You just need to invoke some changes, like create or delete contact in MFR portal.

You can download full example here

That’s how you can listen to events from MFR. You can see that from integrating other systems with MFR is becoming a very easy task. Follow our blog to see more upcoming features.

Rate this post

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">