tags:

views:

1759

answers:

3

What is "mexHttpBinding" in WCF? When should this binding be used in preference to other bindings?

+7  A: 

It is a binding that returns metadata so you can build a proxy at the client side. See here. More here as well.

Otávio Décio
So are there two endpoints in a WCF service - the standard one and a metadata endpoint?
CraigS
You can have any number of endpoints for the same contract, among them mexHttpBinding that provides metadata and in most cases is disabled when in production.
Otávio Décio
There can be many different endpoints in a WCF service, with different kinds of bindings and different addresses.
codekaizen
So metadata endpoints are identified by having an address of "mex"?
CraigS
"mex" is short for "metadata exchange"
Travis Heseman
metadata endpoints can have whatever address you give them ("mex", "foo", "bar", etc.) the fact the you assigned them a mex binding is what determines that it's a metadata endpoint
Travis Heseman
@CraigS: the Metadata exchange endpoints are those with a contract of `IMetadataExchange` - that's the ultimate deciding factor. It's a system contract that WCF provides for metadata exchange. The address is totally irrelevant, "mex" is just a commonly used best practice, but not a requirement by any means
marc_s
+3  A: 

mexHTTPBinding allows to use WS-MetadataExchange over HTTP. You don't need it unless you implemented policies which may change over time and you need to discover your service with UDDI for example

Many people says it's needed for creating client side proxies. This is not true. For client side proxies you need to publish WSDL. You can do that by specifying in your service behavior.

Shortly, you don't know it -> you don't need it.

rosencruez
A: 

I am using wsHttpBinding, however I have to specifies this endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" as well to get my service found, otherwise give disco file not found error. Now can anyone elaborate more on mexHttpBinding

My service return list

Shaba