Get metadata out of a webHttpBinding endpoint

With a reference to my previous question, I would like to know how would I extract information of a WCF service from a client application to know what methods/types are exposed if the service exposes only one endpoint that uses webHttpBinding?

Just to summarize, in my previous question, I came to know that an endpoint using webHttpBinding does not get exposed in the generated WSDL because it would be a JSON endpoint and is just not compatible.

Answers


WebHttpBinding is a REST-based binding - REST does not expose metadata like WSDL/XSD contrary to SOAP.

There's no way to extract the metadata from a REST endpoint at this time. There are some efforts under way to establish a similar construct for REST called WADL (Web Application Description Language) - but that's nowhere near standardized yet.

For now, with REST endpoints, you have to either figure it out yourself, or you need to have some documentation provided by the service provider on e.g. a static HTML page or something.

.NET 4 does provide some level of an automatically generated help page - see this blog post or the MSDN docs for more info. But it's still nowhere near as formalized and machine-interpretable as WSDL/XSD.


I wonder why the REST samples tell you to expose a MEX endpoint at all. It is not needed and here is how to cleanly remove it:

  1. Remove MEX endpoint from the service section of the config file.

  2. Remove service metadata enabled line in the service behaviour section of the config file.

  3. Edit the Visual Studio project (assuming it's a WCF service library) and remove the line:

    <StartArguments>/client:"WcfTestClient.exe"</StartArguments>

If you have other non-rest services you will want to leave the last 2 parts present. You must remove the WCF Client when disabling MEX otherwise it will complain during debugging if it cannot enumerate any services in the project (regardless whether they have any useful metadata or not).


Need Your Help

how to split up a large text file (one long string) into 50kb text files

python

i have a file "text.txt" that is 1.1MB right now. I want to split it up into 50kb text files.

CakePHP and PHP 5.4 Bult-In Web Server: wrong URL request (404 Error)

php cakephp http-status-code-404

I was testing CakePHP 2.1.2 with the bult-in PHP 5.4 web server and found a problem: I didn't change any .htaccess, but there's wrong URL request, which is causing 404 Error.