Hi,
I am trying to use SSIS to pull batch information and eventually transaction information for an accounting report. I am trying to take code from the Sample project and implement it using SQL Server integration Services. I am trying to get the routine "GetSettledBatchList" implemented as a Script Task within SSIS. At one point I thought I had the Authorize.Net logic working, so I attempted to add a Stored Procedure within the code to capture the transaction data and write it to the database. My initial attempt adding the stored procedure yielded the error "Exception has been thrown by the target of an invocation", so I eventually wrote a Script Task to just execute the stored procedure sending hard coded data and i was able to get that to work. I went back to trying to implement the GetSettledBatchList logic in SSIS and received the same error message. I have tried working with VS 2010, 2012 and 2013 and I have worked on two different PCs, all throwing the same exception (trying to rule out issues with the Authorize.Net DLL). I was able to modify the original .NET code from the Sample Project to write the data to the database without any problems - it is just moving the logic to SSIS that I am having problems with. I have even removed almost all of the Authorize.Net code from the Script Task and just executed the statement to set the environment variable - with no luck.
I am hoping someone can give me some clues as to what is causing the issue in SSIS. I didn't see any examples of working with SSIS online.
The error displays in a "DTS Script Task: Runtime Error" window.
The error message is:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
Here is the code throwing the error if it helps:
#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using AuthorizeNet;
using AuthorizeNet.Api.Controllers;
using AuthorizeNet.Api.Contracts.V1;
using AuthorizeNet.Api.Controllers.Bases;
using System.Data.SqlClient;
#endregion
namespace ST_acecc688c00942cd86176e2d724b96fb
{
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
String ApiLoginID = Dts.Variables["User::APILoginID"].Value.ToString();
String ApiTransactionKey = Dts.Variables["User::APITranKey"].Value.ToString();
Console.WriteLine("Get settled batch list sample");
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
Dts.TaskResult = (int)ScriptResults.Success;
}
Any assistance will be appreciated.
Thanks!
10-26-2015 11:49 AM
Hello @fggoins3
It's been a while since this was first posted. I would recommend subscribing to this topic so that you'll be alerted via email if anyone from the community is able to respond with any comments. To subscribe, click Topic Options at the top of this thread and then select Subscribe. You'll then receive an email once anyone replies.
Thanks,
Richard
11-06-2015 12:05 PM
I have the same problem. I assume it has something to do with SSIS not trusting the DLL, since it's not in the GAC (global assembly cache). Or maybe it simply can't find it at run time.
When I try to add it to the GAC, it says that it needs a "strong name". I have tried gacutil and regsvr32 and still no luck.
I was hoping there was another version of the DLL suitable for use as a reference inside an SSIS script task.
But I think the only option is to take their source code and create my own, if that's possible.
Any thoughts?
I'm on SQL Server 2012 and SSDT 2015.
I needed to install latest SSDT, since the version included with SQL 2012 uses VS 2010 shell, and did not support .NET 4.6.1, which is needed. The latest SSDT uses VS 2015 Shell.
08-02-2017 11:23 AM
I'm running into this same issue. Was there a resolution for this?
09-05-2017 06:35 AM