Webservice Compatibility.

etienne_marais

Honorary Master
Joined
Mar 16, 2008
Messages
16,250
Reaction score
19,740
Location
Centurion
Using VS 2010 and c# projects.

I have a webservice and 2 client programs consuming them.

Application 1 has been released and works well with the webservice.
Application 2 is new and requires new webservice functionality, including new methods and types declared in the webservice.

I want to deploy application 2 as well as the updated webservice.

Question is when does the webservice become incompatible with application 1 (which I do not want to relaunch for now).

The signatures of existing methods and existing types stayed the same, only new methods and types were added. (In fact, not even the bodies of existing methods were changed).
 
Just test Application 1 with the new service to make sure but if the method signatures of existing methods stays the same it shouldn't be a problem.

Thanks Frik, thing is application 1 is in production and used consistently, I will have to upload the webservice at midnight and test app.1 then :(
 
Thanks Frik, thing is application 1 is in production and used consistently, I will have to upload the webservice at midnight and test app.1 then :(

Do you not have the source code for app 1? If so just host the new service somewhere else and temporarily change the url the web service in VS points to to test the new service.
 
Version your endpoints. Old code is /service, new one is /service_1.1
 
Using VS 2010 and c# projects.

I have a webservice and 2 client programs consuming them.

Application 1 has been released and works well with the webservice.
Application 2 is new and requires new webservice functionality, including new methods and types declared in the webservice.

I want to deploy application 2 as well as the updated webservice.

Question is when does the webservice become incompatible with application 1 (which I do not want to relaunch for now).

The signatures of existing methods and existing types stayed the same, only new methods and types were added. (In fact, not even the bodies of existing methods were changed).

Why not just version your services. That is how I have dealt with it

Service1 : IServiceV1


ServiceV2 : IServiceV1, IServiceV2

If its restful you can just do /v1/service, or /v2/service. But either way if you deploy the new service with the new methods, it should not effect the existing application running.
 
Thanks, that makes a lot of sense.

So where I have: public partial class MyService : System.Web.Services.WebService

I just create another class: public partial class MyService2 : System.Web.Services.WebService

I can't really bend my mind around the use of interfaces for this, is it to enforce that all needed methods are implemented or are there other advantages ?
 
Thanks, that makes a lot of sense.

So where I have: public partial class MyService : System.Web.Services.WebService

I just create another class: public partial class MyService2 : System.Web.Services.WebService

I can't really bend my mind around the use of interfaces for this, is it to enforce that all needed methods are implemented or are there other advantages ?

Yes they form a contract, but also helps with unit testing and DI. It boils down to separations of concerns.
 
Top
Sign up to the MyBroadband newsletter
X