Thomas
Thomas

Reputation: 34208

regarding mex endpoints in wcf

here is one sample of mex endpoints

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

but i have seen people write mex endpoints like

<endpoint address="net.tcp://localhost:1645/ChatServer/mex"
                      binding="mexTcpBinding"
                      contract="IMetadataExchange"/>

so tell me why and when one should write mex endpoint like above one. just compare my two endpoints and see the difference that first one address attribute has the word called "mex" but second one has url.

so my question is "when people has to give a url to address attribute of mex endpoints?".

Another question is "Does mex address url always should have /mex word at the end of url?". if i give url like net.tcp://localhost:1645/ChatServer/ or net.tcp://localhost:1645/ChatServer without mex word then service will not be discoverable?

what is the significiant of /mex word??

Upvotes: 0

Views: 1411

Answers (1)

Paritosh
Paritosh

Reputation: 2379

the first one will expose metadata over http and second one will do it over the TCP . It is used to support the platforms, WCF is made for supporting multiple platform.

you can make any url to expose metadata. it is not necessary to follow the convention above. mex is just more good practice to make it metadata just same like url+mex .

here is an url which will give an overview

http://www.danrigsby.com/blog/index.php/2008/05/27/wcf-metadata/

Upvotes: 1

Related Questions