Last post Nov 20, 2014 05:38 PM by T.H.Fernando
Nov 19, 2014 10:50 PM|T.H.Fernando|LINK
I have a VS project that consists sorely of asmx pages (yes, I know WCF are better, but my hands are tied on this :( ). This exposes server side functions for our (internal) products. But now I want to expose a subset (and/or generic versions) of these methods
to be publicly consumed. But I do not want to expose the internal methods on the same virtual, nor maintain two separate projects/codebases for it.
What I considered for a solution was to create a sub folder in my project that would hold the new asmx files, and point to this folder with a separate URL that I would distribute out to the public.
Problem is, this approach won't work. The PublicWebServices URL (that points to the sub folder) throws an error "Parser Error Message: Could not create type 'MyNamespace.PublicServices.WebServiceClass'."
which I believe implies that it cannot find the project dll as it sits in the bin folder directly under the project root.
I posted this question previously
here, and was advised by a member (Shawn Zhao) to post it here. I would be much grateful if someone could advise me if there is a way I can get this to work without splitting to a separate project. Or is there a better approach to get the same results?
Nov 20, 2014 09:09 AM|Siva Krishna Macha|LINK
How about creating new asmx file in the root directory and give only this url (new asmx url) to them?
However, I believe, you can't make portion of application for public and portion of application for internal, etc. Probably for website applications, there is a forms authentication. This is where role management comes into picture. In MVC era, we go for
[Authorize(Roles="SpecificRolesHere")] for the methods. You can google and read more about how to do role management for webservices but for this, you would need to start creating infrastructure and design the solution on how you would like to manage roles.
Nov 20, 2014 05:38 PM|T.H.Fernando|LINK
Thanks for the reply Siva.
Problem is, I don't want them stumbling upon the other asmx pages, and some of them need to have the same file name. And role management isn't really an option as the "internal" asmx methods aren't consumed by our company employees - simply just by software
developed internally. This software is also publicly distributed.
I know this is more to web sites than web services, but is there a way for the project dll to be kept in a parent folder for a web site?