views:

100

answers:

3

I have a .NET Webservice which hosts a Method called AddMyObject.

[WebMethod]
public void AddMyObject(MyObject[] objects){...}

Where MyObject is declared as

public class MyObject
{
    public string Pro1{get;set;}
    public string Pro2{get;set;}
}

If I now add a Property to MyObject, the Client creates a new Proxy from the new WSDL and uses this Property, will an old instance of the Webservice be able to handle it? Of course the new Property will be null, but will there be any Exception?

A: 

Yes, in general it will fail. Not neccessarily on a .NET client (it's fairly lenient) but other clients will fail.

krosenvold
A: 

That is a good question, +1 for that.

I have never tried it, but I would say that it will probably work. Please tell us the results :)

Sergio
+1  A: 

Fortunately I just found the time to write a little test service for this issue.

What actually happens is, that if a property is added on client side, it's ignored on the old service.

Even when a Property is deleted on the client side, there is no Exception on the server: the Property is just null.

MADMap
Note that you can control this more in WCF, where you can mark things as required.
Marc Gravell
And all of this is different if your client is for instance Apache axis
krosenvold