473,385 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to Hide Web Methods in ASMX web service?

2
Does anyone know if it is possible to have a web service whose methods are hidden/visible according to some programatic critera e.g.

if (x=1) Expose Methods 1, 2, 3

if (x=2) Expose Methods 2,3

if (x=3) Expose Method 3

I know .NET allows conditional compilation using conditional attributes but this responds to whether something is #define'd doesnt it? So I dont think this would be suitable. I need something that reacts at runtime to a value derrived from a database.

Or would the only way to do it be to use inheritance?
Sep 3 '07 #1
1 4565
You can add a Application_BeginRequest handler to the global handler, lookup the name of the web method based on the URL and cause the call to fail if you don't find the right setting in the database.

This requires a database lookup everytime. Another possibility is to add an Application_Start handler, spin through the database and build a collection of valid methods in the application cache, and then check the cached collection in Application_BeginRequest. However, then you need a mechanism to trigger a reload of the methods when the database changes.

You can do either of these things in an HttpModule as well.
Sep 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Dillon | last post by:
I'm using the webservice I've created: http://www.emergencyreporting.com/ERSWebService/ERSDispatch.asmx When building a client VB.NET app, and adding a web reference to the above file, I see...
6
by: seeIT | last post by:
In a client application a simple webservice (add/multiply) was added to solution panel but proxy methods do not appear. WSDL description in solution panel follows: <?xml version="1.0"...
3
by: SAL | last post by:
I’m fairly new to .NET. I’ve been developing in .NET for about 6 months. I have over 10 years experience with VB in general. Here’s what I have done so far: 1. Project is entirely .NET...
5
by: SenthilVel | last post by:
Hi Can any one let me know how i can perform a Asychronous calll in a web service ? or using a thread in Asmx a better solution than the async call ? pls send me any link to example, where...
3
by: John K | last post by:
How do you hide the available functions (and syntax) that are normally displayed when you browse to a webservice (e.g. httpx://xxx.com/CMgr.asmx)? If you go to that page you will see a list of...
2
by: Mongkon | last post by:
I use Visual studio.net 2003 for develop a web application by communicate with Web service (it has been developed by Java) and I has added web reference but It can’t to and show error message...
6
by: axel22 | last post by:
I've made a web service in c# and published it with IIS. I can access it's methods locally, but when a colleague tried to access the Web Service over the Internet using my IP address, he...
10
by: roberto | last post by:
I'm to deploy a .NET DLL which internally communicates with the WS. I don't want others to see internal complexity of the web service classes generated by "Add a Web reference" VS option. As a...
2
by: jparulan | last post by:
Hi All, I am developing web service that does not use IIS, I was successful on deploying a normal web service with System.Data and System.Web namespaces. BUT when I added the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.