473,729 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enabling & disabling of c# web method

Raj
Hi,

I have set of exposed web method (C#, framework). Now set of retailer
uses these methods and they are identified by their retailer ids.

Question is, Is there any way to disable a few methods based on
retailer id? This is required because few methods are not relevant for
some retailer but useful for others.

Help will be highly appreciated.

Thanks in advance to all dudes
-raj

Jan 24 '06 #1
4 2447
Raj wrote:
I have set of exposed web method (C#, framework). Now set of retailer
uses these methods and they are identified by their retailer ids.

Question is, Is there any way to disable a few methods based on
retailer id? This is required because few methods are not relevant for
some retailer but useful for others.

Help will be highly appreciated.


The simplest thing would be to just throw an exception if the method
call is inappropriate. In theory I guess you could have separate WSDL
for each retailer, or split the interface into several interfaces, but
you'd still need to perform the check anyway.

Just document very carefully what's appropriate for each type of
retailer.

Jon

Jan 24 '06 #2
Raj
Hi Jon,

Thanks for spontaneous reply. I have this in mind to throw exception
before actually going to method based on the retailer id, which anyway
i will be getting as part of soap header.

Can anything else be done instead of throwing exception??

thanks
-raj

Jan 24 '06 #3
Raj wrote:
Thanks for spontaneous reply. I have this in mind to throw exception
before actually going to method based on the retailer id, which anyway
i will be getting as part of soap header.

Can anything else be done instead of throwing exception??


Well, what would you want to happen if the "wrong" retailer called the
method? They would certainly be able to create the write soap request -
so what do you want them to see? What do you dislike about throwing an
exception?

Jon

Jan 24 '06 #4
I don't think that this is the best idea, actually. I mean, an
exception, yes, is the right thing to do, but I don't think that he should
be implementing something for himself when there are solutions out of the
box that can help.

At the least, he should have an implementation of IPrincipal which
identifies the caller (after all, there is some sort of authentication on
his part somewhere).

Then, each retailer would be assigned a role. The web method attribute
would also be adorned with a set of PrincipalPermis sion attributes,
indicating the roles that have access to the method. With the right
assignments and attribute settings, the framework could do the checks for
him.

To take this even further, the OP should probably look into the Web
Services Enhancements module from MS:

http://www.microsoft.com/downloads/d...displaylang=en

There is an implementation of WS-Security, which basically does the same
thing, and will provide greater iteroperability with other technologies
which use the WS stack.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Raj wrote:
I have set of exposed web method (C#, framework). Now set of retailer
uses these methods and they are identified by their retailer ids.

Question is, Is there any way to disable a few methods based on
retailer id? This is required because few methods are not relevant for
some retailer but useful for others.

Help will be highly appreciated.


The simplest thing would be to just throw an exception if the method
call is inappropriate. In theory I guess you could have separate WSDL
for each retailer, or split the interface into several interfaces, but
you'd still need to perform the check anyway.

Just document very carefully what's appropriate for each type of
retailer.

Jon

Jan 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2838
by: HumptyDumpty | last post by:
Does anyone know if there is a problem with re-enabling the Screen Saver after it has been disabled programmatically. I am using the SystemParametersInfo function within User32.dll, and have been successful in disabling the Screen Saver, but it does not work for re-enabling. The only way I can re-activate it is to re-apply the settings through the Display properties in the Control Panel. Sample lines of code, in simplest form:
2
1389
by: adeelanjum2001 | last post by:
i am using radiolist box control in my page. when i disable radiolist box when page is displayed first time, that is not ispostback, and when i try to enable it with my javascript code afterwards, it is never enabled. i have searched dozens of site looking for this problem. is there any way around of this problem. thanks in advanced
7
2233
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
7
6992
by: Vignesh | last post by:
I have tab control which has some TabPages. I want to enable or disable the tabpages based on some condition. It is possible to that. Thanks in advance.
2
6312
by: dougawells | last post by:
Hi- I'm wanting to have a set of radio buttons disabled when a form is displayed, then if they check another specific radio button, those would become enabled. I've tried setting it via window.document.formname.radiogroup.disabled="true"; (or false) - but that doesn't seem to work. I've seen this done with text boxes, but not with radio buttons. Can anyone give any help? Thanks
12
6179
by: PMA | last post by:
Hi all, I am porting a web application from IE 6.0 to FireFox 1.5. I have solved almost all compatibility issues (quite a lot but not too bad) except two of them : 1) Clipboard access thru' JavaScript (programmatical copy and paste actions) 2) Monitoring and driving Insert/Overwrite mode on input fields
12
10112
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
3
3970
by: Donald A. Fisher | last post by:
Hello. I've been working a vb project and have a form with a button on it that performs some actions after disabling the button when clicked: Code disabling button and starting actions: Private Sub btnCreateExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateExcel.Click Me.btnCreateExcel.Enabled = False Dim pCreateExcel As New ClassCreateExcel AddHandler pCreateExcel.CreateExcelCompleted, AddressOf...
0
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.