General - .NET User Groups General issues with editing, development and graphic design.
Kentico CMS for .NET User Groups > General - .NET User Groups > Getting a SiteCode from within a webservice View modes: 
User avatar
Member
Member
support-schepnet - 5/8/2009 9:01:12 AM
   
Getting a SiteCode from within a webservice
Hello,

I have a site running in the KenticoCMS for example www.mykenticosite.com, from this URL I am calling a (custom) Web Service in the KenticoCMS source. Is it possible to retrieve the siteCodeName in the Web Service?
The Web Service I build is for inserting a BizForm from a flash application, for this I need a SiteCode and a BizForm name. For security purposes I don't want to pass both variables through to the Web Service and I want to be sure the request is from the correct site.

Thanks in advance,

Remy Bakker

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/12/2009 8:46:24 AM
   
RE:Getting a SiteCode from within a webservice
Hi,

You can get the site name by domain. In the code you can get the domain name and according to it you can set the site name. Another option is to use our API and for example you can use this property: CMS.CMSHelper.CMSContext.CurrentSiteName

Best Regards,
Juraj Ondrus