Last post Oct 06, 2014 08:55 AM by mou_inn
Oct 01, 2014 06:08 AM|mou_inn|LINK
say for i have one service class in code and one contract in code so then can we have multiple service tag in config file which will point my single service & contract.
here i am giving a code just to explain well what i am trying to achieve.
public interface IEmp
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class BusinessLayer : IEmp
public string GetEmp()
Config code at service end
<endpoint address="CustomerFactory" binding="basicHttpBinding"
contract="CustomService.IEmp" listenUriMode="Explicit" />
<endpoint binding="basicHttpBinding" bindingConfiguration="HTTPBindingConfig"
name="CustomerMasterHTTP2" bindingName="CustomerMaster" contract="CustomService.IEmp" />
just tell me the above config will work?
in the above config i define two service tag with same name because my service full name with namespace is
is it ok or do i need to give unique name for each service tag?
my intention is i will have same service but with multiple service tag and when customer will add my service ref at their end from VS IDE then they will not be able to see all my service endpoint.
my intention is not expose all endpoint & address to every client.
so guide me what i have done does it work or not....if not then rectify my config entry and tell me how could i restrict my endpoint not to expose each binding & address before all client.
just see this config entry
can we give any name to service ? or is it mandatory to give the name of my service class including namespace ? please discuss with sample code and config entry. thanks
Oct 06, 2014 04:14 AM|Shawn - MSFT|LINK
First of all, the service name must be the fully qualified name of your service class, including the namespace:
It can't be just anything - the name of the service class is used by ServiceHost to find the right service configuration.
Besides, it would not exist the same service name within the services tag, each service name would be unique.
Oct 06, 2014 08:55 AM|mou_inn|LINK
i understand you said. so guide me how to handle my situation without writing two service having same functionality. any idea?