locked
SvcUtil, what's behind the scene? Code generation classes... RRS feed

  • Question

  • Hi,

     I got a proxy generator for Silverlight, and for this, I'm using the class WcfSilverlightCodeGenerationExtension (WsdlImporting, WsdlImported methods) and WcfSilverlightConfigGenerationExtension, is there anything equivalent for simple C# .NET applications?

     What class does SvcUtil uses?

    Thanks,

    L. Pinho
    Luis Pinho
    Tuesday, October 6, 2009 10:36 PM

Answers

  • Svcutil can be used to generate service model code from metadata and vice versa.

    at a very high level: svcutil uses MetadataExchangeClient to get the service metadata, uses WsdlImporter to import all contracts, uses ServiceContractGenerator to generate the types  and then finally generate the code using the proper CodeDomProvider.


    Amit Sharma
    Tuesday, October 6, 2009 11:19 PM

All replies

  • Svcutil can be used to generate service model code from metadata and vice versa.

    at a very high level: svcutil uses MetadataExchangeClient to get the service metadata, uses WsdlImporter to import all contracts, uses ServiceContractGenerator to generate the types  and then finally generate the code using the proper CodeDomProvider.


    Amit Sharma
    Tuesday, October 6, 2009 11:19 PM
  • You can also uses Visual Studio to generate proxy classes for client to use, as long as Service is pre-hosted and running either in IIS or custom hosting..
    To use SvcUtil you either need to have HTTP-GET or MEX address end point.

    There are many advantages to use SvcUtil.svc over visual studio since it provies more switches and control on how to generate proxy file.

    for example output location, config file generation, etc

    Wednesday, October 7, 2009 1:30 AM
  • Also please have a look at Understanding Generated Client Code for your reference:
    http://msdn.microsoft.com/en-us/library/ms733881.aspx

    Best regards,
    Riquel
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, October 13, 2009 5:12 AM