Technical support This forum is closed.
Version 1.x > Technical support > storing and getting username / password from the web.config View modes: 
User avatar
Member
Member
felixkentico - 3/22/2006 10:31:28 AM
   
storing and getting username / password from the web.config
for the build in web service I need to set a username and password. I would like to assign the username/password for this service globally in the web.config. How can I store the username and password there and receive it via the GetData method?


This is the code I use yet:

'GetData
sXMLUnit = wsDistributionDataRetriever.GetData("Myusername", "Mypassword", "action=GetUnit&code=" + sUnitCode + "&lang=" & Language)
xmlUnitDoc.LoadXml(sXMLUnit)


User avatar
Guest
admin - 3/23/2006 2:12:18 PM
   
Re: storing and getting username / password from the web.config
Hello,

the user name and passowrd for the SyncWebService must be stored in the web.config file, in the following parameters:

CMSStagingServiceUsername
CMSStagingServicePassword

You can then retrieve them using ConfigurationManager.AppSettings["CMSStagingServiceUsername"].

Best Regards,

User avatar
Guest
felixKentico - 3/23/2006 7:31:14 PM
   
Re: storing and getting username / password from the web.config
Thanks Petr, works excellent!