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