Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6543457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:20:55+00:00 2026-05-25T11:20:55+00:00

[WebService(Namespace = http://service.site.com/service/news)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] [ScriptService] public class NewsService : System.Web.Services.WebService {

  • 0
[WebService(Namespace = "http://service.site.com/service/news")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public class NewsService : System.Web.Services.WebService
{
    [WebMethod]
    [ScriptMethod]
    public void DoPost(string title, string markdown, int categoryId)
    {
        if (!MembershipHelper.IsAtLeast(RoleName.Administrator))
            throw new AuthenticationException();

        // ...
    }
}

There are quite a few options available but none seem to be particularly designed for cases like this.

i.e:

  • UnauthorizedAccessException: I/O
  • AccessViolationException: Memory stuff
  • SecurityAccessDeniedException: Represents the security exception that is thrown when a security authorization request fails.

etc.

Should I create my own type of exception for this? What exception should be raised when membership users don’t have enough priviledges to invoke a method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:20:56+00:00Added an answer on May 25, 2026 at 11:20 am

    AccessViolationException is a bad idea. It should only be thrown by the runtime itself. And it indicates a very severe failure(Your memory got corrupted) where the only appropriate response is terminating the process. An invalid web request is certainly not equivalent to corrupted memory.

    UnauthorizedAccessException sounds like a decent choice. You might want to derive your own class from it to create a more specific exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a WebService like this: [WebService(Namespace = http://ns)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class
I wrote the following service : namespace WebService1 { [WebService(Namespace = http://tempuri.org/)] [WebServiceBinding(ConformsTo =
I have an ASP.NET webservice with along the lines of: [WebService(Namespace = http://internalservice.net/messageprocessing)] [WebServiceBinding(ConformsTo
I have got a web service programmed in c# / asp.net. [WebService(Namespace = http://example.com/)]
I have this web service : using System.Web.Services; namespace Contracts { [WebService(Namespace = http://tempuri.org/)]
meaning is there a difference between <WebService(Namespace:=http://theurl.com/)> and <WebService(Namespace:=http://www.theurl.com/)> ?
I have the following web service that allows me uploading files: [WebService(Namespace = http://tempuri.org/)]
while trying to generate a proxy from this WebService (http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl) I'm receiving this error
I have written an ASMX service that looks like thus; namespace AtomicService { [WebService(Namespace
Why does tempuri.org exist? Why does each XML Webservice require its own namespace, unique

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.