0

I have a SSIS 2008 script task. I have added a Web Reference to a SOAP webservice on the script editor and have the following code to instantiate the service and call a method

MyWebService.Service ox = new MyWebService.Service();
string sResult;
sResult = ox.MyMethod(); 

everything works fine when this code runs in BIDS but fails with the following error when run from the SQL server Agent:


Executed as user: My_Domain\SQLServerAgentServiceAccount. Microsoft (R) SQL Server Execute Package Utility Version 10.50.6000.34 for 32-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 2:51:44 PM Error: 2015-08-24 14:52:08.99 Code: 0x00000001 Source: Script Task Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xxx.xx.x.xx:443 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ST_4c5d20bf332741e2882cde151f073447.csproj.MyWebService.Service() at ST_4c5d20bf332741e2882cde151f073447.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() End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 2:51:44 PM Finished: 2:52:09 PM Elapsed: 24.672 seconds. The package execution failed. The step failed.

I have xxx.xxd out the IP address in the above error message. what's surprisingly when using BIDS and monitoring the network flow with wireshark the xxx.xxd out IP address is never being hit while when monitoring the flow of the agent the xxx.xxd IP address is being hit but a failure is generated. Furthermore when going the BIDS Route looks like HTTP is used to get to the vendors webservice URL. While when going through the agent wireshark indicates that the first thing in the TCP stream is a TCP call to the vendors IP.

Note that BIDS and Agent are running on the same server

Any one have any idea what the problem could be?

Thanks in advance

nonojojo
  • 13
  • 5
  • I'm guessing that your developing with BIDS on your local computer while the SQL Server Agent is located on a different server. If this is the case, does the SQL Server Agent have access to where the Web Service is running? One of the first errors I'm seeing is "unable to connect to remote server." This implies there could be a problem with permissions. Can you remote to the database server and ping the server running the web services? – user3662215 Aug 27 '15 at 19:34
  • Thanks for your response. I am actually running BIDS on the Server that the SQL Server Agent is running on. when I ping the web address(url) of the web service I get:"Ping request could not find host https:..." and when I ping the IP I get: "Request timeout". The Web service is on a vendors site. We provided the vendor a whitelist of IPs that would be connecting to their Webservice. – nonojojo Aug 27 '15 at 21:00
  • I had a similar issue and posted a complete diagnosis procedure here - http://stackoverflow.com/a/32239970/1371639. It might help you to debug the issue. – Karthik Aug 28 '15 at 02:50

0 Answers0