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 7817405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:13:16+00:00 2026-06-02T06:13:16+00:00

trying to add service reference to my windows 8 application. But the asmx file

  • 0

trying to add service reference to my windows 8 application. But the asmx file is inside a folder where logged in users with certain roles can view. Like a protected folder, i’m also using asp.net membership provider for the website. How can I add this reference or authenticate to it?

Thanks.

  • 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-06-02T06:13:18+00:00Added an answer on June 2, 2026 at 6:13 am

    There is a simpler way to authorize your service users, this should resolve some of your issues.

    First, put your service in a public folder, with no authorization at all. This will allow you to add a reference from a windows 8 app with no problems.

    Then, in your service, create a method to authenticate your users:

    public bool Login( string UserName, string Pwd )
    {
        // validate the user and create the forms cookie upon succesfull validaition
        if ( IsValid( UserName, Pwd ) ) 
        {
            FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( ... );
    
            string CookieName = FOrmsAuthentication.FormsCookieName;
            string CookieValue = ticket.Encrypt();
    
            this.Response.Cookies.Add( new HttpCookie( CookieName, CookieValue ) );
        }
    }
    

    This public method will be the first method your Windows 8 app should call.

    Then you protect all other service methods with a PrincipalPermission attribute:

    [PrincipalPermission( Roles="Admin, User" )]
    public TheMethodForAdminOrUser()
    {
        // do whatever you want
    }
    

    Attributes will guard invocation of your service methods so that only users authenticated with the valid call to the Login method will be able to access your service.

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

Sidebar

Related Questions

I'm trying to Add Service Reference to SharePoint web services (e.g., http://cogent-moss/_vti_bin/Webs.asmx ), but
I'm trying to create a Windows Service in VS2010 but can't seem to add
I'm trying to add a service reference to my silverlight project from a file
I have a Windows Service Solution and am trying to add a service reference
I'm trying to build a light-weight SOAP client without using Add Service Reference. Ideally,
I am trying to use a web service (https/ssl/basicHttpBinding). I add service reference without
I'm trying to add a Web Reference to a VS2008 .Net 3.5 Console Application
I get a warning trying to add a Cloud Service Reference from another project
I try to upload a file using asmx service from windows forms. I have
I am trying to add a service reference to my website. When I add

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.