What was the difference between WSDL & Mex Endpoint in WCF

39,767

Solution 1

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 !

Solution 2

MEX endpoints are special endpoints that allow clients to receive the service’s metadata by using SOAP messages instead of only http get requests(ie httpGetEnabled="true"). 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.

Share:
39,767
Thomas
Author by

Thomas

i am developer. i am working with .Net technology (v1.1 & v2.0) last 4 year. i like this forum for fast & good response and that is why i joined this forum. my friends profile id Mou :- http://stackoverflow.com/users/728750/user728750?tab=questions and Keith :- http://stackoverflow.com/users/750398/keith-costa thanks

Updated on July 09, 2022

Comments

  • Thomas
    Thomas almost 2 years

    I have couple of question on mex endpoint.

    1. 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?

    2. What is the meaning of httpGetEnabled="false" or httpGetEnabled="true"?

    3. 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.

    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?

    1. How can I disable mex and expose my service only through WSDL?

    2. WSDL support all bidning like wshttp,wsdualhttp or tcp etc... If possible please discuss about wsdl & mex in details.

    UPDATE

    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?

  • Thomas
    Thomas over 10 years
    i update my question after reading your answer. few confusion arise...so please have a look at my updated portion and give your feedback accordingly. thanks
  • Thomas
    Thomas over 10 years
    thanks for reply. u said :- Do not specifiy httpGetUrl as this is depending on your hosting environment...what would be the problem if i specify httpGetUrl. why u r saying Do not specifiy httpGetUrl? please explain. thanks
  • Thomas
    Thomas over 10 years
    by default data transfer in xml mode in wcf or binary? can u give me brief about what kind of data transfer for each type binding like http,tcp,msmq,net-pipe etc?
  • foldinglettuce
    foldinglettuce over 9 years
    Here is a good blog post about the same stuff... blogs.microsoft.co.il/idof/2011/08/10/…
  • KumarHarsh
    KumarHarsh over 9 years
    gr8 @Cybermaxs !! Can you list those complicated features ?
  • Thomas
    Thomas over 9 years
    confusion: u said "MEX allow clients to receive the service’s metadata by using SOAP messages instead of http get requests" again u said "MEX endpoint that can be accessed through http, https," what u try to say....not clear.
  • Taran
    Taran over 9 years
    Hi Thomas by that i meant only http..Thanks for pointing I updated it