Hi
I have a class (extends RunBaseBatch) syncing data between Ax and one of our own old system.
We have designed it by letting Ax consuming a webservice from the old system via a Visual Studio Project (generating the model to Ax). This is, as i understand, the classic way to do it in Ax 2012.
If I design a Job to use the class, it all runs as intended if I run it by hand.
If I set up a Batch job, it throws an exception as soon as it starts to consume the webservice. It runs perfectly if no webservice is consumed. I have compiled full CIL, so that shouldn't be the problem.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an...
Sample of code:
ClrObject clientType;
TestWCFProxy.CMSWCFProxy _client;
...
new InteropPermission(InteropKind::ClrInterop).assert();
...
clientType = CLRInterop::getType("TestWCFProxy.CMSWCFProxy");
_client = AifUtil::CreateServiceClient(clientType);
Have you got any ideas of what I'm doing wrong? Is there any way to debug the Class running af Batch job?
Best regards
Lars Vistrup Skov