Reputation: 38228
I'd like to understand the fundamental mechanism : as far as I know .net parse the wsdl (using ServiceDescription class) and generate proxy classes that will make the call.
But how are these proxy classes generated ? Through CodeDom or something else ?
Upvotes: 1
Views: 292
Reputation: 4360
I decompiled wsdl.exe with dotPeek and as far as I understand it uses CodeDomProvider for code generation. This is how GenerateCode
method's signature looks like.
private void GenerateCode(DiscoveryClientDocumentCollection[] documents,
CodeDomProvider codeProvider, WsdlParameters parameters, string outputFileName)
{
...
}
Upvotes: 1
Reputation: 35925
Proxy classes are generated from the metadata. Usually a service would expose it's public contract and a metadata contract.
In a WCF service the metadata would be exposed with something like
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
You can read more about metadata standard here, and WCF import-export metadata docs.
If no metadata contract is exposed, you cannot generate proxies.
Upvotes: 1