~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Common/ServiceClient.Web/Soap12ServiceClient.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.IO;
 
3
using ServiceStack.Service;
 
4
using System.Net;
 
5
 
 
6
namespace ServiceStack.ServiceClient.Web
 
7
{
 
8
#if SILVERLIGHT || MONOTOUCH || XBOX || ANDROID
 
9
 
 
10
    public class Soap12ServiceClient  : IServiceClient
 
11
    {
 
12
        public Soap12ServiceClient(string uri)
 
13
        {
 
14
            throw new NotImplementedException();
 
15
        }
 
16
 
 
17
        public void Dispose()
 
18
        {
 
19
            throw new NotImplementedException();
 
20
        }
 
21
 
 
22
        public void SetCredentials(string userName, string password)
 
23
        {
 
24
            throw new NotImplementedException();
 
25
        }
 
26
 
 
27
        public void GetAsync<TResponse>(string relativeOrAbsoluteUrl, Action<TResponse> onSuccess, 
 
28
            Action<TResponse, Exception> onError)
 
29
        {
 
30
            throw new NotImplementedException();
 
31
        }
 
32
 
 
33
        public void DeleteAsync<TResponse>(string relativeOrAbsoluteUrl, Action<TResponse> onSuccess, 
 
34
            Action<TResponse, Exception> onError)
 
35
        {
 
36
            throw new NotImplementedException();
 
37
        }
 
38
 
 
39
        public void PostAsync<TResponse>(string relativeOrAbsoluteUrl, object request, 
 
40
            Action<TResponse> onSuccess, Action<TResponse,Exception> onError)
 
41
        {
 
42
            throw new NotImplementedException();
 
43
        }
 
44
 
 
45
        public void PutAsync<TResponse>(string relativeOrAbsoluteUrl, object request, Action<TResponse> onSuccess, 
 
46
            Action<TResponse,Exception> onError)
 
47
        {
 
48
            throw new NotImplementedException();
 
49
        }
 
50
 
 
51
        public void SendAsync<TResponse>(object request, Action<TResponse> onSuccess, Action<TResponse, Exception> onError)
 
52
        {
 
53
            throw new NotImplementedException();
 
54
        }
 
55
 
 
56
        public void SendOneWay(object request)
 
57
        {
 
58
            throw new NotImplementedException();
 
59
        }
 
60
 
 
61
        public void SendOneWay(string relativeOrAbsoluteUrl, object request)
 
62
        {
 
63
            throw new NotImplementedException();
 
64
        }
 
65
 
 
66
        public TResponse Send<TResponse>(object request)
 
67
        {
 
68
            throw new NotImplementedException();
 
69
        }
 
70
 
 
71
        public TResponse PostFile<TResponse>(string relativeOrAbsoluteUrl, FileInfo fileToUpload, string mimeType)
 
72
        {
 
73
            throw new NotImplementedException();
 
74
        }
 
75
 
 
76
        public TResponse PostFile<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType)
 
77
        {
 
78
            throw new NotImplementedException();
 
79
        }
 
80
 
 
81
        public TResponse PostFileWithRequest<TResponse>(string relativeOrAbsoluteUrl, FileInfo fileToUpload, object request)
 
82
        {
 
83
            throw new NotImplementedException();
 
84
        }
 
85
        
 
86
        public TResponse PostFileWithRequest<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request)
 
87
        {
 
88
            throw new NotImplementedException();
 
89
        }
 
90
    }
 
91
 
 
92
#else
 
93
 
 
94
    using System.ServiceModel;
 
95
    using System.ServiceModel.Channels;
 
96
    using ServiceStack.Text;
 
97
    using ServiceStack.Service;
 
98
 
 
99
    public class Soap12ServiceClient : WcfServiceClient
 
100
    {
 
101
        public Soap12ServiceClient(string uri)
 
102
        {
 
103
            this.Uri = uri.WithTrailingSlash() + "Soap12";
 
104
            this.StoreCookies = true;
 
105
        }
 
106
 
 
107
        private WSHttpBinding binding;
 
108
 
 
109
        private Binding WsHttpBinding
 
110
        {
 
111
            get
 
112
            {
 
113
                if (this.binding == null)
 
114
                {
 
115
                    this.binding = new WSHttpBinding {
 
116
                        MaxReceivedMessageSize = int.MaxValue,
 
117
                        HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,                                         
 
118
                        MaxBufferPoolSize = 524288,
 
119
                    };
 
120
                    this.binding.Security.Mode = SecurityMode.None;
 
121
                    // CCB Custom
 
122
                    // Yes, you need this to manage cookies yourself.  Seems counterintutive, but set to true,
 
123
                    // it only means that the framework will manage cookie propagation for the same call, which is
 
124
                    // not what we want.
 
125
                    if (StoreCookies)
 
126
                        this.binding.AllowCookies = false;
 
127
                }
 
128
                return this.binding;
 
129
            }
 
130
        }
 
131
 
 
132
        protected override Binding Binding
 
133
        {
 
134
            get { return this.WsHttpBinding; }
 
135
        }
 
136
 
 
137
        protected override MessageVersion MessageVersion
 
138
        {
 
139
            get { return MessageVersion.Default; }
 
140
        }
 
141
 
 
142
        public override void SetProxy(Uri proxyAddress)
 
143
        {
 
144
            var wsHttpBinding = (WSHttpBinding)Binding;
 
145
 
 
146
            wsHttpBinding.ProxyAddress = proxyAddress;
 
147
            wsHttpBinding.UseDefaultWebProxy = false;
 
148
            wsHttpBinding.BypassProxyOnLocal = false;
 
149
            return;
 
150
        }
 
151
    }
 
152
 
 
153
#endif
 
154
}