-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathSoap12ServiceClient.cs
58 lines (51 loc) · 1.83 KB
/
Soap12ServiceClient.cs
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
#if NETFX
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 => this.WsHttpBinding;
protected override MessageVersion MessageVersion => MessageVersion.Default;
public override void SetProxy(Uri proxyAddress)
{
var wsHttpBinding = (WSHttpBinding)Binding;
wsHttpBinding.ProxyAddress = proxyAddress;
wsHttpBinding.UseDefaultWebProxy = false;
wsHttpBinding.BypassProxyOnLocal = false;
return;
}
}
}
#endif