2 // ServiceHostBaseTest.cs
5 // Igor Zelmanovich <igorz@mainsoft.com>
7 // Copyright (C) 2008 Mainsoft, Inc. http://www.mainsoft.com
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Collections.Generic;
32 using NUnit.Framework;
33 using System.ServiceModel;
34 using System.ServiceModel.Description;
35 using System.ServiceModel.Dispatcher;
36 using SMMessage = System.ServiceModel.Channels.Message;
37 using System.ServiceModel.Channels;
39 using MonoTests.Helpers;
41 namespace MonoTests.System.ServiceModel
44 public class ServiceHostBaseTest
46 class Poker : ServiceHostBase
48 public event EventHandler OnApplyConfiguration;
50 protected override ServiceDescription CreateDescription (out IDictionary<string, ContractDescription> implementedContracts) {
51 implementedContracts = new Dictionary<string, ContractDescription> ();
52 ServiceDescription description = new ServiceDescription ();
53 description.ServiceType = typeof (MyService);
54 description.Behaviors.Add (new ServiceBehaviorAttribute ());
58 protected override void ApplyConfiguration () {
59 if (OnApplyConfiguration != null)
60 OnApplyConfiguration (this, EventArgs.Empty);
61 base.ApplyConfiguration ();
64 public void CallInitializeDescription () {
65 InitializeDescription (new UriSchemeKeyedCollection ());
68 protected override void InitializeRuntime () {
69 base.InitializeRuntime ();
72 public void CallInitializeRuntime () {
76 public void DoAddBaseAddress (Uri uri)
84 Poker host = new Poker ();
86 Assert.AreEqual (null, host.Description, "Description");
87 Assert.AreEqual (null, host.Authorization, "Authorization");
91 public void DefaultConfiguration () {
92 Poker host = new Poker ();
93 host.OnApplyConfiguration += delegate (object sender, EventArgs e) {
94 Assert.AreEqual (1, host.Description.Behaviors.Count, "Description.Behaviors.Count #1");
96 host.CallInitializeDescription ();
98 Assert.AreEqual (true, host.Description.Behaviors.Count > 1, "Description.Behaviors.Count #2");
100 Assert.IsNotNull (host.Description.Behaviors.Find<ServiceDebugBehavior> (), "ServiceDebugBehavior");
101 Assert.IsNotNull (host.Description.Behaviors.Find<ServiceAuthorizationBehavior> (), "ServiceDebugBehavior");
102 Assert.IsNotNull (host.Authorization, "Authorization #1");
104 Assert.AreEqual (host.Description.Behaviors.Find<ServiceAuthorizationBehavior> (), host.Authorization, "Authorization #2");
108 [ExpectedException (typeof (InvalidOperationException))]
109 public void ApplyConfigurationNoDescription () {
110 CustomServiceHost customHost = new CustomServiceHost ();
111 customHost.ApplyConfiguration ();
114 class CustomServiceHost : ServiceHostBase
117 public CustomServiceHost () {
121 public new void ApplyConfiguration () {
122 base.ApplyConfiguration ();
125 protected override ServiceDescription CreateDescription (out IDictionary<string, ContractDescription> implementedContracts) {
126 throw new NotImplementedException ();
131 public void InitializeRuntime () {
132 Poker host = new Poker ();
133 host.CallInitializeDescription ();
134 EndpointAddress address = new EndpointAddress ("http://localhost:8090/");
135 ContractDescription contract = ContractDescription.GetContract (typeof (IMyContract));
136 ServiceEndpoint endpoint = new ServiceEndpoint (contract, new BasicHttpBinding (), address);
137 endpoint.ListenUri = address.Uri;
138 host.Description.Endpoints.Add (endpoint);
140 Assert.AreEqual (0, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
142 host.CallInitializeRuntime ();
144 Assert.AreEqual (1, host.ChannelDispatchers.Count, "ChannelDispatchers.Count #1");
145 Assert.AreEqual (CommunicationState.Created, host.ChannelDispatchers [0].State, "ChannelDispatchers.Count #1");
149 interface IMyContract
155 class MyService : IMyContract
157 public string GetData () {
158 return "Hello World";
163 public void ChannelDispatchers_NoDebug () {
164 var ep = "http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString();
165 ServiceHost h = new ServiceHost (typeof (AllActions), new Uri (ep));
166 h.AddServiceEndpoint (typeof (AllActions).FullName, new BasicHttpBinding (), "address");
168 ServiceDebugBehavior b = h.Description.Behaviors.Find<ServiceDebugBehavior> ();
169 b.HttpHelpPageEnabled = false;
173 Assert.AreEqual (h.ChannelDispatchers.Count, 1);
174 ChannelDispatcher channelDispatcher = h.ChannelDispatchers[0] as ChannelDispatcher;
175 Assert.IsNotNull (channelDispatcher, "#1");
176 Assert.IsTrue (channelDispatcher.Endpoints.Count == 1, "#2");
177 EndpointAddressMessageFilter filter = channelDispatcher.Endpoints [0].AddressFilter as EndpointAddressMessageFilter;
178 Assert.IsNotNull (filter, "#3");
179 Assert.IsTrue (filter.Address.Equals (new EndpointAddress (ep + "/address")), "#4");
180 Assert.IsFalse (filter.IncludeHostNameInComparison, "#5");
181 Assert.IsTrue (channelDispatcher.Endpoints [0].ContractFilter is MatchAllMessageFilter, "#6");
188 public void ChannelDispatchers_WithDebug () {
189 var ep = "http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString();
190 ServiceHost h = new ServiceHost (typeof (AllActions), new Uri (ep));
191 h.AddServiceEndpoint (typeof (AllActions).FullName, new BasicHttpBinding (), "address");
192 ServiceMetadataBehavior b = new ServiceMetadataBehavior ();
193 b.HttpGetEnabled = true;
194 b.HttpGetUrl = new Uri( ep );
195 h.Description.Behaviors.Add (b);
198 Assert.AreEqual (h.ChannelDispatchers.Count, 2, "#1");
199 ChannelDispatcher channelDispatcher = h.ChannelDispatchers[1] as ChannelDispatcher;
200 Assert.IsNotNull (channelDispatcher, "#2");
201 Assert.IsTrue (channelDispatcher.Endpoints.Count == 1, "#3");
202 EndpointAddressMessageFilter filter = channelDispatcher.Endpoints [0].AddressFilter as EndpointAddressMessageFilter;
203 Assert.IsNotNull (filter, "#4");
204 Assert.IsTrue (filter.Address.Equals (new EndpointAddress (ep)), "#5");
205 Assert.IsFalse (filter.IncludeHostNameInComparison, "#6");
206 Assert.IsTrue (channelDispatcher.Endpoints [0].ContractFilter is MatchAllMessageFilter, "#7");
211 public void SpecificActionTest ()
213 //EndpointDispatcher d = new EndpointDispatcher(
214 var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
215 ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://" + ep));
216 h.AddServiceEndpoint (typeof (Action1Interface), new BasicHttpBinding (), "address");
219 ChannelDispatcher d = h.ChannelDispatchers [0] as ChannelDispatcher;
220 EndpointDispatcher ed = d.Endpoints [0] as EndpointDispatcher;
221 ActionMessageFilter actionFilter = ed.ContractFilter as ActionMessageFilter;
222 Assert.IsNotNull (actionFilter, "#1");
223 Assert.IsTrue (actionFilter.Actions.Count == 1, "#2");
228 public void InitializeRuntimeBehaviors1 () {
229 HostState st = new HostState ();
230 var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
231 ServiceHost h = new ServiceHost (typeof (SpecificAction2), new Uri ("http://" + ep));
232 h.AddServiceEndpoint (typeof (SpecificAction2), new BasicHttpBinding (), "temp");
234 h.Description.Behaviors.Add (new MyServiceBehavior (st, h));
236 h.Description.Endpoints [0].Behaviors.Add (new MyEndpointBehavior (st, h));
237 h.Description.Endpoints [0].Contract.Behaviors.Add (new MyContractBehavior (st, h));
238 h.Description.Endpoints [0].Contract.Operations [0].Behaviors.Add (new MyOperationBehavior (st, h));
243 string expected = "Start, IServiceBehavior.Validate, IContractBehavior.Validate, IEndpointBehavior.Validate, IOperationBehavior.ApplyDispatchBehavior, IServiceBehavior.AddBindingParameters, IContractBehavior.AddBindingParameters, IEndpointBehavior.AddBindingParameters, IOperationBehavior.AddBindingParameters, IServiceBehavior.ApplyDispatchBehavior, IContractBehavior.ApplyDispatchBehavior, IEndpointBehavior.ApplyDispatchBehavior, IOperationBehavior.ApplyDispatchBehavior";
244 Assert.AreEqual (expected, st.CurrentStage);
248 public void InitializeRuntimeBehaviors2 () {
249 HostState st = new HostState ();
250 var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
251 ServiceHost h = new ServiceHost (typeof (SpecificAction), new Uri ("http://" + ep));
252 h.AddServiceEndpoint (typeof (Action1Interface), new BasicHttpBinding (), "temp");
253 h.AddServiceEndpoint (typeof (Action2Interface), new BasicHttpBinding (), "temp2");
255 h.Description.Behaviors.Add (new MyServiceBehavior (st, h));
257 h.Description.Endpoints [0].Behaviors.Add (new MyEndpointBehavior (st, h));
258 h.Description.Endpoints [0].Contract.Behaviors.Add (new MyContractBehavior (st, h));
259 h.Description.Endpoints [0].Contract.Operations [0].Behaviors.Add (new MyOperationBehavior (st, h));
261 h.Description.Endpoints [1].Behaviors.Add (new MyEndpointBehavior (st, h));
262 h.Description.Endpoints [1].Contract.Behaviors.Add (new MyContractBehavior (st, h));
263 h.Description.Endpoints [1].Contract.Operations [0].Behaviors.Add (new MyOperationBehavior (st, h));
267 string expected = "Start, IServiceBehavior.Validate, IContractBehavior.Validate, IEndpointBehavior.Validate, IOperationBehavior.ApplyDispatchBehavior, IContractBehavior.Validate, IEndpointBehavior.Validate, IOperationBehavior.ApplyDispatchBehavior, IServiceBehavior.AddBindingParameters, IContractBehavior.AddBindingParameters, IEndpointBehavior.AddBindingParameters, IOperationBehavior.AddBindingParameters, IServiceBehavior.AddBindingParameters, IContractBehavior.AddBindingParameters, IEndpointBehavior.AddBindingParameters, IOperationBehavior.AddBindingParameters, IServiceBehavior.ApplyDispatchBehavior, IContractBehavior.ApplyDispatchBehavior, IEndpointBehavior.ApplyDispatchBehavior, IOperationBehavior.ApplyDispatchBehavior, IContractBehavior.ApplyDispatchBehavior, IEndpointBehavior.ApplyDispatchBehavior, IOperationBehavior.ApplyDispatchBehavior";
268 Assert.AreEqual (expected, st.CurrentStage);
272 public void AddBaseAddress ()
274 var host = new Poker ();
275 Assert.AreEqual (0, host.BaseAddresses.Count, "#1");
276 host.DoAddBaseAddress (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()));
277 Assert.AreEqual (1, host.BaseAddresses.Count, "#1");
278 host.DoAddBaseAddress (new Uri ("net.tcp://localhost:" + NetworkHelpers.FindFreePort ()));
279 Assert.AreEqual (2, host.BaseAddresses.Count, "#1");
283 [ExpectedException (typeof (ArgumentException))]
284 public void AddBaseAddress2 ()
286 var host = new Poker ();
287 Assert.AreEqual (0, host.BaseAddresses.Count, "#1");
288 host.DoAddBaseAddress (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()));
289 // http base address is already added.
290 host.DoAddBaseAddress (new Uri ("http://localhost:" + NetworkHelpers.FindFreePort ()));
294 public void AddServiceEndpointUri ()
296 int port = NetworkHelpers.FindFreePort ();
297 var host = new ServiceHost (typeof (AllActions),
298 new Uri ("http://localhost:" + port));
299 var se = host.AddServiceEndpoint (typeof (AllActions),
300 new BasicHttpBinding (), "foobar");
301 Assert.AreEqual ("http://localhost:" + port + "/foobar", se.Address.Uri.AbsoluteUri, "#1");
302 Assert.AreEqual ("http://localhost:" + port + "/foobar", se.ListenUri.AbsoluteUri, "#2");
306 public void AddServiceEndpointUri2 ()
308 int port = NetworkHelpers.FindFreePort ();
309 var host = new ServiceHost (typeof (AllActions),
310 new Uri ("http://localhost:" + port));
311 var se = host.AddServiceEndpoint (typeof (AllActions),
312 new BasicHttpBinding (), String.Empty);
313 Assert.AreEqual ("http://localhost:" + port + "/", se.Address.Uri.AbsoluteUri, "#1");
314 Assert.AreEqual ("http://localhost:" + port + "/", se.ListenUri.AbsoluteUri, "#2");
318 [ExpectedException (typeof (InvalidOperationException))]
319 public void AddServiceEndpointOnlyMex ()
321 var ep = NetworkHelpers.LocalEphemeralEndPoint().ToString();
322 var host = new ServiceHost (typeof (AllActions),
323 new Uri ("http://" + ep));
324 host.Description.Behaviors.Add (new ServiceMetadataBehavior ());
325 host.AddServiceEndpoint ("IMetadataExchange",
326 new BasicHttpBinding (), "/wsdl");
329 // to make sure that throwing IOE from here does not count.
333 Assert.Fail ("should not open");
337 [Category ("NotWorking")] // Timeouts randomly #5813
338 public void RunDestinationUnreachableTest ()
340 RunDestinationUnreachableTest ("BasicHttp", new BasicHttpBinding ());
344 [Category ("NotWorking")] // Timeouts randomly #5813
345 public void RunDestinationUnreachableTest2 ()
347 RunDestinationUnreachableTest ("CustomSoap12", new CustomBinding (new HttpTransportBindingElement ()));
350 void RunDestinationUnreachableTest (string label, Binding binding)
352 string address = "http://" + NetworkHelpers.LocalEphemeralEndPoint().ToString();
353 var host = OpenHost (address, binding);
356 var client = new DestinationUnreachableClient (binding, address);
357 client.NotImplementedOperation ();
358 Assert.Fail (label + " ActionNotSupportedException is expected");
359 } catch (ActionNotSupportedException) {
360 // catching it instead of ExpectedException to distinguish errors at service side.
366 ServiceHost OpenHost (string address, Binding binding)
368 var baseAddresses = new Uri[] { new Uri(address) };
370 var host = new ServiceHost (typeof (DummyService), baseAddresses);
371 host.AddServiceEndpoint (typeof (IDummyService), binding, new Uri ("", UriKind.Relative));
377 public void AddServiceEndpoint_Directly ()
379 var host = new ServiceHost (typeof (DummyService));
380 var address = new EndpointAddress ("http://localhost:30158");
381 var binding = new BasicHttpBinding ();
382 var contract = ContractDescription.GetContract (typeof (IDummyService));
383 host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));
387 [ExpectedException (typeof (ArgumentException))]
388 public void AddServiceEndpoint_Directly_NullAddress ()
390 var host = new ServiceHost (typeof (DummyService));
391 var binding = new BasicHttpBinding ();
392 var contract = ContractDescription.GetContract (typeof (IDummyService));
393 host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, null));
397 [ExpectedException (typeof (ArgumentException))]
398 public void AddServiceEndpoint_Directly_NullBinding ()
400 var host = new ServiceHost (typeof (DummyService));
401 var address = new EndpointAddress ("http://localhost:30158");
402 var contract = ContractDescription.GetContract (typeof (IDummyService));
403 host.AddServiceEndpoint (new ServiceEndpoint (contract, null, address));
407 [ExpectedException (typeof (ArgumentException))]
408 public void AddServiceMetadataEndpoint ()
410 var host = new ServiceHost (typeof (DummyService));
411 host.AddServiceEndpoint (new ServiceMetadataEndpoint ());
415 [ExpectedException (typeof (InvalidOperationException))]
416 public void AddServiceEndpoint_Directly_ContractMismatch ()
418 var host = new ServiceHost (typeof (DummyService));
419 var address = new EndpointAddress ("http://localhost:30158");
420 var binding = new BasicHttpBinding ();
421 var contract = ContractDescription.GetContract (typeof (INotImplementedService));
422 host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));
431 public class HostState
433 public string CurrentStage = "Start";
436 public class MyServiceBehavior : IServiceBehavior
438 #region IServiceBehavior Members
442 public MyServiceBehavior (HostState state, ServiceHost h) {
447 public void AddBindingParameters (ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, global::System.Collections.ObjectModel.Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters) {
448 _state.CurrentStage += ", IServiceBehavior.AddBindingParameters";
449 bindingParameters.Add (this);
452 public void ApplyDispatchBehavior (ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) {
453 _state.CurrentStage += ", IServiceBehavior.ApplyDispatchBehavior";
456 public void Validate (ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) {
457 _state.CurrentStage += ", IServiceBehavior.Validate";
458 Assert.AreEqual (_host.ChannelDispatchers.Count, 0);
464 public class MyEndpointBehavior : IEndpointBehavior
466 #region IEndpointBehavior Members
469 public MyEndpointBehavior (HostState state, ServiceHost h) {
474 public void AddBindingParameters (ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) {
475 Console.WriteLine ("IEndpointBehavior - AddBindingParameters " + _host.ChannelDispatchers.Count);
476 _state.CurrentStage += ", IEndpointBehavior.AddBindingParameters";
477 bindingParameters.Add (this);
480 public void ApplyClientBehavior (ServiceEndpoint endpoint, ClientRuntime clientRuntime) {
481 Console.WriteLine ("IEndpointBehavior - ApplyClientBehavior " + _host.ChannelDispatchers.Count);
484 public void ApplyDispatchBehavior (ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) {
485 Console.WriteLine ("IEndpointBehavior - ApplyDispatchBehavior " + _host.ChannelDispatchers.Count);
486 _state.CurrentStage += ", IEndpointBehavior.ApplyDispatchBehavior";
489 public void Validate (ServiceEndpoint endpoint) {
490 Console.WriteLine ("IEndpointBehavior - Validate " + _host.ChannelDispatchers.Count);
491 _state.CurrentStage += ", IEndpointBehavior.Validate";
492 Assert.AreEqual (_host.ChannelDispatchers.Count, 0);
498 public class MyContractBehavior : IContractBehavior
500 #region IContractBehavior Members
503 public MyContractBehavior (HostState state, ServiceHost h) {
508 public void AddBindingParameters (ContractDescription contractDescription, ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) {
509 Console.WriteLine ("Contract - AddBindingParameters " + _host.ChannelDispatchers.Count);
510 _state.CurrentStage += ", IContractBehavior.AddBindingParameters";
511 bindingParameters.Add (this);
514 public void ApplyClientBehavior (ContractDescription contractDescription, ServiceEndpoint endpoint, ClientRuntime clientRuntime) {
515 Console.WriteLine ("Contract - ApplyClientBehavior " + _host.ChannelDispatchers.Count);
518 public void ApplyDispatchBehavior (ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime) {
519 Console.WriteLine ("Contract - ApplyDispatchBehavior " + _host.ChannelDispatchers.Count);
520 _state.CurrentStage += ", IContractBehavior.ApplyDispatchBehavior";
523 public void Validate (ContractDescription contractDescription, ServiceEndpoint endpoint) {
524 Console.WriteLine ("Contract - Validate " + _host.ChannelDispatchers.Count);
525 _state.CurrentStage += ", IContractBehavior.Validate";
526 Assert.AreEqual (_host.ChannelDispatchers.Count, 0);
532 public class MyOperationBehavior : IOperationBehavior
534 #region IOperationBehavior Members
537 public MyOperationBehavior (HostState state, ServiceHost h) {
542 public void AddBindingParameters (OperationDescription operationDescription, BindingParameterCollection bindingParameters) {
543 Console.WriteLine ("IOperationBehavior - AddBindingParameters " + _host.ChannelDispatchers.Count);
544 _state.CurrentStage += ", IOperationBehavior.AddBindingParameters";
545 bindingParameters.Add (this);
548 public void ApplyClientBehavior (OperationDescription operationDescription, ClientOperation clientOperation) {
549 Console.WriteLine ("IOperationBehavior - ApplyClientBehavior " + _host.ChannelDispatchers.Count);
552 public void ApplyDispatchBehavior (OperationDescription operationDescription, DispatchOperation dispatchOperation) {
553 Console.WriteLine ("IOperationBehavior - ApplyDispatchBehavior " + _host.ChannelDispatchers.Count);
554 _state.CurrentStage += ", IOperationBehavior.ApplyDispatchBehavior";
557 public void Validate (OperationDescription operationDescription) {
558 Console.WriteLine ("IOperationBehavior - Validate " + _host.ChannelDispatchers.Count);
559 _state.CurrentStage += ", IOperationBehavior.ApplyDispatchBehavior";
560 Assert.AreEqual (_host.ChannelDispatchers.Count, 0);
569 [OperationContract (Action = "*", ReplyAction = "*")]
570 public SMMessage Get (SMMessage req) {
576 interface Action1Interface
578 [OperationContract (Action = "Specific1", ReplyAction = "*")]
579 SMMessage GetMessage1 (SMMessage req);
583 interface Action2Interface
585 [OperationContract (Action = "Specific2", ReplyAction = "*")]
586 SMMessage GetMessage2 (SMMessage req);
589 class SpecificAction : Action1Interface, Action2Interface
591 public SMMessage GetMessage1 (SMMessage req) {
595 public SMMessage GetMessage2 (SMMessage req) {
601 class SpecificAction2
603 [OperationContract (Action = "Specific", ReplyAction = "*")]
604 public SMMessage GetMessage1 (SMMessage req) {
609 class MyChannelDispatcher : ChannelDispatcher
611 public bool Attached = false;
613 public MyChannelDispatcher (IChannelListener l) : base (l) { }
614 protected override void Attach (ServiceHostBase host) {
620 class MyChannelListener : IChannelListener
622 #region IChannelListener Members
624 public IAsyncResult BeginWaitForChannel (TimeSpan timeout, AsyncCallback callback, object state) {
625 throw new NotImplementedException ();
628 public bool EndWaitForChannel (IAsyncResult result) {
629 throw new NotImplementedException ();
632 public T GetProperty<T> () where T : class {
633 throw new NotImplementedException ();
637 get { throw new NotImplementedException (); }
640 public bool WaitForChannel (TimeSpan timeout) {
641 throw new NotImplementedException ();
646 #region ICommunicationObject Members
648 public void Abort () {
649 throw new NotImplementedException ();
652 public IAsyncResult BeginClose (TimeSpan timeout, AsyncCallback callback, object state) {
653 throw new NotImplementedException ();
656 public IAsyncResult BeginClose (AsyncCallback callback, object state) {
657 throw new NotImplementedException ();
660 public IAsyncResult BeginOpen (TimeSpan timeout, AsyncCallback callback, object state) {
661 throw new NotImplementedException ();
664 public IAsyncResult BeginOpen (AsyncCallback callback, object state) {
665 throw new NotImplementedException ();
668 public void Close (TimeSpan timeout) {
669 throw new NotImplementedException ();
672 public void Close () {
673 throw new NotImplementedException ();
676 public event EventHandler Closed;
678 public event EventHandler Closing;
680 public void EndClose (IAsyncResult result) {
681 throw new NotImplementedException ();
684 public void EndOpen (IAsyncResult result) {
685 throw new NotImplementedException ();
688 public event EventHandler Faulted;
690 public void Open (TimeSpan timeout) {
691 throw new NotImplementedException ();
694 public void Open () {
695 throw new NotImplementedException ();
698 public event EventHandler Opened;
700 public event EventHandler Opening;
702 public CommunicationState State {
703 get { throw new NotImplementedException (); }
710 public interface IDummyService
713 void DummyOperation ();
715 public class DummyService : IDummyService
717 public void DummyOperation ()
723 public interface INotImplementedService
726 void NotImplementedOperation ();
728 public class DestinationUnreachableClient : ClientBase<INotImplementedService>, INotImplementedService
730 public void NotImplementedOperation ()
732 Channel.NotImplementedOperation ();
735 public DestinationUnreachableClient (Binding binding, string address)
736 : base (binding, new EndpointAddress (address))