2004-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / WebServiceHandler.cs
1 // \r
2 // System.Web.Services.Protocols.WebServiceHandler.cs\r
3 //\r
4 // Author:\r
5 //   Tim Coleman (tim@timcoleman.com)\r
6 //   Lluis Sanchez Gual (lluis@ximian.com)\r
7 //\r
8 // Copyright (C) Tim Coleman, 2002\r
9 //\r
10 \r
11 using System;\r
12 using System.Reflection;\r
13 using System.Web;
14 using System.Web.Services;\r
15 using System.Web.SessionState;\r
16 \r
17 namespace System.Web.Services.Protocols \r
18 {\r
19         internal class WebServiceHandler: IHttpHandler \r
20         {\r
21                 Type _type;\r
22                 HttpContext _context;
23                 HttpSessionState session;
24
25                 \r
26                 public WebServiceHandler (Type type)\r
27                 {\r
28                         _type = type;\r
29                 }\r
30 \r
31                 public Type ServiceType\r
32                 {\r
33                         get { return _type; }\r
34                 }\r
35                 \r
36                 public virtual bool IsReusable \r
37                 {\r
38                         get { return false; }\r
39                 }\r
40
41                 protected HttpContext Context {
42                         set { _context = value; }
43                 }
44
45                 protected HttpSessionState Session {
46                         set { this.session = value; }
47                 }
48 \r
49                 public virtual void ProcessRequest (HttpContext context)\r
50                 {\r
51                 }\r
52                 \r
53                 protected object CreateServerInstance ()\r
54                 {\r
55                         object ws = Activator.CreateInstance (ServiceType);\r
56                         WebService wsi = ws as WebService;\r
57                         if (wsi != null) {
58                                 wsi.SetContext (_context);
59                                 wsi.SetSession (session);
60                         }
61
62                         return ws;
63                 }\r
64 \r
65                 [MonoTODO]\r
66                 protected IAsyncResult BeginCoreProcessRequest (AsyncCallback callback, object o)\r
67                 {\r
68                         throw new NotImplementedException ();\r
69                 }\r
70 \r
71                 [MonoTODO]\r
72                 protected void CoreProcessRequest ()\r
73                 {\r
74                         throw new NotImplementedException ();\r
75                 }\r
76 \r
77                 [MonoTODO]\r
78                 protected void EndCoreProcessRequest (IAsyncResult result)\r
79                 {\r
80                         throw new NotImplementedException ();\r
81                 }\r
82 \r
83                 [MonoTODO]\r
84                 private void WriteReturns (object[] returnValues)\r
85                 {\r
86                         //protocol.WriteReturns (returnValues, outputStream);\r
87                         throw new NotImplementedException ();\r
88                 }\r
89         }\r
90 }