Author: atsushi
Date: 2008-02-07 11:31:59 -0500 (Thu, 07 Feb 2008)
New Revision: 95153
Added:
trunk/olive/samples/services/web-http-binding/
trunk/olive/samples/services/web-http-binding/ChangeLog
trunk/olive/samples/services/web-http-binding/Makefile
trunk/olive/samples/services/web-http-binding/samplecli.cs
trunk/olive/samples/services/web-http-binding/samplesvc.cs
Log:
2008-02-07 Atsushi Enomoto <[EMAIL PROTECTED]>
* Makefile : new.
* samplesvc.cs, samplecli.cs : new sample (runs on .net, not mono yet).
Added: trunk/olive/samples/services/web-http-binding/ChangeLog
===================================================================
--- trunk/olive/samples/services/web-http-binding/ChangeLog 2008-02-07
16:28:29 UTC (rev 95152)
+++ trunk/olive/samples/services/web-http-binding/ChangeLog 2008-02-07
16:31:59 UTC (rev 95153)
@@ -0,0 +1,4 @@
+2008-02-07 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * Makefile : new.
+ * samplesvc.cs, samplecli.cs : new sample (runs on .net, not mono yet).
Added: trunk/olive/samples/services/web-http-binding/Makefile
===================================================================
--- trunk/olive/samples/services/web-http-binding/Makefile 2008-02-07
16:28:29 UTC (rev 95152)
+++ trunk/olive/samples/services/web-http-binding/Makefile 2008-02-07
16:31:59 UTC (rev 95153)
@@ -0,0 +1,10 @@
+all: samplesvc.exe samplecli.exe
+
+samplesvc.exe : samplesvc.cs
+ gmcs -pkg:olive samplesvc.cs
+
+samplecli.exe : samplecli.cs
+ gmcs -pkg:olive samplecli.cs
+
+clean:
+ rm -rf samplecli.exe samplesvc.exe
Property changes on: trunk/olive/samples/services/web-http-binding/Makefile
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/olive/samples/services/web-http-binding/samplecli.cs
===================================================================
--- trunk/olive/samples/services/web-http-binding/samplecli.cs 2008-02-07
16:28:29 UTC (rev 95152)
+++ trunk/olive/samples/services/web-http-binding/samplecli.cs 2008-02-07
16:31:59 UTC (rev 95153)
@@ -0,0 +1,37 @@
+using System;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using System.ServiceModel.Web;
+
+public class Test
+{
+ // It is not working with mono!
+ public static void Main ()
+ {
+ string url = "http://localhsot:8080";
+ WebHttpBinding b = new WebHttpBinding ();
+ var f = new WebChannelFactory<IMyService> (b, new Uri (url));
+ // this causes NRE (even if the endpointaddress is specified at
CreateChannel()).
+ // var f = new WebChannelFactory<IMyService> (b);
+ f.Endpoint.Behaviors.Add (new WebHttpBehavior ());
+ IMyService s = f.CreateChannel ();
+ Console.WriteLine (s.Greet ("hogehoge"));
+ }
+}
+
+[ServiceContract]
+public interface IMyService
+{
+ [OperationContract]
+ [WebGet]
+ string Greet (string input);
+}
+
+public class MyService : IMyService
+{
+ public string Greet (string input)
+ {
+ return "huh? " + input;
+ }
+}
+
Property changes on: trunk/olive/samples/services/web-http-binding/samplecli.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/olive/samples/services/web-http-binding/samplesvc.cs
===================================================================
--- trunk/olive/samples/services/web-http-binding/samplesvc.cs 2008-02-07
16:28:29 UTC (rev 95152)
+++ trunk/olive/samples/services/web-http-binding/samplesvc.cs 2008-02-07
16:31:59 UTC (rev 95153)
@@ -0,0 +1,34 @@
+using System;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using System.ServiceModel.Web;
+
+public class Test
+{
+ // It is not working with mono!
+ public static void Main ()
+ {
+ string url = "http://localhost:8080/";
+ WebHttpBinding b = new WebHttpBinding ();
+ var host = new WebServiceHost (typeof (MyService), new Uri
(url));
+ host.AddServiceEndpoint ("MyService", b, "");
+ host.Description.Behaviors.Find<ServiceDebugBehavior>
().IncludeExceptionDetailInFaults = true;
+ host.Description.Behaviors.Find<ServiceDebugBehavior>
().HttpHelpPageEnabled = true;
+ host.Open ();
+ Console.WriteLine ("--- enter ---");
+ Console.ReadLine ();
+ host.Close ();
+ }
+}
+
+[ServiceContract]
+public class MyService
+{
+ [OperationContract]
+ [WebGet]
+ public string Greet (string input)
+ {
+ return "huh? " + input;
+ }
+}
+
Property changes on: trunk/olive/samples/services/web-http-binding/samplesvc.cs
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches