Hi,
I'm rewriting an old VBS-script to VB.NET.
The program fetches XML from an .asp page and transformes the data according
to a .xsl file.
To fetch the data in the old program I used the following code:
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.4.0")
'Set the timeouts
oXMLHTTP.setTimeouts toResolve, toConnect, toSend, toReceive
' Use the Microsoft serverXMLHTTP object to retrieve the XML from the
remote server (ReturnXML program)
oXMLHTTP.Open "GET", sURLtoReturnXML & sXMLQuery, false,
"UserName","Password"
oXMLHTTP.Send("")
'The data has been fetched and after that the data will be transformed.
The way I thought of doing it in the new program is as follows:
Dim oXmlDoc As XmlDocument = New XmlDocument
Dim oXSLTransForm As Xsl.XslTransform = New Xsl.XslTransform
Dim oXmlTextWriter As XmlTextWriter = New
XmlTextWriter(sOutputFileName, System.Text.Encoding.UTF8)
oXmlDoc.Load(stCommon_settings.sXMLreturn)
oXSLTransForm.Load(stCommon_settings.sXSLTransform ationFile)
oXSLTransForm.Transform(oXmlDoc, Nothing, oXmlTextWriter, Nothing)
oXmlTextWriter.Close()
It works like a charm locally, but the problem is that on the server I have
to be authenticated like I did in the old example with
MSXML2.ServerXMLHTTP.4.0.
How can I perform this with the new program?
Best regards Dan