I have a WCF service I'm working on that is replacing an older CMS hosting API.
For each client site in the old system/database it works like this:
clientdomain.com pulls its content (XML) from a URL of hostingdomain.com/clientdomain/api.xml (the .xml extension is really a classic ASP page that exports as XML based on the clientdomain)
For example: clientdomain.com/photos feeds from hostingdomain/clientdomain/photos/api.xml
And the same api.xml file is used for all client domains as in hostingdomain/clientdomain2/photos/api.xml, and so on.
I am guessing that in the interface setup like:
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "*clientdomain*/photos")]
//method
List<APIContentObject> GetPhotosBySiteID();
Can/How do I change the clientdomain in URITemplate to feed from a list/array I get from the db?...or something to that effect so it knows /client1/photos and /client2/photos are available as UriTemplates? Or am I missing something?... I'm having trouble with this whole URI/URL thing in WCF...
I could do it a little different and use something like photos.clientdomain.com and add all the domains as host headers and....??.. something along that route? Whatever is best practice and secure in WCF and all that jazz.
The purpose of this is so that eventually the mobile apps and website will both pull from this WCF. (as well as the push/pull administration app that will follow)
The old system used some IIS trickery and classic asp stuff that is pretty interesting and something I'm leaving behind... So... any ideas?