Bruno Baia
10-29-2005, 04:08 PM
Hi,
i'm testing the WebServiceProxyFactory class.
It works fine with WebMethods using value types (int, string, etc...), but it fails with object types.
here is my service interface :
public interface ICustomerService
{
Customer[] GetCustomers();
}
an implementation :
public class CustomerService : ICustomerService
{
[WebMethod]
public Customer[] GetCustomers()
{
// ...
}
}
The VS Proxy generator will generate another Customer class for the client :
public class Customer
{
/// <remarks/>
public int ID;
/// <remarks/>
public string Name;
}
So the proxy class will not implement the interface and the WebServiceProxyFactory will launch an exception.
It can works if u remove the Customer implementation and add a reference to ur model namespace who contains Customer definition in the proxy generated class.
i'm testing the WebServiceProxyFactory class.
It works fine with WebMethods using value types (int, string, etc...), but it fails with object types.
here is my service interface :
public interface ICustomerService
{
Customer[] GetCustomers();
}
an implementation :
public class CustomerService : ICustomerService
{
[WebMethod]
public Customer[] GetCustomers()
{
// ...
}
}
The VS Proxy generator will generate another Customer class for the client :
public class Customer
{
/// <remarks/>
public int ID;
/// <remarks/>
public string Name;
}
So the proxy class will not implement the interface and the WebServiceProxyFactory will launch an exception.
It can works if u remove the Customer implementation and add a reference to ur model namespace who contains Customer definition in the proxy generated class.