Last post Jul 03, 2015 01:36 AM by JensSimonsen
Jun 24, 2015 02:04 AM|JensSimonsen|LINK
Hi im currently working on a application that consumes a third parte API service and the creteria from the customer is that i need to handle the changes they do on that service like if they add a new property to class object 1 then i need to get that change
into the application with out having to update the service reference then recompile in other words it needs to run things at runtime i know u can not force a update to the service reference so im looking for a way to do this manually which handles this which
i then can invoke.
in short i need to handle the changes in the service if they come on runtime.
im looking for suggestions to where to start and if possible som code snippets to get me started.
il appreciate any help.
Jun 25, 2015 09:44 AM|Caillen Zhong|LINK
As far as I know, whether you need to re-add the service reference and re-compile your project depends on the contract between your client and the service provider. If the contract keep the same, you don't need to re-add the service and re-compile your client.
When the service change the contract you should get some "contract-mismatch" like problems, then you have to change your client application. For WCF/ASMX web services, the contract is generated when you generate the proxy client. When the service makes some
breaking changes, not backward compatible, you have to re-generate the proxy client and re-compile your application.
For WebAPI service, it also depends on how the WebAPI service versions and how does the contract changes. There're many versioning ways for WebAPI service, e.g. URL, Content Negotiation, custom header. But as long as your client application and the WebAPI
service keep the same contract(e.g. the data format), there should be no need to recompile your application even if the service is changed.
So in my opinion, what you need to care is all about the contract, you can cover some possible changes in your application, but you can't guarantee you won't recompile your application if the service changes arbitrarily.
Jul 03, 2015 01:36 AM|JensSimonsen|LINK
based on the answer we have negotiated another way to handle it with the customer. so we will update the service with the vs2013 update service when a new contract is issued and rebuild it for the customer for maintenence.
thanks for taking the time to answer.