Developer forum

Forum » Integration » ErpServiceCaller without Dynamicweb context

ErpServiceCaller without Dynamicweb context

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

In the past we used to be able to call the ErPServiceCaller directly from a test connector. However, when I do that now on DW 9, I get this:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Core.SystemInformation.GetBasePath(String& relativePath)
   at Dynamicweb.Core.SystemInformation.MapPath(String relativePath)
   at Dynamicweb.Configuration.SystemConfiguration.get_Instance()
   at Dynamicweb.DataIntegration.Integration.ERPIntegration.ErpServiceCaller.GetBinding(String endpoint, TimeSpan timeout)
   at Dynamicweb.DataIntegration.Integration.ERPIntegration.ErpServiceCaller.GetDataFromRequestString(String endpoint, String secret, String requestXML)
   at TestConnectors.DWConnectorTest.ProcessRequest(String request)
   at DynamicwebServiceTester.TesterControl.ExecuteTest()

It's crashing on getting a path in SystemInformation

Does that happen because I am not in a web app? Or is there something wrong in SystemInformation?

Imar


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

It happens because it tries to read a timeout setting from global settings, but the system has not yet been initialized, which is usually handled when the web application starts up (GlobalAsaxHandler).

As a workaround you can try to set the root directory like this:

SystemInformation.RootDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory)
Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Morten, I'll give that a try!

 

You must be logged in to post in the forum