I have couple of question on mex endpoint.
In legacy web services, we create a proxy using wsdl. The WSDL exposes the web service's meta data. In wcf, another term comes that mex endpoint, which also exposes meta data, but wsdl is still alive in wcf. I am new to wcf, and I am confused regarding the difference between wsdl & mex endpoint
?
What is the meaning of httpGetEnabled="false" or httpGetEnabled="true"
?
If I set httpGetEnabled="false"
then what will happen? Does it mean the client will not be able to add service reference from their IDE? But if I set httpGetEnabled="false"
, and saw client can add service reference. What the httpGetEnabled
setting does is very confusing.
One guy said
MEX and WSDL are two different schemes to tell potential clients about the structure of your service. So you can choose to either make your service contracts public as (MEX) or WSDL.
If the above statement is true then tell me when to use MEX & when to use WSDL?
How can I disable mex and expose my service only through WSDL?
WSDL support all bidning like wshttp,wsdualhttp or tcp etc...
If possible please discuss about wsdl & mex in details.
You said
5. How can I disable mex and expose my service only through WSDL?
Do not specifiy a mex endpoint in your config and use httpGetEnabled.
Are you trying to mean that there should be no mex endpoint related entry in config and httpgetenable would look like the following?
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8080/SampleService?wsdl"/>
You said
A WSDL is generally exposed through http or https get urls that you can't really configure (say for security limitations or for backward compatibility). MEX endpoints expose metadata over configurable endpoints, and can use different types of transports, such as TCP or HTTP, and different types of security mechanisms.
You said mex is configurable, but the wsdl is not. What do you mean by mex is configurable
? Please discuss what kind of configuration mex support and how it can be configured.
If I set httpGetEnabled="false" then the WSDL
will not be possible to generate?
1) in legacy web service we create proxy using wsdl. WSDL expose web service meta data. in wcf another term comes that mex endpoint which also expose meta data but wsdl is still live in wcf.i am new in wcf hence i am confusing what is the difference between wsdl & mex endpoint?
It's pretty the same thing but mex is designed to support non-HTTP protocols and for advanced configuration/security scenarios. WSDL is the legacy way and MEX is the new improved version with WCF.
2) what is the meaning of httpGetEnabled="false" or httpGetEnabled="true"
It will expose metadata via wsdl through the defautl url, even if you don't have defined a mex endpoint for your service.
3) if i set httpGetEnabled="false" then what will happen? does it mean that client will not be able to add service reference from IDE? but i set httpGetEnabled="false" and saw client can add service reference. so it is very confusing for me that what httpGetEnabled is false or true does ?
A client can add a reference in VS only if httpGetEnabled/httpsGetEnabled is enable or if you have define a mex endpoint in the configuration of your service. The best practice is to expose metadata on dev environnement but not on production. You can also distribute your service contracts via separate assemblies and use ChannelFactory
.
4) one guy said :- MEX and WSDL are two different schemes to tell potential clients about the structure of your service. So you can choose to either make your service contracts public as (MEX) or WSDL. if the above statement is true then tell me when to use MEX & when to use WSDL?
A WSDL is generally exposed through http or https get urls that you can't really configure (say for security limitations or for backward compatibility). MEX endpoints expose metadata over configurable endpoints, and can use different types of transports, such as TCP or HTTP, and different types of security mechanisms.
So MEX are more configurable, while WSDL is more interoperable with older versions of clients and non-.net clients that work with WSDLs.
5) how could i disable mex and expose my service through only WSDL
Do not specifiy a mex endpoint in your config and use httpGetEnabled
6) WSDL support all bidning like wshttp,wsdualhttp or tcp etc...
Exposing metadata is totally different that invoking the service.
UPDATE
re you try to mean that there should be no mex endpoint related entry in config and httpgetenable would look like
Yes, you don't have to specify a mex endpoint AND httpGetEnabled. Only one is required to expose metadata. Do not specifiy httpGetUrl as this is depending on your hosting environment.
you said mex is configurable but wsdl is not. what r u trying to means mex is configurable...please discuss what kind of configuration mex support & how to configure.
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. HttpGetEnable allow you to expose metadata through HTTP GET method, usually the service’s address with the suffix of ‘?wsdl'
MEX and WSDL both output nearly the same thing.
In most cases there is no need for MEX endpoint – using WSDLs with http get is usually enough.
I understand your intention to understand this part, but do not spend to many times on this : there are so many others complicated features !