Forum Moderators: open
I am trying to read the web.config through vbscript and trying edit the values of the web.config through vbscript again, but I am not to read and write the values, below is the piece of code, can some one please help
Thank you
Sathish Kumar D
X = MsgBox(" Do you want to update the current version of Portfolio in XLeRate?",vbYesNo)
If X = vbYes Then
XLeRateVersionNO = InputBox("Enter the XLeRate Version no. in which you want to update the Portfolio version")
ConfigFilePath = ServerPath1 & "\PricingSystme\XLeRate\"& XLeRateVersionNo &"\XLeRateServer\web.config"
LogToFile(ServerPath1 & "\PricingSystme\XLeRate\"& XLeRateVersionNo &"\XLeRateServer\web.config")
Set objXML = CreateObject("MSXML2.DOMDocument")
objXML.Async = False
objXML.Load(ConfigFilePath)
Set node = objXML.documentElement.selectSingleNode("/configuration/WCFServiceClient/ApplicationInformation/Applications/Application/Environments/Environment/Address")
' If node is nothing Then
' LogToFile("PortfolioService does not exist")
' Else
node = PortfolioURL
'End If
objXML.Save ServerPath1 & "\PricingSystme\XLeRate\"& XLeRateVersionNo &"\XLeRateServer\web.config"
Else
LogToFile("We are not updating the RefData with new Portfolio Version")
End if
End if
And welcome to WebmasterWorld.
[Code below]
If node is nothing Then
'Do Nothing Node Doesn't Exist
Else
'Replace node with updated Node Information.
'
'Update Node Code Goes Here
'Only need to save it if there is a change I assume.
objXML.Save ServerPath1 & "\PricingSystme\XLeRate\"& XLeRateVersionNo &"\XLeRateServer\web.config"
End If