17 February, 2012

WCF service contract changes supported by old proxy

Needed to know which changes to a WCF Service Contract could an old proxy support. The tests were made with BasicHttpBinding and WsHttpBinding and a client with a proxy generated by visual studio. All DataContract attributes were strings.

My results were:

Add an Operation - OK
Remove an Operation - OK unless the client calls it.


Added Attribute to response object - OK
Added Attribute to request object - OK

Removed Attribute from response object - OK (the client interprets it as null)
Removed Attribute from request object - OK (the client interprets it as null)

Change the type of an Attribute of the response object -depends whether the new type can be parsed to the old type from the message string.
Change the type of an Attribute of the request object -depends whether the new type can be parsed to the old type from the message string.

Change the Attribute name in the response object - OK (the client gets null since the old attribute was removed)
Change the Attribute name in the request object - OK (the client gets null since the old attribute was removed)

All OK results indicate that no Exception is thrown.
The client will not be aware of new properties or new operations but will also not crash (at least for nullable properties, haven't tested types other than strings).

The results were the same for both bindings.

Other bindings, especially ones that have binary serialization will probably present different behaviors.

No comments:

Post a Comment