Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7195825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:39:27+00:00 2026-05-28T20:39:27+00:00

Trying to simply grab an XML file and spit its contents through an API

  • 0

Trying to simply grab an XML file and spit its contents through an API onto a website. This worked in the past and am now revisiting its code. I am receiving the error:

Public member ‘OpenAsTextStream’ on type ‘FileSystemObject’ not found.

Here is all of code:

    <%@ Page Title="MAIN" Language="vb" Explicit="true" AspCompat="true" %>

<% 

    Dim objFSO, objStream, ProductStr, ProdCodestr, ProdPricestr, xml_to_send, x
    x = 1

    objFSO = Server.CreateObject("Scripting.FileSystemObject")

    Dim Filepath
    Filepath = Server.MapPath("sample.xml")       

    objStream = objFSO.OpenAsTextStream(1, -2)
    Do Until objStream.AtEndOfStream

        ' create the Xml that the Msxml2.serverXmlHttp object will send to the Webservice
        ProductStr = objStream.readline(x)
        ProdCodestr = ProductStr.substr(0, ",")
        ProdPricestr = ProductStr.substr(",", )
        xml_to_send = "<?xml version=""1.0"" encoding=""utf-8"" ?>"
        Xml_to_Send = Xml_to_Send & "<xmldata>"
        Xml_to_Send = Xml_to_Send & "     <products>"
        xml_to_send = xml_to_send & "          <ProductCode>" & ProdCodestr & "</ProductCode>"
        xml_to_send = xml_to_send & "          <ProductPrice>" & ProdPricestr & "</ProductPrice>"
        xml_to_send = xml_to_send & "     </products>"
        xml_to_send = xml_to_send & "</xmldata>"

        x = x + 1
    Loop
    objStream.Close()
    objStream = Nothing
    objFSO = Nothing

    ' create the Msxml2.serverXmlHttp object needed to post the Xml to the WebService
    Dim oXMLHttp
    oXMLHttp = Server.CreateObject("Msxml2.serverXmlHttp")
    oXMLHttp.open("POST", "http://www.mywebsite.com/net/WebService.aspx?Login=my@email.com&EncryptedPassword=xxx&Import=Update", False)
    oXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
    oXMLHttp.setRequestHeader("Content-Action", "xmldata")
    oXMLHttp.setTimeouts(100000, 100000, 600000, 9999999)
    Server.ScriptTimeout = 10800

    ' Send the Xml  
    oXMLHttp.Send()

    ' Receive the Xml
    Dim Xml_Returned
    Xml_Returned = oXMLHttp.responseText

    ' Validate the Xml
    Dim xmlDoc
    xmlDoc = Server.CreateObject("Msxml2.DOMDocument")
    xmlDoc.loadXML(Xml_Returned)
    If (Len(xmlDoc.text) = 0) Then
        Xml_Returned = ("<B>ERROR in Response xml:<BR>ERROR DETAILS:</B><BR><HR><BR>") & Xml_Returned
    End If

    ' Display the Xml on the browser
    Response.Write(Xml_Returned)

    ' clean up
    xml_to_send = Nothing
    oXMLHttp = Nothing
    Xml_Returned = Nothing
    xmlDoc = Nothing
%>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:39:28+00:00Added an answer on May 28, 2026 at 8:39 pm

    Try OpenTextFile. BTW, the first parameter is the filename.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to grab an xml node by its attribute. edit I'm trying to
I'm trying to simply save a file. However, I need a filename entered without
I'm trying to simply test my RESTful API with cURL. Using the following invocation:
Is there a better way than simply trying to open the file? int exists(const
I've been racking my brains on this for a while, I'm simply trying to
I'm trying to write a simple server that will grab an mp3 file from
Im trying to grab value from label checkbox:checked. I have created this function var
1 <span class='Txt9Gray'>Decisions ( </span> I'm trying to grab the 1 from this string.
I'm trying to grab the number of errors from a HTML log file. Here's
I'm simply trying to create a UML diagram where I can show the header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.