My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
using System.ServiceModel;
using NUnit.Framework;
using ServiceStack.UsageExamples.Support;

namespace ServiceStack.UsageExamples
{
/// <summary>
/// Examples using the proxy client generated from svcutil.exe
/// </summary>
[TestFixture]
public class UsingSvcutilGeneratedClient : TestBase
{
[Test]
public void Get_customers_using_generated_svcutil_proxy()
{
var binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.None;
var version = 100;

using (var client = new svc.SyncReplyClient(binding, new EndpointAddress(WsSyncReplyUri)))
{
var request = new svc.ArrayOfIntId { CustomerId };
var properties = new svc.Properties();
svc.ResponseStatus responseStatus;
var customers = client.GetCustomers(request, ref properties, ref version, out responseStatus);
Assert.AreEqual(1, customers.Length);
Assert.AreEqual(CustomerId, customers[0].Id);
}
}

[Test]
public void Get_customers_using_generated_svcutil_proxy_BasicHttp()
{
var binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
var version = 100;

using (var client = new svc.SyncReplyClient(binding, new EndpointAddress(BasicHttpSyncReplyUri)))
{
var request = new svc.ArrayOfIntId { CustomerId };
var properties = new svc.Properties();
svc.ResponseStatus responseStatus;
var customers = client.GetCustomers(request, ref properties, ref version, out responseStatus);
Assert.AreEqual(1, customers.Length);
Assert.AreEqual(CustomerId, customers[0].Id);
}
}

}
}

Change log

r398 by demis.bellot on Oct 14, 2009   Diff
re add UsageExamples
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1584 bytes, 49 lines
Powered by Google Project Hosting