forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestService.cs
More file actions
35 lines (31 loc) · 874 Bytes
/
Copy pathTestService.cs
File metadata and controls
35 lines (31 loc) · 874 Bytes
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
using System.ComponentModel;
using System.Runtime.Serialization;
using ServiceStack.ServiceClient.Web;
using ServiceStack.ServiceHost;
namespace ServiceStack.WebHost.IntegrationTests.Services
{
[DataContract]
[Description("ServiceStack's Test World web service.")]
[RestService("/test")]
[RestService("/test/{Name}")]
public class Test
{
[DataMember]
public string Name { get; set; }
}
[DataContract]
public class TestResponse
{
[DataMember]
public string Result { get; set; }
}
public class TestService : IService<Test>
{
public object Execute(Test request)
{
var client = new Soap12ServiceClient("http://localhost/ServiceStack.WebHost.IntegrationTests/api/");
var response = client.Send<HelloResponse>(new Hello { Name = request.Name });
return new TestResponse { Result = response.Result };
}
}
}