views:

26

answers:

1

I created a basic Silverlight WCF service from VS2008. The only thing i have changed from the auto-generated WCF service is to add a method:

 public int DoWork2(int x, Version version)
    {
        return x;
    }

If i remove the Version parameter, my Silverlight client works perfectly, but if the Version parameter is added, I get an error:

The remote server returned an error: NotFound.

I have no idea why. Any pointers?

edit: I should note that i have updated my service reference each time i have changed the methods signature.

+2  A: 

Well if you changed the method parameters or name, then it means that the method signature has changed, somewhere in there ull find an interface that defines that method signature, that looks like this

[OperationContract]    
int DoWork2(int x)

Goto that method signature and change it to look like this

[OperationContract]    
int DoWork2(int x, Version version)

I suspect WCF is telling you that it cannot find a method hosted on the given endpoint with the method signature you provided

Edit: Remember to update the service reference in Silverlight once you've made this change in WCF, so silverlight can understand the new Operation contracts

Also make sure silverlight is able to serialize the Version object, use WCF Diagnostics Trace logging, and find out exactly what is wrong and on which side (client or server) the problem occurs

Neil