.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WCF - How do I hide service operations from specific clients?

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :WCF


I'm doing my final project and I've run into a problem. I have a WCF service, which distributes 10 service operations. One of the service operations should be hidden from all clients, except a specific one. How do I go about solving this problem? I could 1 implement some sort of password mechanism, where you have to send a password in the argument of the service operation. I could also make a new service just for that client... Any ideas?

View Complete Post

More Related Resource Links

Service Station: Building RESTful Clients


This column how to build clients applications based on the REST architecture using HTTP AP1s. The article describes how to address the question of autogenerated types and code.

Jon Flanders

MSDN Magazine October 2009

Hide data for specific column from a user

Greetings, I have a problem. I would like to restrict showing specific users (or roles or schemas) data in a column. First I thought DENY option will do it but figured out that it won't. DENY denies the column being in the SELECT query. I would still like to call the column but if access to the data in that column is restricted it would show only null values and not the real ones. So... I would like call the next query from user TestUser: SELECT ID,Name,Address FROM Employee But if access to Address is restricted for TestUser I would get results like: ID Name Address 1 John Smith NULL 2 Rick Ross NULL ... Is it possible to do something like that in SQL Server 2005/2008? I was thinking of storing that kind of information in a table (for which tables, which columns for which users access is restricted) and then manipulate it on the application site but my programmers tell me that they use components which always call the full table (like SELECT *).  Thank you for your answer.

Duplex communication and calling clients from outside the hosted service

Hey,   I am currently building an interface between two applications: One that hosts a WCF service and receives external input (e.g. from a sensory system) and another which subscribes to updates sent by the first.   It is quite easy to call back to the client if I create a ServiceHost and provide it with an instance of my service (using ServiceHost.SingletonInstance). However, if I use a PerSession instance mode, how is it possible to call the clients when I receive an updated from the external sensory system?   Thank you for your time!   Cheers, Till

Exposing WCF Service for multiple clients with the feature of multiple database support

i have ceated a WCF service and hosted it properly. now i want to Exposing this Service for multiple clients with the feature of multiple database support.In this functionality how could i do the proper multiple database management. what i am doing now:1. i am taking database string from the client.2. Then setting the refference of above provided database to the all functions call.ISSUE: if the mulitple clients calling the service at the same time and both are giving different database string then the database string provided by the clients is overlapping.....

Sesame: Spatial OData on Maps, Service Operations, HTTP Basic Authentication

Sesame Data Browser has just been updated to offer the following features for OData feeds: MapsImproved Service operations (FunctionImport) supportHTTP Basic Authentication supportMicrosoft Dallas support Maps Sesame now automatically displays items on a map if spatial information is available in data.This works when latitude and longitude pairs are provided.Here is for example a map of drinking fountains in Vancouver:This comes from DrinkingFountains in http://vancouverdataservice.cloudapp.net/v1/vancouver, which provides latitude/longitude for each fountain. Here is another example, without latitude/longitude this time: This is a map of the customers from the Northwind database, which are located based on their country, postal code, city, and street address. Service operations (FunctionImport) Support for service operations (aka FunctionImports) has been improved. Until now, only functions without parameters were supported. It's now possible to use service operations that take input parameters. Let's take as an example the GetProductsByRating function from http://services.odata.org/OData/OData.svc.This function is attached to Products, as you can see below: A "rating" parameter is expected in order to open the function: After clicking Open, you'll get data as usual:HTTP Basic Authentication New authentication options have been added: HTTP Basic and Dallas (more

Validate available operations on workflow service

I'd like to check if i can invoke an operation on workflow service so i could disable action buttons on my UI. Is it possible? If I invoke operation which isn't right at that moment I get exception: "Operation cannot be performed at this time. Please ensure that the operations are performed in the correct order and that the binding in use provides ordered delivery guarantees." And i would like to avoid theses kind of messages by validating before invoking. udione

Call specific web service method by matching string value to method name?

I am getting a value in string format.  Then, I call a web service and try to dynamically call the method that corresponds to the string's value.  It doesn't work.  Any ideas?              Dim methodname As String = "getquotes"                 Dim track As localhost.Tracker = New localhost.Tracker()                 'the below line is where it fails                 track.methodname(parameter)               

Hide Site Actions menu for few groups on a specific aspx page.


Hi All Gurus,

