|
|
@@ -32,6 +32,7 @@ using System.Runtime.Serialization;
|
|
|
using System.ServiceModel;
|
|
|
using System.ServiceModel.Channels;
|
|
|
using System.ServiceModel.Description;
|
|
|
+using System.Threading;
|
|
|
using System.Xml;
|
|
|
using System.Xml.Serialization;
|
|
|
using MonoTests.System.ServiceModel.Channels;
|
|
|
@@ -476,6 +477,27 @@ namespace MonoTests.System.ServiceModel
|
|
|
Assert.AreEqual ("callArg", res.resMsg.val, "#3");
|
|
|
}
|
|
|
|
|
|
+ [Test]
|
|
|
+ public void OneWayOperationWithRequestReplyChannel ()
|
|
|
+ {
|
|
|
+ var host = new ServiceHost (typeof (OneWayService));
|
|
|
+ host.AddServiceEndpoint (typeof (IOneWayService),
|
|
|
+ new BasicHttpBinding (),
|
|
|
+ new Uri ("http://localhost:8080"));
|
|
|
+ host.Open ();
|
|
|
+ try {
|
|
|
+ var cf = new ChannelFactory<IOneWayService> (
|
|
|
+ new BasicHttpBinding (),
|
|
|
+ new EndpointAddress ("http://localhost:8080"));
|
|
|
+ var ch = cf.CreateChannel ();
|
|
|
+ ch.GiveMessage ("test");
|
|
|
+
|
|
|
+ Assert.IsTrue (OneWayService.WaitHandle.WaitOne (TimeSpan.FromSeconds (5)), "#1");
|
|
|
+ } finally {
|
|
|
+ host.Close ();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[ServiceContract]
|
|
|
public interface ITestService
|
|
|
{
|
|
|
@@ -522,6 +544,23 @@ namespace MonoTests.System.ServiceModel
|
|
|
TestResult FooComplexMC (TestMessage arg1);
|
|
|
}
|
|
|
|
|
|
+ [ServiceContract]
|
|
|
+ public interface IOneWayService
|
|
|
+ {
|
|
|
+ [OperationContract (IsOneWay = true)]
|
|
|
+ void GiveMessage (string input);
|
|
|
+ }
|
|
|
+
|
|
|
+ public class OneWayService : IOneWayService
|
|
|
+ {
|
|
|
+ public static ManualResetEvent WaitHandle = new ManualResetEvent (false);
|
|
|
+
|
|
|
+ public void GiveMessage (string input)
|
|
|
+ {
|
|
|
+ WaitHandle.Set ();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public enum FooColor { Red = 1, Green, Blue }
|
|
|
|
|
|
[DataContract]
|