Last post Jun 07, 2013 01:59 AM by GauravSingla
Jun 06, 2013 04:48 AM|GauravSingla|LINK
I have an existing wcf service. In the Wcf service, i modified the signature of a method to accept two more parameters of type string. Based on these two new parameters, in the service method, i was executing a stored procedure which was inserting some data
After that i updated the proxy and modified the web application to send two new parameter value as per the new signature of the service method. This worked well as expected till qa environment.
However, during deployment to the staging , somehow we missed the deployment of services and just deployed the web application.
During Sanity checks, we checked the web application and found it working without any error but later we discovered that the sproc was not being called and no data was being inserted into database.
After hours of struggling noticed that the service is not updated on server.
The strange thing is that i was expecting WCF service to throw error when the method signature was different in the service and proxy. However it was just ignoring the new parameters and still executing the method with the rest of the parameters.
Please somebody explain me this behavior.
Jun 06, 2013 05:39 AM|DarrellNorton|LINK
WCF supports "Lax versioning." Definition is:
WCF, ASP.NET Web Services, and many other Web service stacks support lax versioning: that is, they do not throw exceptions for new unknown data members in received data.
See more in this detailed article on Service Versioning: http://msdn.microsoft.com/en-us/library/ms731060.aspx
I would change the XML namespace on your WCF DataContract to support strict versioning. Then you would know if the web application was calling a different method than the service was expecting.
Jun 07, 2013 01:59 AM|GauravSingla|LINK
Thanks for your reply.
I do not have any datacontract for method, i am simply passing primitive types like integer and string in the wcf operation contract method.
Does it also applies to method parameters.
e.g in the service i have something like below:
public void SomeMethod(int a, int b)
On the proxy side, i have the below signature:
public void SomeMethod(int a, int b, string c, string d);
Now i am not getting any exception or error. Rather my service call is being successfully executed.
Does the WCF service also ignores the unknown parameters for the method?