WSDL for REST WCF

前端 未结 2 1321
说谎
说谎 2021-01-14 09:29

I\'ve created a REST WCF in C# by specifying WebGET and WebHttpBinding in web.config. The service works fine through IE. My wsdl starts as below and it has soap in wsdl. Sin

相关标签:
2条回答
  • 2021-01-14 10:08

    WCF is not able to describe REST service. REST service can be described by WADL or WSDL 2.0 but WCF doesn't support any of these description languages.

    0 讨论(0)
  • 2021-01-14 10:27

    As stated above, REST has no concept of a WSDL in WCF, only SOAP. If the URL for ?wsdl works, then you probably have a 'mex' (Metadata Exchange) endpoint defined in your configuration, which is what serves up the WSDL. This is usually added by default if you add a WCF service through the VisualStudio wizards. If it is there, it can be removed if you don't plan on using SOAP. It will usually look something like this:

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    

    On a side-note; it is possible to have WCF serve up the same services as both SOAP and REST, as detailed here: REST / SOAP endpoints for a WCF service

    0 讨论(0)
提交回复
热议问题