views:

109

answers:

1

[RUN DOWN]

  • I am required to call on a webservice with version information embedded in the webservice name.
    EG. webserviceV1

  • When I generate a proxy class from the wsdl the webservice name is used to as the class name.
    I am using the wsdl.exe tool.

  • I can foresee that a new version of the webservice would result in my code base having to support 2 sets of proxy classes. Or for the code that use the existing proxy classes to be renamed.

[MY QUESTION]

  • I would like to propose a solution to the provider that would allow them to provide multiple versions of the webservice as it is early on in the project.

  • I was advised that a possible solution would be to provide the webservice via different ports. However having tried myself I don't know if that is even possible via IIS.

  • Is it possible to run multiple versions of a webservice at the same time on the same machine?

+1  A: 

Sure it is possible. Instead of appending version numbers to webservice classes, place them in separate virtual directories:

http://host/services/1.0/service.asmx
http://host/services/1.3/service.asmx
http://host/services/2.0/service.asmx

You will then have to devise a versioning scheme (use branches properly; see this for some thoughts on that) to support all versions of service simultaneously.

As for the code, you can try abstracting differences between service versions behind a common interface (think AbstractService) and then use it as a base for version-specific implementations (ServiceV1_3).

Google gives pretty nice results for this exact topic.

Anton Gogolev
Thanks for the prompt response. Will attempt to learn how to do this.
Gavin Chin
Tried it and it works great. Thanks.
Gavin Chin