forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoap12ServiceClient.cs
More file actions
64 lines (57 loc) · 1.95 KB
/
Soap12ServiceClient.cs
File metadata and controls
64 lines (57 loc) · 1.95 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
54
55
56
57
58
59
60
61
62
63
64
#if !(SL5 || XBOX || ANDROID || __IOS__ || PCL)
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using ServiceStack.Text;
namespace ServiceStack
{
public class Soap12ServiceClient : WcfServiceClient
{
public Soap12ServiceClient(string uri)
{
this.Uri = uri.WithTrailingSlash() + "Soap12";
this.StoreCookies = true;
}
private WSHttpBinding binding;
private Binding WsHttpBinding
{
get
{
if (this.binding == null)
{
this.binding = new WSHttpBinding
{
MaxReceivedMessageSize = int.MaxValue,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferPoolSize = 524288,
Security = { Mode = SecurityMode.None },
};
// CCB Custom
// Yes, you need this to manage cookies yourself. Seems counterintutive, but set to true,
// it only means that the framework will manage cookie propagation for the same call, which is
// not what we want.
if (StoreCookies)
this.binding.AllowCookies = false;
}
return this.binding;
}
}
protected override Binding Binding
{
get { return this.WsHttpBinding; }
}
protected override MessageVersion MessageVersion
{
get { return MessageVersion.Default; }
}
public override void SetProxy(Uri proxyAddress)
{
var wsHttpBinding = (WSHttpBinding)Binding;
wsHttpBinding.ProxyAddress = proxyAddress;
wsHttpBinding.UseDefaultWebProxy = false;
wsHttpBinding.BypassProxyOnLocal = false;
return;
}
}
}
#endif