IWeb.cs
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Runtime.Serialization;
namespace BLL
{
[ServiceContract(Name = "Services")]
internal interface IWeb
{
[OperationContract]
[WebGet(UriTemplate = "StealAgv/takeOld?Place={place}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result TakeOldGet(string place);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "StealAgv/takeOld", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result TakeOldPost(Stream info);
[OperationContract]
[WebGet(UriTemplate = "StealAgv/sendNew?From={from}&Place={place}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result SendNewGet(string from, string place);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "StealAgv/sendNew", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result SendNewPost(Stream info);
[OperationContract]
[WebGet(UriTemplate = "StealAgv/storage?Place={place}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result StorageGet(string place);
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "StealAgv/storage", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result StoragePost(Stream info);
}
[DataContract]
internal class Result
{
[DataMember]
public int Code { get; set; }
[DataMember]
public string Msg { get; set; }
public Result()
{
Code = 0;
Msg = "OK";
}
}
}