I was curious if someone could outline which types of WCF contract (interface) changes on the server side would break a client trying to send in a message, and why. I believe WCF can handle certain discrepancies, but I'm not sure exactly what you can change safely, and what you can't.
A friend asked a similar question here:
Does adding a method to a WCF ServiceContract break existing clients?
EDIT: As John Saunders pointed out, changing the contract is not usually a good idea, but there are things built in that allow for some version tolerance (ExtensionDataObject, etc.?). I would just like to know how flexible the version tolerance is.
A Data Contract defines what data type to be passed to or from the client. In the WCF service, the Data Contract takes a major role for serialization and deserialization.
There's nothing wrong. The WCF Test Client is a tool which can be used to test many types of WCF services, but not all of them - duplex contracts being one category which is not supported.
Behaviors enable you to modify default behavior and add custom extensions that inspect and validate service configuration or modify runtime behavior in Windows Communication Foundation (WCF) client and service applications.
WCF has five types of contracts: service contract, operation contract, data contract, message contract and fault contract.
OK. Question. Due to wrong naming syntax (parameter is specified with capital letter), I would like to adjust some code:
[OperationContract]
public void Foo(string Bar){}
to
[OperationContract]
public void Foo(string bar){}
Would adjusting the capital break contract?
Check out this article on dasBlonde: Versioning WCF Service Contracts
It lists what changes will break existing clients:
This article by Michele explains in more detail how you can design contracts to be more flexible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With