我正在構建一個WCF服務,我已將合同寫入IService文件並在服務文件中實現它,當我嘗試更改任何返回值時出現問題我已聲明的方法的值,這是因爲它們被保存在CustomersService名稱空間中的代碼中,特別是鎖定在CustomersServiceClient類中,並且無法訪問以進行更改。無法更改wcf合同的方法返回值
這是我在ICustomersService文件中的代碼:
[ServiceContract]
public interface ICustomersService
{
[OperationContract]
CustomerDetails GetCustomerDetails(string customerid);
[OperationContract]
bool VerifyId(string customerid);
}
,並在CustomersService文件中的代碼:
public CustomerDetails GetCustomerDetails(string customerid)
{
....
}
public bool VerifyId(string customerid)
{
...
}
,並在CustomerService1命名空間我都已經生成驗證碼並鎖定,所以任何試圖修改我在IService中的方法都是令人失望的,因爲它在這裏被鎖定,無法更改!
public class CustomersServiceClient : ClientBase<ICustomersService>, ICustomersService
{
public CustomersServiceClient();
public CustomersServiceClient(string endpointConfigurationName);
public CustomersServiceClient(Binding binding, EndpointAddress remoteAddress);
public CustomersServiceClient(string endpointConfigurationName, EndpointAddress remoteAddress);
public CustomersServiceClient(string endpointConfigurationName, string remoteAddress);
public CustomerDetails GetCustomerDetails(string customerid);
public bool VerifyId(string customerid);
}
這對我來說是嚴重的問題我希望你找到我一些答案。
請張貼一些代碼,顯示您現在擁有什麼以及想要完成什麼 - 很難理解您想要做什麼。 – carlosfigueira
當然,我會,謝謝你的注意。 –