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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:24:33+00:00 2026-05-12T07:24:33+00:00

If i am hosting a WCF service so that someone(i.e someone whom i know)

  • 0

If i am hosting a WCF service so that someone(i.e someone whom i know) can consume my service, but what if someone else(i.e someone whom i don’t know) consumes it then would do i? How do i prevent that?How can this be achieved?

Can it be done through service throttling or what are the other ways of achieving this?

  • 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-12T07:24:33+00:00Added an answer on May 12, 2026 at 7:24 am

    No, there’s no mechanism in WCF to allow certain clients from using your service while prohibiting others. You’ll need to approach this from a different angle.

    One way is to not automatically publish your metadata from your service – e.g. make it almost “invisible” – and then distribute the necessary metadata information in the form of one or several WSDL and one or several XSD files to those clients you want to connect to your service. If your metadata is not available, someone just browsing to your service address will not get any information about what to call.

    The metadata exchange is controlled by the <serviceMetadata> behavior, and by having a “mex” endpoint on your service. Remove both and your service is invisible.

    The other way would be to prohibit any external users to access your WCF server based on firewalls and network rules. This cannot be done by WCF, but your network administrator could limit which IP’s have physical access to the machine where your WCF service runs.

    Marc

    UPDATE:
    In order to ship metadata to those users who should be able to call your service, you can do one of two things:

    1) Using svcutil.exe /t:metadata (path+name of your service assembly), you can extract the metadata from your service assembly (e.g. MyServiceLibrary.dll). This will give you one or several WSDL and one or several XSD files, which you need to ship to your intended users. They can put these files somewhere on their harddisk and then in the “Add Service Reference”, instead of entering the URL to discover the service, they can type in the name of the main WSDL (which imports all other files) and they’ll get their client proxy.

    Or:

    2) With the service up and running, you could “Add New Project” to your solution, choose a Class Library (MyService.Client), then do a “Add Service Reference” and enter your service URL. This will create all the necessary files and everything in your new class library. Compile this class library and ship that assembly MyService.Client.dll to the users you want to allow access to your service.

    With both solutions, you don’t need to have metadata exchange enabled, and someone else cannot just walk up to your service and get all the information needed in order to call it.

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

Sidebar

Related Questions

I have six wcf services that I'm hosting in a windows service. Everything works
I've got a WCF service that I'm hosting in IIS 7, which I connect
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
I have written a WCF service that I am hosting in IIS7 as a
I have a WCF service that I am deploying in a shared hosting environment.
I have a WCF service (MyService.svc) that im hosting under IIS 7.5. My .svc
I have a Windows Service that is self hosting a Wcf service, this Wcf
I have a WCF web service that I am hosting in IIS (actually running
We have an windows service written in .net, that is hosting WCF service. My
We have a windows service that is self-hosting a WCF Data Service, using the

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.