views:

89

answers:

1

What is the purpose of IMetadataExchange endpoint. Some places i found that if i dont define this endpoint, adding service reference will not work OR creating proxy using svcutil wont work. But both of this working without having IMetadataExchange defined.

If we have other endpoint with httpGetEnabled = true, we are able to create proxy from client.

Also, some article says that we should delete IMetadataExchange before moving code to production and it should development period only so that other client cant see metadata. Doesnt this stop the behaviour of service having self describing itself?

And if I have defined this IMetadataExchange endpoint, how can i see that on browser. Address whoch i have provided for this endpoint is not pulling any metadata in browser.

A: 

Service metadata can be served two ways:

  1. Regular WSDL served over HTTP/HTTPS, which is what that http[s]GetEnabled=true enables.
  2. WS-MetadataExchange (MEX) which uses SOAP (and not just a plain GET request over HTTP) and supports a few more advanced scenarios (in theory, at least). That's what the IMetadataExchange endpoint enables.
tomasr
Can I view the metadata served by MEX in browser?
Paresh.Bijvani
Nope. It's SOAP, not REST-style like regular WSDL over HTTP. You need to send a SOAP request to that endpoint to get the data back.
tomasr