SSIS Error : Code: 0xC0047062 + Its solution

Hi All

we need to get files from Https location and then extract and load . For this we are using Script transformation AS SOURCE . As the file need some string operations to get columns we used Script transformation in that we used Httpwebrequest  to connect to that URL by passing username and password .

The package works fine from BIDS in my local machine but when we deployed in dev server and created SQL job  the job is getting failed at  HTTP url connection level . with the fallowing error


Code: 0xC0047062     Source: get chat file list get files [1]     Description: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

Code: 0xC0047038     Source: get chat file list SSIS.Pipeline     Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "get files" (1) returned error code 0x80131509.


To Solve that issue we need to set up a proxy account between dev and Http server . then use the fallowing code


HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com/");
request.Credentials = new NetworkCredential("FTPusername", "FTPpw");
WebProxy webProxy = new WebProxy("http://myproxy.net:8080/", true)
         {
             Credentials = new NetworkCredential("Proxyusername", "Proxypw"),
             UseDefaultCredentials = false
         };

request.Proxy = webProxy;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

This Extra code will solve your purpose .

Comments

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces