tags:

views:

21

answers:

1

If my WCF Configuration file has two services, lets says LoginService and RegistrationService, do they both have to have their own MetaDataExchange endpoint or can I just have one MetaDataExchange endpoint and keep it outside the service element:

<services>
<service name="a">
<endpoint binding="mexHttpBinding" />
</service>
<service name="b">
<endpoint binding="mexHttpBinding" />
</service>
<services>

Or is this valid as well:

<services>
<service name="a">
</service>
<service name="b">
</service>
<endpoint binding="mexHttpBinding" />
<services>
+2  A: 

The first one.

When you add a service reference, it is for a service not for all services on a server.

Shiraz Bhaiji
When you say service reference, are you referring to the service endpoint? If the MetaDataExchange endpoint is equal, why should I have to specify it twice?
Xaisoft
The web config contains configuration for all services on the web site, in your case there are 2 services. One service could have 2 endpoints say http and https. 2 endpoints in one service would be 1 Metadataexchange endpoint.
Shiraz Bhaiji