开发者

Is it possible to run multiple versions of the same webservice?

[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 hav开发者_运维问答ing 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