locked
WCF Metadata RRS feed

  • Question

  • I have exposed a service using wcf publishing wizard. 

    Can I update web.config in any way so that it will give metadata.




    • Edited by sriaug Monday, April 18, 2016 6:18 PM
    Monday, April 18, 2016 5:52 PM

Answers

  • Use WCF-CustomIsolated Adapter -> webHttpBinding.

    Go to Behavior Tab. Under ServiceBehavior, click Add Extension -> Select ServiceMetadata.

    In the externalMetadataLocation property, specify the path of your wsdl file from IIS. Note: you have to create the wsdl and publish it to a IIS virtual directory/application first. Make sure the wsdl is browsable in IIS first. Now use the same path for the above property. Also set httpGetEnabled to true.

    Note: To be fair, exposing wsdl for a REST based service doesn't make much sense. Hence it is not available out of the box. Wsdl is meant for SOAP based services. Something like Swagger makes more sense for REST+JSON.


    Thanks Arindam






    • Marked as answer by sriaug Monday, April 18, 2016 6:12 PM
    • Unmarked as answer by sriaug Monday, April 18, 2016 6:12 PM
    • Marked as answer by sriaug Monday, April 18, 2016 6:16 PM
    • Edited by Arindam Paul RoyEditor Tuesday, April 19, 2016 2:36 AM
    Monday, April 18, 2016 6:09 PM
    Moderator