Convert MonoGenericContainer/Param accessor macros to inline functions
[mono.git] / mcs / class / System.ServiceModel / Test / System.ServiceModel.Dispatcher / Bug32886Test.cs
1 //
2 // Author:
3 //       Martin Baulig <martin.baulig@xamarin.com>
4 //
5 // Copyright (c) 2015 Xamarin, Inc.
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 // THE SOFTWARE.
24 using System;
25 using System.Collections.Generic;
26 using System.Linq;
27 using System.Runtime.Serialization;
28 using System.ServiceModel;
29 using System.ServiceModel.Description;
30 using System.Threading;
31 using NUnit.Framework;
32
33 using WebServiceMoonlightTest.ServiceReference1;
34
35 using MonoTests.Helpers;
36
37 namespace MonoTests.System.ServiceModel.Dispatcher
38 {
39         [TestFixture]
40         public class Bug32886
41         {
42                 [Test]
43                 public void Bug32886_Test () // test in one of the comment
44                 {
45                         // Init service
46                         int port = NetworkHelpers.FindFreePort ();
47                         ServiceHost serviceHost = new ServiceHost (typeof (TempConvertSoapImpl), new Uri ("http://localhost:" + port + "/TempConvertSoap"));
48                         serviceHost.AddServiceEndpoint (typeof (TempConvertSoap), new BasicHttpBinding (), string.Empty);
49
50                         // Enable metadata exchange (WSDL publishing)
51                         var mexBehavior = new ServiceMetadataBehavior ();
52                         mexBehavior.HttpGetEnabled = true;
53                         serviceHost.Description.Behaviors.Add (mexBehavior);
54                         serviceHost.AddServiceEndpoint (typeof (IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding (), "mex");
55
56                         serviceHost.Open ();
57
58                         try {
59                                 // client
60                                 var binding = new BasicHttpBinding ();
61                                 var remoteAddress = new EndpointAddress ("http://localhost:" + port + "/TempConvertSoap");
62                                 var client = new TempConvertSoapClient (binding, remoteAddress);
63
64                                 var wait = new ManualResetEvent (false);
65                                 client.CelsiusToFahrenheitCompleted += delegate (object o, CelsiusToFahrenheitCompletedEventArgs e) {
66                                         if (e.Error != null)
67                                                 throw e.Error;
68                                         Assert.AreEqual ("76.1", e.Result, "#1");
69                                         wait.Set ();
70                                 };
71
72                                 client.CelsiusToFahrenheitAsync ("24.5");
73                                 if (!wait.WaitOne (TimeSpan.FromSeconds (20)))
74                                         Assert.Fail ("timeout");
75                         } finally {
76                                 serviceHost.Close ();
77                         }
78                 }
79
80                 class TempConvertSoapImpl : TempConvertSoap
81                 {
82                         public FahrenheitToCelsiusResponse FarenheitToCelsius (FahrenheitToCelsiusRequest request)
83                         {
84                                 var farenheit = double.Parse (request.Body.Fahrenheit);
85                                 var celsius = ((farenheit - 32) / 9) * 5;
86                                 return new FahrenheitToCelsiusResponse (new FahrenheitToCelsiusResponseBody (celsius.ToString ()));
87                         }
88
89                         public CelsiusToFahrenheitResponse CelsiusToFarenheit (CelsiusToFahrenheitRequest request)
90                         {
91                                 var celsius = double.Parse (request.Body.Celsius);
92                                 var farenheit = ((celsius * 9) / 5) + 32;
93                                 return new CelsiusToFahrenheitResponse (new CelsiusToFahrenheitResponseBody (farenheit.ToString ()));
94                         }
95
96                         Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> farenheitToCelsius;
97                         Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> celsiusToFarenheit;
98
99                         public IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, AsyncCallback callback, object asyncState)
100                         {
101                                 if (farenheitToCelsius == null)
102                                         farenheitToCelsius = new Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> (FarenheitToCelsius);
103                                 return farenheitToCelsius.BeginInvoke (request, callback, asyncState);
104                         }
105
106                         public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (IAsyncResult result)
107                         {
108                                 return farenheitToCelsius.EndInvoke (result);
109                         }
110
111                         public IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, AsyncCallback callback, object asyncState)
112                         {
113                                 if (celsiusToFarenheit == null)
114                                         celsiusToFarenheit = new Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> (CelsiusToFarenheit);
115                                 return celsiusToFarenheit.BeginInvoke (request, callback, asyncState);
116                         }
117
118                         public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (IAsyncResult result)
119                         {
120                                 return celsiusToFarenheit.EndInvoke (result);
121                         }
122                 }
123         }
124 }
125
126 //------------------------------------------------------------------------------
127 // <auto-generated>
128 //     This code was generated by a tool.
129 //     Runtime Version:4.0.30319.34003
130 //
131 //     Changes to this file may cause incorrect behavior and will be lost if
132 //     the code is regenerated.
133 // </auto-generated>
134 //------------------------------------------------------------------------------
135
136 // 
137 // This code was auto-generated by SlSvcUtil, version 5.0.61118.0
138 // 
139
140
141 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
142 [System.ServiceModel.ServiceContractAttribute (Namespace = "http://www.w3schools.com/webservices/", ConfigurationName = "TempConvertSoap")]
143 public interface TempConvertSoap
144 {
145
146         [System.ServiceModel.OperationContractAttribute (AsyncPattern = true, Action = "http://www.w3schools.com/webservices/FahrenheitToCelsius", ReplyAction = "*")]
147         System.IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState);
148
149         FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result);
150
151         [System.ServiceModel.OperationContractAttribute (AsyncPattern = true, Action = "http://www.w3schools.com/webservices/CelsiusToFahrenheit", ReplyAction = "*")]
152         System.IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState);
153
154         CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result);
155 }
156
157 [System.Diagnostics.DebuggerStepThroughAttribute ()]
158 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
159 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
160 [System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
161 public partial class FahrenheitToCelsiusRequest
162 {
163
164         [System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsius", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
165         public FahrenheitToCelsiusRequestBody Body;
166
167         public FahrenheitToCelsiusRequest ()
168         {
169         }
170
171         public FahrenheitToCelsiusRequest (FahrenheitToCelsiusRequestBody Body)
172         {
173                 this.Body = Body;
174         }
175 }
176
177 [System.Diagnostics.DebuggerStepThroughAttribute ()]
178 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
179 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
180 [System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
181 public partial class FahrenheitToCelsiusRequestBody
182 {
183
184         [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
185         public string Fahrenheit;
186
187         public FahrenheitToCelsiusRequestBody ()
188         {
189         }
190
191         public FahrenheitToCelsiusRequestBody (string Fahrenheit)
192         {
193                 this.Fahrenheit = Fahrenheit;
194         }
195 }
196
197 [System.Diagnostics.DebuggerStepThroughAttribute ()]
198 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
199 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
200 [System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
201 public partial class FahrenheitToCelsiusResponse
202 {
203
204         [System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsiusResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
205         public FahrenheitToCelsiusResponseBody Body;
206
207         public FahrenheitToCelsiusResponse ()
208         {
209         }
210
211         public FahrenheitToCelsiusResponse (FahrenheitToCelsiusResponseBody Body)
212         {
213                 this.Body = Body;
214         }
215 }
216
217 [System.Diagnostics.DebuggerStepThroughAttribute ()]
218 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
219 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
220 [System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
221 public partial class FahrenheitToCelsiusResponseBody
222 {
223
224         [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
225         public string FahrenheitToCelsiusResult;
226
227         public FahrenheitToCelsiusResponseBody ()
228         {
229         }
230
231         public FahrenheitToCelsiusResponseBody (string FahrenheitToCelsiusResult)
232         {
233                 this.FahrenheitToCelsiusResult = FahrenheitToCelsiusResult;
234         }
235 }
236
237 [System.Diagnostics.DebuggerStepThroughAttribute ()]
238 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
239 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
240 [System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
241 public partial class CelsiusToFahrenheitRequest
242 {
243
244         [System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheit", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
245         public CelsiusToFahrenheitRequestBody Body;
246
247         public CelsiusToFahrenheitRequest ()
248         {
249         }
250
251         public CelsiusToFahrenheitRequest (CelsiusToFahrenheitRequestBody Body)
252         {
253                 this.Body = Body;
254         }
255 }
256
257 [System.Diagnostics.DebuggerStepThroughAttribute ()]
258 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
259 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
260 [System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
261 public partial class CelsiusToFahrenheitRequestBody
262 {
263
264         [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
265         public string Celsius;
266
267         public CelsiusToFahrenheitRequestBody ()
268         {
269         }
270
271         public CelsiusToFahrenheitRequestBody (string Celsius)
272         {
273                 this.Celsius = Celsius;
274         }
275 }
276
277 [System.Diagnostics.DebuggerStepThroughAttribute ()]
278 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
279 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
280 [System.ServiceModel.MessageContractAttribute (IsWrapped = false)]
281 public partial class CelsiusToFahrenheitResponse
282 {
283
284         [System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheitResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
285         public CelsiusToFahrenheitResponseBody Body;
286
287         public CelsiusToFahrenheitResponse ()
288         {
289         }
290
291         public CelsiusToFahrenheitResponse (CelsiusToFahrenheitResponseBody Body)
292         {
293                 this.Body = Body;
294         }
295 }
296
297 [System.Diagnostics.DebuggerStepThroughAttribute ()]
298 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
299 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
300 [System.Runtime.Serialization.DataContractAttribute (Namespace = "http://www.w3schools.com/webservices/")]
301 public partial class CelsiusToFahrenheitResponseBody
302 {
303
304         [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
305         public string CelsiusToFahrenheitResult;
306
307         public CelsiusToFahrenheitResponseBody ()
308         {
309         }
310
311         public CelsiusToFahrenheitResponseBody (string CelsiusToFahrenheitResult)
312         {
313                 this.CelsiusToFahrenheitResult = CelsiusToFahrenheitResult;
314         }
315 }
316
317 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
318 public interface TempConvertSoapChannel : TempConvertSoap, System.ServiceModel.IClientChannel
319 {
320 }
321
322 [System.Diagnostics.DebuggerStepThroughAttribute ()]
323 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
324 public partial class FahrenheitToCelsiusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
325 {
326
327         private object[] results;
328
329         public FahrenheitToCelsiusCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
330         base (exception, cancelled, userState)
331         {
332                 this.results = results;
333         }
334
335         public string Result {
336                 get {
337                         base.RaiseExceptionIfNecessary ();
338                         return ((string)(this.results [0]));
339                 }
340         }
341 }
342
343 [System.Diagnostics.DebuggerStepThroughAttribute ()]
344 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
345 public partial class CelsiusToFahrenheitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
346 {
347
348         private object[] results;
349
350         public CelsiusToFahrenheitCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
351         base (exception, cancelled, userState)
352         {
353                 this.results = results;
354         }
355
356         public string Result {
357                 get {
358                         base.RaiseExceptionIfNecessary ();
359                         return ((string)(this.results [0]));
360                 }
361         }
362 }
363
364 [System.Diagnostics.DebuggerStepThroughAttribute ()]
365 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
366 public partial class TempConvertSoapClient : System.ServiceModel.ClientBase<TempConvertSoap>, TempConvertSoap
367 {
368
369         private BeginOperationDelegate onBeginFahrenheitToCelsiusDelegate;
370
371         private EndOperationDelegate onEndFahrenheitToCelsiusDelegate;
372
373         private System.Threading.SendOrPostCallback onFahrenheitToCelsiusCompletedDelegate;
374
375         private BeginOperationDelegate onBeginCelsiusToFahrenheitDelegate;
376
377         private EndOperationDelegate onEndCelsiusToFahrenheitDelegate;
378
379         private System.Threading.SendOrPostCallback onCelsiusToFahrenheitCompletedDelegate;
380
381         private BeginOperationDelegate onBeginOpenDelegate;
382
383         private EndOperationDelegate onEndOpenDelegate;
384
385         private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
386
387         private BeginOperationDelegate onBeginCloseDelegate;
388
389         private EndOperationDelegate onEndCloseDelegate;
390
391         private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
392
393         public TempConvertSoapClient ()
394         {
395         }
396
397         public TempConvertSoapClient (string endpointConfigurationName) :
398         base (endpointConfigurationName)
399         {
400         }
401
402         public TempConvertSoapClient (string endpointConfigurationName, string remoteAddress) :
403         base (endpointConfigurationName, remoteAddress)
404         {
405         }
406
407         public TempConvertSoapClient (string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
408         base (endpointConfigurationName, remoteAddress)
409         {
410         }
411
412         public TempConvertSoapClient (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
413         base (binding, remoteAddress)
414         {
415         }
416
417         public System.Net.CookieContainer CookieContainer {
418                 get {
419                         System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
420                         if ((httpCookieContainerManager != null)) {
421                                 return httpCookieContainerManager.CookieContainer;
422                         } else {
423                                 return null;
424                         }
425                 }
426                 set {
427                         System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
428                         if ((httpCookieContainerManager != null)) {
429                                 httpCookieContainerManager.CookieContainer = value;
430                         } else {
431                                 throw new System.InvalidOperationException ("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
432                                         "ookieContainerBindingElement.");
433                         }
434                 }
435         }
436
437         public event System.EventHandler<FahrenheitToCelsiusCompletedEventArgs> FahrenheitToCelsiusCompleted;
438
439         public event System.EventHandler<CelsiusToFahrenheitCompletedEventArgs> CelsiusToFahrenheitCompleted;
440
441         public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
442
443         public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
444
445         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
446         System.IAsyncResult TempConvertSoap.BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
447         {
448                 return base.Channel.BeginFahrenheitToCelsius (request, callback, asyncState);
449         }
450
451         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
452         private System.IAsyncResult BeginFahrenheitToCelsius (string Fahrenheit, System.AsyncCallback callback, object asyncState)
453         {
454                 FahrenheitToCelsiusRequest inValue = new FahrenheitToCelsiusRequest ();
455                 inValue.Body = new FahrenheitToCelsiusRequestBody ();
456                 inValue.Body.Fahrenheit = Fahrenheit;
457                 return ((TempConvertSoap)(this)).BeginFahrenheitToCelsius (inValue, callback, asyncState);
458         }
459
460         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
461         FahrenheitToCelsiusResponse TempConvertSoap.EndFahrenheitToCelsius (System.IAsyncResult result)
462         {
463                 return base.Channel.EndFahrenheitToCelsius (result);
464         }
465
466         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
467         private string EndFahrenheitToCelsius (System.IAsyncResult result)
468         {
469                 FahrenheitToCelsiusResponse retVal = ((TempConvertSoap)(this)).EndFahrenheitToCelsius (result);
470                 return retVal.Body.FahrenheitToCelsiusResult;
471         }
472
473         private System.IAsyncResult OnBeginFahrenheitToCelsius (object[] inValues, System.AsyncCallback callback, object asyncState)
474         {
475                 string Fahrenheit = ((string)(inValues [0]));
476                 return this.BeginFahrenheitToCelsius (Fahrenheit, callback, asyncState);
477         }
478
479         private object[] OnEndFahrenheitToCelsius (System.IAsyncResult result)
480         {
481                 string retVal = this.EndFahrenheitToCelsius (result);
482                 return new object[] {
483                         retVal
484                 };
485         }
486
487         private void OnFahrenheitToCelsiusCompleted (object state)
488         {
489                 if ((this.FahrenheitToCelsiusCompleted != null)) {
490                         InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
491                         this.FahrenheitToCelsiusCompleted (this, new FahrenheitToCelsiusCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
492                 }
493         }
494
495         public void FahrenheitToCelsiusAsync (string Fahrenheit)
496         {
497                 this.FahrenheitToCelsiusAsync (Fahrenheit, null);
498         }
499
500         public void FahrenheitToCelsiusAsync (string Fahrenheit, object userState)
501         {
502                 if ((this.onBeginFahrenheitToCelsiusDelegate == null)) {
503                         this.onBeginFahrenheitToCelsiusDelegate = new BeginOperationDelegate (this.OnBeginFahrenheitToCelsius);
504                 }
505                 if ((this.onEndFahrenheitToCelsiusDelegate == null)) {
506                         this.onEndFahrenheitToCelsiusDelegate = new EndOperationDelegate (this.OnEndFahrenheitToCelsius);
507                 }
508                 if ((this.onFahrenheitToCelsiusCompletedDelegate == null)) {
509                         this.onFahrenheitToCelsiusCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnFahrenheitToCelsiusCompleted);
510                 }
511                 base.InvokeAsync (this.onBeginFahrenheitToCelsiusDelegate, new object[] {
512                         Fahrenheit
513                 }, this.onEndFahrenheitToCelsiusDelegate, this.onFahrenheitToCelsiusCompletedDelegate, userState);
514         }
515
516         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
517         System.IAsyncResult TempConvertSoap.BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
518         {
519                 return base.Channel.BeginCelsiusToFahrenheit (request, callback, asyncState);
520         }
521
522         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
523         private System.IAsyncResult BeginCelsiusToFahrenheit (string Celsius, System.AsyncCallback callback, object asyncState)
524         {
525                 CelsiusToFahrenheitRequest inValue = new CelsiusToFahrenheitRequest ();
526                 inValue.Body = new CelsiusToFahrenheitRequestBody ();
527                 inValue.Body.Celsius = Celsius;
528                 return ((TempConvertSoap)(this)).BeginCelsiusToFahrenheit (inValue, callback, asyncState);
529         }
530
531         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
532         CelsiusToFahrenheitResponse TempConvertSoap.EndCelsiusToFahrenheit (System.IAsyncResult result)
533         {
534                 return base.Channel.EndCelsiusToFahrenheit (result);
535         }
536
537         [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
538         private string EndCelsiusToFahrenheit (System.IAsyncResult result)
539         {
540                 CelsiusToFahrenheitResponse retVal = ((TempConvertSoap)(this)).EndCelsiusToFahrenheit (result);
541                 return retVal.Body.CelsiusToFahrenheitResult;
542         }
543
544         private System.IAsyncResult OnBeginCelsiusToFahrenheit (object[] inValues, System.AsyncCallback callback, object asyncState)
545         {
546                 string Celsius = ((string)(inValues [0]));
547                 return this.BeginCelsiusToFahrenheit (Celsius, callback, asyncState);
548         }
549
550         private object[] OnEndCelsiusToFahrenheit (System.IAsyncResult result)
551         {
552                 string retVal = this.EndCelsiusToFahrenheit (result);
553                 return new object[] {
554                         retVal
555                 };
556         }
557
558         private void OnCelsiusToFahrenheitCompleted (object state)
559         {
560                 if ((this.CelsiusToFahrenheitCompleted != null)) {
561                         InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
562                         this.CelsiusToFahrenheitCompleted (this, new CelsiusToFahrenheitCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
563                 }
564         }
565
566         public void CelsiusToFahrenheitAsync (string Celsius)
567         {
568                 this.CelsiusToFahrenheitAsync (Celsius, null);
569         }
570
571         public void CelsiusToFahrenheitAsync (string Celsius, object userState)
572         {
573                 if ((this.onBeginCelsiusToFahrenheitDelegate == null)) {
574                         this.onBeginCelsiusToFahrenheitDelegate = new BeginOperationDelegate (this.OnBeginCelsiusToFahrenheit);
575                 }
576                 if ((this.onEndCelsiusToFahrenheitDelegate == null)) {
577                         this.onEndCelsiusToFahrenheitDelegate = new EndOperationDelegate (this.OnEndCelsiusToFahrenheit);
578                 }
579                 if ((this.onCelsiusToFahrenheitCompletedDelegate == null)) {
580                         this.onCelsiusToFahrenheitCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCelsiusToFahrenheitCompleted);
581                 }
582                 base.InvokeAsync (this.onBeginCelsiusToFahrenheitDelegate, new object[] {
583                         Celsius
584                 }, this.onEndCelsiusToFahrenheitDelegate, this.onCelsiusToFahrenheitCompletedDelegate, userState);
585         }
586
587         private System.IAsyncResult OnBeginOpen (object[] inValues, System.AsyncCallback callback, object asyncState)
588         {
589                 return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen (callback, asyncState);
590         }
591
592         private object[] OnEndOpen (System.IAsyncResult result)
593         {
594                 ((System.ServiceModel.ICommunicationObject)(this)).EndOpen (result);
595                 return null;
596         }
597
598         private void OnOpenCompleted (object state)
599         {
600                 if ((this.OpenCompleted != null)) {
601                         InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
602                         this.OpenCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
603                 }
604         }
605
606         public void OpenAsync ()
607         {
608                 this.OpenAsync (null);
609         }
610
611         public void OpenAsync (object userState)
612         {
613                 if ((this.onBeginOpenDelegate == null)) {
614                         this.onBeginOpenDelegate = new BeginOperationDelegate (this.OnBeginOpen);
615                 }
616                 if ((this.onEndOpenDelegate == null)) {
617                         this.onEndOpenDelegate = new EndOperationDelegate (this.OnEndOpen);
618                 }
619                 if ((this.onOpenCompletedDelegate == null)) {
620                         this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnOpenCompleted);
621                 }
622                 base.InvokeAsync (this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
623         }
624
625         private System.IAsyncResult OnBeginClose (object[] inValues, System.AsyncCallback callback, object asyncState)
626         {
627                 return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose (callback, asyncState);
628         }
629
630         private object[] OnEndClose (System.IAsyncResult result)
631         {
632                 ((System.ServiceModel.ICommunicationObject)(this)).EndClose (result);
633                 return null;
634         }
635
636         private void OnCloseCompleted (object state)
637         {
638                 if ((this.CloseCompleted != null)) {
639                         InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
640                         this.CloseCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
641                 }
642         }
643
644         public void CloseAsync ()
645         {
646                 this.CloseAsync (null);
647         }
648
649         public void CloseAsync (object userState)
650         {
651                 if ((this.onBeginCloseDelegate == null)) {
652                         this.onBeginCloseDelegate = new BeginOperationDelegate (this.OnBeginClose);
653                 }
654                 if ((this.onEndCloseDelegate == null)) {
655                         this.onEndCloseDelegate = new EndOperationDelegate (this.OnEndClose);
656                 }
657                 if ((this.onCloseCompletedDelegate == null)) {
658                         this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCloseCompleted);
659                 }
660                 base.InvokeAsync (this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
661         }
662
663         protected override TempConvertSoap CreateChannel ()
664         {
665                 return new TempConvertSoapClientChannel (this);
666         }
667
668         private class TempConvertSoapClientChannel : ChannelBase<TempConvertSoap>, TempConvertSoap
669         {
670
671                 public TempConvertSoapClientChannel (System.ServiceModel.ClientBase<TempConvertSoap> client) :
672                 base (client)
673                 {
674                 }
675
676                 public System.IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
677                 {
678                         object[] _args = new object[1];
679                         _args [0] = request;
680                         System.IAsyncResult _result = base.BeginInvoke ("FahrenheitToCelsius", _args, callback, asyncState);
681                         return _result;
682                 }
683
684                 public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result)
685                 {
686                         object[] _args = new object[0];
687                         FahrenheitToCelsiusResponse _result = ((FahrenheitToCelsiusResponse)(base.EndInvoke ("FahrenheitToCelsius", _args, result)));
688                         return _result;
689                 }
690
691                 public System.IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
692                 {
693                         object[] _args = new object[1];
694                         _args [0] = request;
695                         System.IAsyncResult _result = base.BeginInvoke ("CelsiusToFahrenheit", _args, callback, asyncState);
696                         return _result;
697                 }
698
699                 public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result)
700                 {
701                         object[] _args = new object[0];
702                         CelsiusToFahrenheitResponse _result = ((CelsiusToFahrenheitResponse)(base.EndInvoke ("CelsiusToFahrenheit", _args, result)));
703                         return _result;
704                 }
705         }
706 }