none
New endpoints for versioned WCF services RRS feed

  • Question

  • I've read several articles on versioning WCF services:

    http://msdn.microsoft.com/en-us/library/ms731060(v=VS.110).aspx

    http://msdn.microsoft.com/en-us/library/ms733832.aspx

    http://www.devproconnections.com/article/windows-communication-foundation-wcf2/versioning-wcf-services-part-i-122538

    However, these articles don't really describe any preferred practice of publishing the new versions.  I think my options would be:

    - A completely different endpoint

    - A new endpoint with the same listenuri but a different address

    - A routing service

    http://msdn.microsoft.com/en-us/library/ee816862.aspx

    Do any of these options create an interoperability issue with non-microsoft clients (java metro for example) ie are they not covered under a ws-* standard?  A new endpoint with the same listenuri appeals to me for it's simplicity from a publishing standpoint, but it seems like a completely new endpoint with say a /yyyy/mm/service.svc scheme would have the best compatibilty (at least without manipulating the raw response), as long as the service was created as a stand-alone service and not hosted in iis.

    Any thoughts or suggestions would be appreciated.  Any real world examples would also help so I could get an idea of what others are doing (ie payment processors, authentication services, etc)


    Friday, January 25, 2013 10:01 PM

Answers

  • Hi,

    As mentiond in the document you referenced above, changes to endpoint(change address or binding) are breaking changes unless clients are capable of dynamically discovering the new endpoint address or binding. You can use a Universal Discovery Description and Integration (UDDI) registry and the UDDI Invocation Pattern where a client attempts to communicate with an endpoint and, upon failure, queries a well-known UDDI registry for the current endpoint metadata. It is same logic when you add a new endpoint according to my understanding.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 31, 2013 10:15 AM
    Moderator

All replies

  • Hi,

    You can do version control processing through contract inheritance, which can be used to create a new contract that extends existing contracts.

    To use this feature, define a new service contract interface that inherits from the old service
    contract interface, then add methods to the new interface. You then change the service that implements the old contract to implement the new contract and change the "versionOld" endpoint definition to use the new contract. To "versionOld" clients, the endpoint will continue to appear as exposing the "versionOld" contract; to "versionNew" clients, the endpoint will appear to expose the "versionNew" contract.

    Hope it helps.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 28, 2013 9:58 AM
    Moderator
  • Thank you for the reply.

    What do you do for breaking changes - removal of a method or a change in data type?

    Tuesday, January 29, 2013 2:45 PM
  • Hi,

    You can create a new contract for all operations in a new namespace, without a inheritance relationship with the old one, created services and endpoints independently, share the public functions in base class of service.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 30, 2013 6:09 AM
    Moderator
  • The following article helped me better understand the physical vs logical address:

    http://msdn.microsoft.com/en-us/magazine/cc163412.aspx#S5

    With that, I'm going to go with unique endpoints instead of relying on a routing service.  

    It would be nice if there were some best practices, guidelines, or examples available for creating endpoints for new versions.  The only thing the articles mention in my original post is the routing service

    Wednesday, January 30, 2013 3:57 PM
  • Hi,

    As mentiond in the document you referenced above, changes to endpoint(change address or binding) are breaking changes unless clients are capable of dynamically discovering the new endpoint address or binding. You can use a Universal Discovery Description and Integration (UDDI) registry and the UDDI Invocation Pattern where a client attempts to communicate with an endpoint and, upon failure, queries a well-known UDDI registry for the current endpoint metadata. It is same logic when you add a new endpoint according to my understanding.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 31, 2013 10:15 AM
    Moderator