Hi
I'm using
public void Main()
{
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.DownloadFile(Dts.Variables[0].Value.ToString(), Dts.Variables[1].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
}
and it gives me error;
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
at ST_1170742e7f804201b7f773e43f5706a6.csproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
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 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
This Time i simply add a URL and Downalod it i used this;
public void Main() { System.Net.WebClient mySSISWebClient = new System.Net.WebClient(); mySSISWebClient.DownloadFile(@" https://secure.f-prot.com/keyportal/cgi-bin/keyportal_account-reference&account_reference_value=dcall-001", @"C:\Audiney_API_File\keyportal_accountinfo.pl.xml"); Dts.TaskResult = (int)ScriptResults.Success; }
then it give me same error;
Kindly help how can I solvethis ..
With Regards
BI_Group