I am facing a issue. I want to hide the site actions menu to few groups, which have high level permission on other pages but they dont need to access "site actions" link on only this page.

Can some one tell me a why using Javascript or some quci fix for this in SPD level.

Pls looking forward for your help...

Happy Sharepointing..


service pack 3 upgrade deployment on a specific instance possible and wise?


Hi All,

I'm running a SQL Server 2005 SP2 test server with two instances, both with service pack 2.

If I would like to test service pack 3, would it be possible or wise to upgrade one of the instances to service pack 3 for testing purposes (i will restore production data on top of it)?

Best regards

Business Intelligence professional

Best practice for WCF service exposing multiple client-specific endpoints?


Moving forward with re-designing a web service architecture using WCF, our team has been discussing how we want to expose the endpoints. Example: I have a standard endpoint that all users could use with the proper token, but I also have some number of endpoints that will instead use certificate security. All endpoints will ultimately use the same implementation, so this is really just different ways of getting in to the system.

The certificate endpoints will have to point to a specific certificate in the store so will only work for one specific client. The thought is that our standard service could live at http://mysite.com/MyService.svc and the certificate endpoints would be something like http://mysite.com/MyService.svc/Acme. The concern here is that I'm effectively putting our client list into our WSDL, which is not desirable.

What's the best practice here? Is there a way to direct multiple clients through a single certificate endpoint and get the cert on the code side (how would we know which client we're dealing with without a sp

Get clients public IP NOT local IP from a WCF Service

Does anyone know how to get the clients public IP from a WCF service. To get the local IP I did the following:

public string GetLocalIPAndPort()
      OperationContext context = OperationContext.Current;
      MessageProperties messageProperties = context.IncomingMessageProperties;
      RemoteEndpointMessageProperty endpoint = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

      return endpoint.Address + ':' + endpoint.Port;

But I want the real IP

WCF Service for Java clients


I'm developing WCF service that looks like will be used by Java clients. Message will be signed by certificate.

Expected request looks like:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity- secext-1.0.xsd"
   <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
     <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
     <ds:Reference URI="#body">
       <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
      <ds:DigestValue>[body digest value]</ds:DigestValue>

Run Service wsDualHttpBinding with Callback and Clients without


It is possible to run a service wsDualHttpBinding with Callback and configure Clients without a call back(e.g wsHttpBinding) and without the callback contract.

The scenario is to have a callback host and both clients can connect with and without callback.



if (callback)


CallbackHandler myCallBack = new CallbackHandler();

DuplexChannelFactory<ICalculatorDuplex> channel

Possible to get Multiple Operations (workflows) on one service?



I'd like to get something like this:


with multiple operations:

Workflow1(), Workflow2(), etc

So that in the client, the code would look something like this:

var proxy = new ServiceReference1.ServiceClient();

var data1 = proxy.Workflow1();

var data2 = proxy.Workflow2();

Is that possible?  Advisable??  How do I go about this if it is possible and advisable??

I'm setting up my services in code like this currently, but can't get more than 1 operation on a service:



                 string baseAddress = "http://localhost:8082/";

                 Uri address = null;

                 Activity workflow = null;

                 WorkflowServiceHost host = null;

                 address = new Uri(baseAddress + "MyService");

                 workflow = new Workflow1();


Best way to "ensure" that an ASMX web service is only called from AJAX on a specific ASPX page


I have an ASPX page which hosts a Custom Control.  That custom control needs to call an ASMX web service.  I would use a PageMethod, if the fact that I'm calling from within a Custom Control didn't preclude that. 

I'm looking for some guidance on the most effective way to try and lock down the ASMX call such that it will only succeed for my users calling it from my ASPX page - and not for anyone trying to call it from elsewhere.  I've seen various ideas around session variables and so on.

What's the expert view, please?

Can Windows Service handle Data Staging and load operations?



I am developing an application which requires data staging, WCF module to consume web service app and data loading Module. The data staging module will work with SSIS package and data load module will use Stored Procedures and WCF module which will consume web service and send data from the staged tables.

All these modules will be part of single application which will be configured as a Windows Service at the server end. Development platform: VS2010,C#4.0

Given that, can Windows service handle all the above operations? How can I use error handling effectively? Since this is a background process, I need very good error and trace handling routines.

Appreciate any inputs or references on these. 




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend