3 // Martin Baulig <martin.baulig@xamarin.com>
5 // Copyright (c) 2015 Xamarin, Inc.
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:
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
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
25 using System.Collections.Generic;
27 using System.Runtime.Serialization;
28 using System.ServiceModel;
29 using System.ServiceModel.Description;
30 using System.Threading;
31 using NUnit.Framework;
33 using WebServiceMoonlightTest.ServiceReference1;
35 using MonoTests.Helpers;
37 namespace MonoTests.System.ServiceModel.Dispatcher
43 public void Bug32886_Test () // test in one of the comment
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);
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");
60 var binding = new BasicHttpBinding ();
61 var remoteAddress = new EndpointAddress ("http://localhost:" + port + "/TempConvertSoap");
62 var client = new TempConvertSoapClient (binding, remoteAddress);
64 var wait = new ManualResetEvent (false);
65 client.CelsiusToFahrenheitCompleted += delegate (object o, CelsiusToFahrenheitCompletedEventArgs e) {
68 Assert.AreEqual ("76.1", e.Result, "#1");
72 client.CelsiusToFahrenheitAsync ("24.5");
73 if (!wait.WaitOne (TimeSpan.FromSeconds (20)))
74 Assert.Fail ("timeout");
80 class TempConvertSoapImpl : TempConvertSoap
82 public FahrenheitToCelsiusResponse FarenheitToCelsius (FahrenheitToCelsiusRequest request)
84 var farenheit = double.Parse (request.Body.Fahrenheit);
85 var celsius = ((farenheit - 32) / 9) * 5;
86 return new FahrenheitToCelsiusResponse (new FahrenheitToCelsiusResponseBody (celsius.ToString ()));
89 public CelsiusToFahrenheitResponse CelsiusToFarenheit (CelsiusToFahrenheitRequest request)
91 var celsius = double.Parse (request.Body.Celsius);
92 var farenheit = ((celsius * 9) / 5) + 32;
93 return new CelsiusToFahrenheitResponse (new CelsiusToFahrenheitResponseBody (farenheit.ToString ()));
96 Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> farenheitToCelsius;
97 Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> celsiusToFarenheit;
99 public IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, AsyncCallback callback, object asyncState)
101 if (farenheitToCelsius == null)
102 farenheitToCelsius = new Func<FahrenheitToCelsiusRequest,FahrenheitToCelsiusResponse> (FarenheitToCelsius);
103 return farenheitToCelsius.BeginInvoke (request, callback, asyncState);
106 public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (IAsyncResult result)
108 return farenheitToCelsius.EndInvoke (result);
111 public IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, AsyncCallback callback, object asyncState)
113 if (celsiusToFarenheit == null)
114 celsiusToFarenheit = new Func<CelsiusToFahrenheitRequest,CelsiusToFahrenheitResponse> (CelsiusToFarenheit);
115 return celsiusToFarenheit.BeginInvoke (request, callback, asyncState);
118 public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (IAsyncResult result)
120 return celsiusToFarenheit.EndInvoke (result);
126 //------------------------------------------------------------------------------
128 // This code was generated by a tool.
129 // Runtime Version:4.0.30319.34003
131 // Changes to this file may cause incorrect behavior and will be lost if
132 // the code is regenerated.
134 //------------------------------------------------------------------------------
137 // This code was auto-generated by SlSvcUtil, version 5.0.61118.0
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
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);
149 FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result);
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);
154 CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result);
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
164 [System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsius", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
165 public FahrenheitToCelsiusRequestBody Body;
167 public FahrenheitToCelsiusRequest ()
171 public FahrenheitToCelsiusRequest (FahrenheitToCelsiusRequestBody Body)
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
184 [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
185 public string Fahrenheit;
187 public FahrenheitToCelsiusRequestBody ()
191 public FahrenheitToCelsiusRequestBody (string Fahrenheit)
193 this.Fahrenheit = Fahrenheit;
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
204 [System.ServiceModel.MessageBodyMemberAttribute (Name = "FahrenheitToCelsiusResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
205 public FahrenheitToCelsiusResponseBody Body;
207 public FahrenheitToCelsiusResponse ()
211 public FahrenheitToCelsiusResponse (FahrenheitToCelsiusResponseBody Body)
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
224 [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
225 public string FahrenheitToCelsiusResult;
227 public FahrenheitToCelsiusResponseBody ()
231 public FahrenheitToCelsiusResponseBody (string FahrenheitToCelsiusResult)
233 this.FahrenheitToCelsiusResult = FahrenheitToCelsiusResult;
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
244 [System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheit", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
245 public CelsiusToFahrenheitRequestBody Body;
247 public CelsiusToFahrenheitRequest ()
251 public CelsiusToFahrenheitRequest (CelsiusToFahrenheitRequestBody Body)
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
264 [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
265 public string Celsius;
267 public CelsiusToFahrenheitRequestBody ()
271 public CelsiusToFahrenheitRequestBody (string Celsius)
273 this.Celsius = Celsius;
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
284 [System.ServiceModel.MessageBodyMemberAttribute (Name = "CelsiusToFahrenheitResponse", Namespace = "http://www.w3schools.com/webservices/", Order = 0)]
285 public CelsiusToFahrenheitResponseBody Body;
287 public CelsiusToFahrenheitResponse ()
291 public CelsiusToFahrenheitResponse (CelsiusToFahrenheitResponseBody Body)
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
304 [System.Runtime.Serialization.DataMemberAttribute (EmitDefaultValue = false, Order = 0)]
305 public string CelsiusToFahrenheitResult;
307 public CelsiusToFahrenheitResponseBody ()
311 public CelsiusToFahrenheitResponseBody (string CelsiusToFahrenheitResult)
313 this.CelsiusToFahrenheitResult = CelsiusToFahrenheitResult;
317 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
318 public interface TempConvertSoapChannel : TempConvertSoap, System.ServiceModel.IClientChannel
322 [System.Diagnostics.DebuggerStepThroughAttribute ()]
323 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
324 public partial class FahrenheitToCelsiusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
327 private object[] results;
329 public FahrenheitToCelsiusCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
330 base (exception, cancelled, userState)
332 this.results = results;
335 public string Result {
337 base.RaiseExceptionIfNecessary ();
338 return ((string)(this.results [0]));
343 [System.Diagnostics.DebuggerStepThroughAttribute ()]
344 [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "4.0.0.0")]
345 public partial class CelsiusToFahrenheitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
348 private object[] results;
350 public CelsiusToFahrenheitCompletedEventArgs (object[] results, System.Exception exception, bool cancelled, object userState) :
351 base (exception, cancelled, userState)
353 this.results = results;
356 public string Result {
358 base.RaiseExceptionIfNecessary ();
359 return ((string)(this.results [0]));
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
369 private BeginOperationDelegate onBeginFahrenheitToCelsiusDelegate;
371 private EndOperationDelegate onEndFahrenheitToCelsiusDelegate;
373 private System.Threading.SendOrPostCallback onFahrenheitToCelsiusCompletedDelegate;
375 private BeginOperationDelegate onBeginCelsiusToFahrenheitDelegate;
377 private EndOperationDelegate onEndCelsiusToFahrenheitDelegate;
379 private System.Threading.SendOrPostCallback onCelsiusToFahrenheitCompletedDelegate;
381 private BeginOperationDelegate onBeginOpenDelegate;
383 private EndOperationDelegate onEndOpenDelegate;
385 private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
387 private BeginOperationDelegate onBeginCloseDelegate;
389 private EndOperationDelegate onEndCloseDelegate;
391 private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
393 public TempConvertSoapClient ()
397 public TempConvertSoapClient (string endpointConfigurationName) :
398 base (endpointConfigurationName)
402 public TempConvertSoapClient (string endpointConfigurationName, string remoteAddress) :
403 base (endpointConfigurationName, remoteAddress)
407 public TempConvertSoapClient (string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
408 base (endpointConfigurationName, remoteAddress)
412 public TempConvertSoapClient (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
413 base (binding, remoteAddress)
417 public System.Net.CookieContainer CookieContainer {
419 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
420 if ((httpCookieContainerManager != null)) {
421 return httpCookieContainerManager.CookieContainer;
427 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager> ();
428 if ((httpCookieContainerManager != null)) {
429 httpCookieContainerManager.CookieContainer = value;
431 throw new System.InvalidOperationException ("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
432 "ookieContainerBindingElement.");
437 public event System.EventHandler<FahrenheitToCelsiusCompletedEventArgs> FahrenheitToCelsiusCompleted;
439 public event System.EventHandler<CelsiusToFahrenheitCompletedEventArgs> CelsiusToFahrenheitCompleted;
441 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
443 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
445 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
446 System.IAsyncResult TempConvertSoap.BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
448 return base.Channel.BeginFahrenheitToCelsius (request, callback, asyncState);
451 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
452 private System.IAsyncResult BeginFahrenheitToCelsius (string Fahrenheit, System.AsyncCallback callback, object asyncState)
454 FahrenheitToCelsiusRequest inValue = new FahrenheitToCelsiusRequest ();
455 inValue.Body = new FahrenheitToCelsiusRequestBody ();
456 inValue.Body.Fahrenheit = Fahrenheit;
457 return ((TempConvertSoap)(this)).BeginFahrenheitToCelsius (inValue, callback, asyncState);
460 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
461 FahrenheitToCelsiusResponse TempConvertSoap.EndFahrenheitToCelsius (System.IAsyncResult result)
463 return base.Channel.EndFahrenheitToCelsius (result);
466 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
467 private string EndFahrenheitToCelsius (System.IAsyncResult result)
469 FahrenheitToCelsiusResponse retVal = ((TempConvertSoap)(this)).EndFahrenheitToCelsius (result);
470 return retVal.Body.FahrenheitToCelsiusResult;
473 private System.IAsyncResult OnBeginFahrenheitToCelsius (object[] inValues, System.AsyncCallback callback, object asyncState)
475 string Fahrenheit = ((string)(inValues [0]));
476 return this.BeginFahrenheitToCelsius (Fahrenheit, callback, asyncState);
479 private object[] OnEndFahrenheitToCelsius (System.IAsyncResult result)
481 string retVal = this.EndFahrenheitToCelsius (result);
482 return new object[] {
487 private void OnFahrenheitToCelsiusCompleted (object state)
489 if ((this.FahrenheitToCelsiusCompleted != null)) {
490 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
491 this.FahrenheitToCelsiusCompleted (this, new FahrenheitToCelsiusCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
495 public void FahrenheitToCelsiusAsync (string Fahrenheit)
497 this.FahrenheitToCelsiusAsync (Fahrenheit, null);
500 public void FahrenheitToCelsiusAsync (string Fahrenheit, object userState)
502 if ((this.onBeginFahrenheitToCelsiusDelegate == null)) {
503 this.onBeginFahrenheitToCelsiusDelegate = new BeginOperationDelegate (this.OnBeginFahrenheitToCelsius);
505 if ((this.onEndFahrenheitToCelsiusDelegate == null)) {
506 this.onEndFahrenheitToCelsiusDelegate = new EndOperationDelegate (this.OnEndFahrenheitToCelsius);
508 if ((this.onFahrenheitToCelsiusCompletedDelegate == null)) {
509 this.onFahrenheitToCelsiusCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnFahrenheitToCelsiusCompleted);
511 base.InvokeAsync (this.onBeginFahrenheitToCelsiusDelegate, new object[] {
513 }, this.onEndFahrenheitToCelsiusDelegate, this.onFahrenheitToCelsiusCompletedDelegate, userState);
516 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
517 System.IAsyncResult TempConvertSoap.BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
519 return base.Channel.BeginCelsiusToFahrenheit (request, callback, asyncState);
522 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
523 private System.IAsyncResult BeginCelsiusToFahrenheit (string Celsius, System.AsyncCallback callback, object asyncState)
525 CelsiusToFahrenheitRequest inValue = new CelsiusToFahrenheitRequest ();
526 inValue.Body = new CelsiusToFahrenheitRequestBody ();
527 inValue.Body.Celsius = Celsius;
528 return ((TempConvertSoap)(this)).BeginCelsiusToFahrenheit (inValue, callback, asyncState);
531 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
532 CelsiusToFahrenheitResponse TempConvertSoap.EndCelsiusToFahrenheit (System.IAsyncResult result)
534 return base.Channel.EndCelsiusToFahrenheit (result);
537 [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
538 private string EndCelsiusToFahrenheit (System.IAsyncResult result)
540 CelsiusToFahrenheitResponse retVal = ((TempConvertSoap)(this)).EndCelsiusToFahrenheit (result);
541 return retVal.Body.CelsiusToFahrenheitResult;
544 private System.IAsyncResult OnBeginCelsiusToFahrenheit (object[] inValues, System.AsyncCallback callback, object asyncState)
546 string Celsius = ((string)(inValues [0]));
547 return this.BeginCelsiusToFahrenheit (Celsius, callback, asyncState);
550 private object[] OnEndCelsiusToFahrenheit (System.IAsyncResult result)
552 string retVal = this.EndCelsiusToFahrenheit (result);
553 return new object[] {
558 private void OnCelsiusToFahrenheitCompleted (object state)
560 if ((this.CelsiusToFahrenheitCompleted != null)) {
561 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
562 this.CelsiusToFahrenheitCompleted (this, new CelsiusToFahrenheitCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
566 public void CelsiusToFahrenheitAsync (string Celsius)
568 this.CelsiusToFahrenheitAsync (Celsius, null);
571 public void CelsiusToFahrenheitAsync (string Celsius, object userState)
573 if ((this.onBeginCelsiusToFahrenheitDelegate == null)) {
574 this.onBeginCelsiusToFahrenheitDelegate = new BeginOperationDelegate (this.OnBeginCelsiusToFahrenheit);
576 if ((this.onEndCelsiusToFahrenheitDelegate == null)) {
577 this.onEndCelsiusToFahrenheitDelegate = new EndOperationDelegate (this.OnEndCelsiusToFahrenheit);
579 if ((this.onCelsiusToFahrenheitCompletedDelegate == null)) {
580 this.onCelsiusToFahrenheitCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCelsiusToFahrenheitCompleted);
582 base.InvokeAsync (this.onBeginCelsiusToFahrenheitDelegate, new object[] {
584 }, this.onEndCelsiusToFahrenheitDelegate, this.onCelsiusToFahrenheitCompletedDelegate, userState);
587 private System.IAsyncResult OnBeginOpen (object[] inValues, System.AsyncCallback callback, object asyncState)
589 return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen (callback, asyncState);
592 private object[] OnEndOpen (System.IAsyncResult result)
594 ((System.ServiceModel.ICommunicationObject)(this)).EndOpen (result);
598 private void OnOpenCompleted (object state)
600 if ((this.OpenCompleted != null)) {
601 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
602 this.OpenCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
606 public void OpenAsync ()
608 this.OpenAsync (null);
611 public void OpenAsync (object userState)
613 if ((this.onBeginOpenDelegate == null)) {
614 this.onBeginOpenDelegate = new BeginOperationDelegate (this.OnBeginOpen);
616 if ((this.onEndOpenDelegate == null)) {
617 this.onEndOpenDelegate = new EndOperationDelegate (this.OnEndOpen);
619 if ((this.onOpenCompletedDelegate == null)) {
620 this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnOpenCompleted);
622 base.InvokeAsync (this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
625 private System.IAsyncResult OnBeginClose (object[] inValues, System.AsyncCallback callback, object asyncState)
627 return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose (callback, asyncState);
630 private object[] OnEndClose (System.IAsyncResult result)
632 ((System.ServiceModel.ICommunicationObject)(this)).EndClose (result);
636 private void OnCloseCompleted (object state)
638 if ((this.CloseCompleted != null)) {
639 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
640 this.CloseCompleted (this, new System.ComponentModel.AsyncCompletedEventArgs (e.Error, e.Cancelled, e.UserState));
644 public void CloseAsync ()
646 this.CloseAsync (null);
649 public void CloseAsync (object userState)
651 if ((this.onBeginCloseDelegate == null)) {
652 this.onBeginCloseDelegate = new BeginOperationDelegate (this.OnBeginClose);
654 if ((this.onEndCloseDelegate == null)) {
655 this.onEndCloseDelegate = new EndOperationDelegate (this.OnEndClose);
657 if ((this.onCloseCompletedDelegate == null)) {
658 this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnCloseCompleted);
660 base.InvokeAsync (this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
663 protected override TempConvertSoap CreateChannel ()
665 return new TempConvertSoapClientChannel (this);
668 private class TempConvertSoapClientChannel : ChannelBase<TempConvertSoap>, TempConvertSoap
671 public TempConvertSoapClientChannel (System.ServiceModel.ClientBase<TempConvertSoap> client) :
676 public System.IAsyncResult BeginFahrenheitToCelsius (FahrenheitToCelsiusRequest request, System.AsyncCallback callback, object asyncState)
678 object[] _args = new object[1];
680 System.IAsyncResult _result = base.BeginInvoke ("FahrenheitToCelsius", _args, callback, asyncState);
684 public FahrenheitToCelsiusResponse EndFahrenheitToCelsius (System.IAsyncResult result)
686 object[] _args = new object[0];
687 FahrenheitToCelsiusResponse _result = ((FahrenheitToCelsiusResponse)(base.EndInvoke ("FahrenheitToCelsius", _args, result)));
691 public System.IAsyncResult BeginCelsiusToFahrenheit (CelsiusToFahrenheitRequest request, System.AsyncCallback callback, object asyncState)
693 object[] _args = new object[1];
695 System.IAsyncResult _result = base.BeginInvoke ("CelsiusToFahrenheit", _args, callback, asyncState);
699 public CelsiusToFahrenheitResponse EndCelsiusToFahrenheit (System.IAsyncResult result)
701 object[] _args = new object[0];
702 CelsiusToFahrenheitResponse _result = ((CelsiusToFahrenheitResponse)(base.EndInvoke ("CelsiusToFahrenheit", _args, result)));