What is the point in a WSDL with a rest based service?

后端 未结 3 481
感情败类
感情败类 2021-01-18 15:57

If REST based web services are as simple as GETing and POSTing to a url and parsing the response wht exactly do we need a wsdl? Whats the point. I understand that when using

相关标签:
3条回答
  • 2021-01-18 16:26

    There is no point in WSDL for REST services created with WCF because WCF supports only WSDL 1.1 (or 1.0) which cannot describe REST seevice. If you try to use WSDL generated for WCF REST service to create a client proxy you will not be able to call the service anyway. Visual studio templates for REST don't expose metadata so you will get useless WSDL only if you add serviceMetada behavior (and possibly also mex endpoint) yourselves.

    WSDL 2.0 and WADL supports description of REST services and the point is similar as with SOAP services - describe what you can do with the service but in the REST way.

    0 讨论(0)
  • 2021-01-18 16:35

    There's no point. WSDL is just a standardized description of what a service exposes and how can be invoked. You don't need WSDL, but you need some way of documenting what can be done with your service, so that clients know how to invoke it.

    0 讨论(0)
  • 2021-01-18 16:43

    WSDL is designed to allow clients to discover service capabilities, primarily at design time. REST has the hypermedia constraint that requires that all service capabilities should be discoverable at runtime via the linked representations that they return.

    Proper REST services are naturally discoverable therefore there is no need for a WSDL specification in addition.

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