user310291
user310291

Reputation: 38228

How does .net internally call wsdl webservice method?

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

Answers (2)

adt
adt

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

oleksii
oleksii

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

Related Questions