International Developer Logo Last Updated 19.11.08 at 11.48
 
TUTORIALS

Consumer-driven contracts: a service evolution pattern


Ian Robinson   11.09.06

Now when we receive a change request to add a description to each product, we can publish a new schema with an additional Description element that the provider inserts into the extension container. This allows the ProductSearch service to return results that include product descriptions and consumers using the new schema to validate the entire document. Consumers using the old schema will not break, though they will not process the description. The new results documents look like this:

 

<?xml version=”1.0” encoding=”utf-8”?>

<Products xmlns=”urn:example.com:productsearch:products”>

  <Product>

    <CatalogueID>101</CatalogueID>

    <Name>Widget</Name>

    <Price>10.99</Price>

    <Manufacturer>Company A</Manufacturer>

    <InStock>Yes</InStock>

    <Extension>

      <Description>Our top of the range widget</Description>

    </Extension>

  </Product>

  <Product>

    <CatalogueID>300</CatalogueID>

    <Name>Fooble</Name>

    <Price>2.00</Price>

    <Manufacturer>Company B</Manufacturer>

    <InStock>No</InStock>

    <Extension>

      <Description>Our bargain fooble</Description>

    </Extension>

  </Product>

</Products>




   Previous Page  1 2 3 4 5 6 7 8 9 10 ... Next Page   

HAVE YOUR SAY
This article is rated  Rate this article