HTTP: GET from SSIS Script Task

  • Hi I need to make a HTTP GET from a script task, I'm not using not Activex Script because I' not that familiar with it.

    My test code is this:

    Dim strURL, oBrowser

    Dim serverPath

    Dim scriptPath

    serverPath = "http://www.hr-technologies.com/content/"

    scriptPath = "page.asp"

    strURL = serverPath & scriptPath

    oBrowser = CreateObject("Microsoft.XMLHTTP")

    oBrowser.Open("GET", strURL, False, "", "")

    oBrowser.send()

    msgbox(oBrowser.responsetext)

    oBrowser = Nothing

    Main = DTSTaskExecResult_Success

    But I'm getting an error on the CreateObject call, my guess is that I'm not including the correct refernces - but I dont know how to fix.

    Any help most welcome!

    Thanks

    Allen

  • Hi Allen,

    I would recommend against using ActiveX scripting because it is no longer supported.

    Having said that, if you are receiving error on CreateObject function call, then you don't have MSXML installed properly.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Thanks CozyRoc, I hadnt thought of the MSXML installation. Is that Ivan?

  • Hi Allen,

    Yes, this is Ivan.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Dim strURL, oBrowser

    Dim serverPath

    Dim scriptPath

    serverPath = "http://www.hr-technologies.com/content/"

    scriptPath = "page.asp"

    strURL = serverPath & scriptPath

    oBrowser = CreateObject("Microsoft.XMLHTTP")

    oBrowser.Open("GET", strURL, False, "", "")

    oBrowser.send()

    msgbox(oBrowser.responsetext)

    oBrowser = Nothing

    Main = DTSTaskExecResult_Success

    Hi Allen,

    To use above the code u need to add the following refrence in your VBScript

    Imports Microsoft.VisualBasic.Compatibility.VB6 and add the dll (Microsoft.VisualBasic.Compatibility.dll) in your reference.

    To check if your code is working fine in debug mode, set 'PrecompileScriptIntoBinaryCode' to false and from SSIS project properties set 'run64bitruntime' to false

    Thanks

    Sam

  • Hi Sam, thanks for this. I'm going to give it try and will post back.

    Happy New Year!

    Allen

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply