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:
- Make new operation AddCarWithLength
- Make 2 versions of WSDL and consumer code with same operation
- Just update the WSDL with optional length and include it operation data only for producer that wants it.
- Just update the WSDL with 0-N name-vaue pair elements and include it operation data only for producer that wants it.
- Demand customers that they get the company that implemented the WS producer to update it.
Options:
- is out of the question
- 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
- Means that I only have to know which producer/server i talk with.
- Same as 3 but would allow future extensibility
- Can be problematic
Question: What is the correct / best way to do this when demanding all producers to be updated can be unrealistic?
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,
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.Dictionary<string,string> Parameters;and expose a new contract and utilize that.