9

I have authored a WSDL and the consumer/client that implements operation AddCar that has data for model and colour. Now one WS producer/server wants to also have data for length. I assume that other producers have difficulties to adapt to this change due to implementation outsourcing. My options include:

  1. Make new operation AddCarWithLength
  2. Make 2 versions of WSDL and consumer code with same operation
  3. Just update the WSDL with optional length and include it operation data only for producer that wants it.
  4. Just update the WSDL with 0-N name-vaue pair elements and include it operation data only for producer that wants it.
  5. Demand customers that they get the company that implemented the WS producer to update it.

Options:

  1. is out of the question
  2. I have generated C# classes in consumer/client so there would be two code sets. i still would have to know (maybe with config parameter or smthn) which version producer/server uses
  3. Means that I only have to know which producer/server i talk with.
  4. Same as 3 but would allow future extensibility
  5. Can be problematic

Question: What is the correct / best way to do this when demanding all producers to be updated can be unrealistic?

char m
  • 7,840
  • 14
  • 68
  • 117

1 Answers1

0

WSDL are known for the precious definitions. At first services should always designed with a clear picture of usage and future in mind. Anyhow, now my understanding is adding a attribute (data element - length) to your existing WCF service. My suggestion would be,

  1. Analyse and add a custom class of yours and name it as a data contract and add to your WCF operation and expose it as a new interface / operation contract.

Eg. with in Class car , have a data member as Properties. With in properties define all your analysis result elements like, length, width, color, weight etc. Also add a Dictionary<string,string> CustomAttributes; so in future you can use it.

  1. Similar to above, but if you don't have much time. with out any analysis just add a Dictionary<string,string> Parameters; and expose a new contract and utilize that.
Vincent
  • 11
  • 2
  • thanks! I use Top->Down development so I make the changes in WSDL and generate the code after. You are suggesting my option: "4. Just update the WSDL with 0-N name-vaue pair elements and include it operation data only for producer that wants it." However you do not address the main question i.e. how I should handle the producers A.K.A. Web Services which cannot adapt to the changes. – char m Aug 12 '16 at 06:10