WCF的接口怎么正确使用?
在Iservice类里
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[ServiceContract] public interface IService1 { [OperationContract] string GetData(int value);//系统自带的一个方法 [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); [OperationContract] string SayHello();//自己加的接口方法 // TODO: 在此添加您的服务操作 } |
实现接口类service
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
public class Service1 : IService1 { public string SayHello() { return "Hello WCF"; } public string GetData(int value) { return string.Format("You entered: {0}", value); } |
在用的时候是
为什么系统定义的GetData有GetDataCompleted完成返回属性
而我的SayHello没有SayHelloCompleted?
要怎么用?
浙公网安备 33010602011771号