Last post Apr 02, 2015 03:27 AM by sudip_inn
Mar 31, 2015 07:55 AM|sudip_inn|LINK
i often saw people design their web service with both httpGetEnabled and Mex Endpoint but i do not know like
1) why mex endpoint is require ? what it does ? if we omit mex endpoint then what will occur ? if i omit mex endpoint then any .net application or java application could call my web service? help me the real usage of mex endpoint like when it is required
and when not ?
2) what is httpGetEnabled
if i omit httpGetEnabled then any .net application or java application could call my web service?
any .net client can add web reference of my web service if httpGetEnabled is set false of does not exist? what is the default value of httpGetEnabled ?
what httpGetEnabled does ? please explain the usage httpGetEnabled with example or scenario.
Mar 31, 2015 10:57 PM|Shawn - MSFT|LINK
There're 2 ways to expose metadata:
One with MEX endpoint and one with <serviceMetadata httpGetEnabled="true" />. The first one will expose metadata using WS-MetadataExchange and second one will use WSDL.
The Metadata Exchange Endpoint (MEX) is a special endpoint in WCF that exposes metadata used to describe a service. Depending upon our binding, the corresponding MEX binding will vary. There is support for HTTP, TCP, and Named Pipes.
MEX and WSDL are two different schemes to tell potential clients about the structure of your service.
So we can choose to either make the service contracts public as "metadata exchance format" (MEX) or in the "web service description language" (WSDL) -- the latter being accessible via HTTP(s).
The httpGetEnabled configuration lets us set an http endpoint that would allow a non-mex proxy to be generated using WSDL, such as a legacy .NET webservice proxy.
For more information, you could refer to:
Apr 01, 2015 03:53 AM|sudip_inn|LINK
i like to know suppose if my service has no mex endpoint then what will happen? other .net and java client will not be able to create proxy for my web service if this exist
<serviceMetadata httpGetEnabled="true" />.
i guess if mex is off then a proxy can not be created for tcp binding? if mex is off then tell me name of those bindings for which client can not create proxy ?
u said "MEX and WSDL are two different schemes to tell potential clients about the structure of your service."
i like to know in details that what is the difference between MEX and WSDL ?
if only httpGetEnabled is true then which bindings will work only ?
Apr 01, 2015 09:35 PM|Shawn - MSFT|LINK
For this situation, about the difference between getting the service’s metadata by using the WSDL’s http get url, and getting the metadata by calling the MEX endpoint, we first need to understand the different parts of the configuration that affect metadata
The ServiceMetadata behavior
This behavior controls whether metadata is created for the service. When this behavior is used, the service is scanned, and metadata is created for the service’s contracts (a list of operations and types exposed by the service).
If the behavior is not used, no metadata will be created for the service, and you will not be able to create MEX endpoints.
The ServiceMetadata’s httpGetEnabled flag
This flag defines whether the metadata will be accessible by an http get request. If this attribute is set to true, then a default url will be created for the metadata (usually the service’s address with the suffix of ‘?wsdl’). The url will lead you to
a WSDL file containing the description of the service operations, but without the description of the data contracts – these files are accessible by different urls, usually the service’s url with the suffix of ‘?xsd=xsdN’. The list of these urls are pointed
out from the WSDL file.
If you do not set this attribute to true, you will not be able to access the metadata using http get requests. If you prefer using https for the get requests, you can use the
httpsGetEnabled attribute instead of the httpGetEnabled.
There are several other settings for the get options – you can read more about them on
The MEX endpoint
MEX endpoints are special endpoints that allow clients to receive the service’s metadata by using SOAP messages instead of http get requests. You can create MEX endpoint that can be accessed through http, https, tcp, and even named pipes.
The response that you will receive when calling a MEX endpoint’s GetMetadata operation will include the content of the WSDL and all the XSD files that are linked to it.
For more detailed information:
Apr 02, 2015 03:27 AM|sudip_inn|LINK
so i understood from your explanation that if no mex endpoint is there and if my service has different binding like http, https, tcp, and named pipes etc then client will not be able to create proxy on those bindings.........am i right ?
i like to know that if my service has only tcp binding but no mex endpoint defined then how client can create proxy for tcp bindings ? tell me actually what will happen in this circumstances ?