Developer forum

Forum » Integration » custom call to ERP webservice using Integration Framework 2

custom call to ERP webservice using Integration Framework 2

Jonas Krarup Dam
Reply

Hi,

I am setting up an integration using IF2 with Live Integration.

I have some custom functionality that I would like to implement, which means that I would simply like to CallErpService(WithMyCustomXML) and get back the response XML from the ERP. 

How can I do this simply?

When I look at the source for the IF2 LiveIntegration, it looks like all the Connector-stuff is marked as internal, which means that the only way to do this, is to use source and add my functionality directly to the LiveIntegration Dll. 

I would much prefer some sort of simple public class or static method in the liveIntegration dll that I could use. Am I missing something?

 

Thanks, Jonas


Replies

 
Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Jonas,
you can add a Nuget package reference for Dynamicweb.Ecommerce.DynamicwebLiveIntegration 4.0.2
and have a code like that:

using Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Configuration;
using Dynamicweb.DataIntegration.Integration.ERPIntegration;

namespace ConsoleApp1
{
    class Program
    {
        private static Settings GetSettings()
        {
            Settings settings = null;
            if (!SettingsManager.ActiveSettingsByShopId.TryGetValue(string.Empty, out settings))
            {
                string shopId = Dynamicweb.Frontend.PageView.Current()?.Area?.EcomShopId;
                shopId = shopId ?? string.Empty;
                SettingsManager.ActiveSettingsByShopId.TryGetValue(shopId, out settings);
            }
            return settings;
        }

        private static string Execute()
        {
            var settings = GetSettings();
            return ErpServiceCaller.GetDataFromRequestString(settings.WebServiceURI, settings.SecurityKey, "<CustomRequest/>");
        }
    }
}
Hope that will help
Kind regards, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum