Web Services API Versioning

前端 未结 5 1160
长情又很酷
长情又很酷 2020-12-31 01:34

I offer a small Web Services API to my clients which I plan to evolve over time. So I need some sort of versioning, but I can\'t find any information about how you do someth

5条回答
  •  Happy的楠姐
    2020-12-31 02:32

    One of the possibilities is to design all web service operations to have only one parameter of a type that inherits from some abstract type that holds version number. This approach is implemented by eBay web services platform. Something like the following:

    
      
      ....
    
    
      
       
       ....
    
    then use AddCustomerRequestType as a type of only parameter 
    in addCustomer web service operation.
    

    Additionally if you work over http you may require to add version as a http GET parameter to web service endpoint url, so you'll be able to detect requested version easily http://server/service?version=1

提交回复
热议问题