* HttpGetTypeStubInfo.cs, HttpPostTypeStubInfo.cs, HttpSimpleTypeStubInfo.cs,
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / HttpGetTypeStubInfo.cs
1 //
2 // HttpGetTypeStubInfo.cs: Information about a method and its mapping to a SOAP web service.
3 //
4 // Author:
5 //   Lluis Sanchez Gual (lluis@ximian.com)
6 //
7 // (C) 2003 Ximian, Inc.
8 //
9
10 namespace System.Web.Services.Protocols 
11 {
12         internal class HttpGetMethodStubInfo : HttpSimpleMethodStubInfo
13         {
14                 public HttpGetMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo source): base (parent, source)
15                 {
16                         ParameterReaderType = new MimeFormatterInfo (typeof(UrlParameterReader));
17                         ReturnWriterType = new MimeFormatterInfo (typeof(XmlReturnWriter));
18                         
19                         if (ParameterWriterType == null) ParameterWriterType = new MimeFormatterInfo (typeof(UrlParameterWriter));
20                 }
21         }
22
23         internal class HttpGetTypeStubInfo : HttpSimpleTypeStubInfo
24         {
25                 public HttpGetTypeStubInfo (LogicalTypeInfo logicalTypeInfo): base (logicalTypeInfo)
26                 {
27                 }
28
29                 public override string ProtocolName
30                 {
31                         get { return "HttpGet"; }
32                 }
33                 
34                 protected override MethodStubInfo CreateMethodStubInfo (TypeStubInfo typeInfo, LogicalMethodInfo methodInfo, bool isClientProxy)
35                 {
36                         if (isClientProxy && methodInfo.MethodInfo.GetCustomAttributes (typeof(HttpMethodAttribute),true).Length == 0) return null;
37                         if (!ValueCollectionParameterReader.IsSupported (methodInfo)) return null;
38                         return new HttpGetMethodStubInfo (typeInfo, methodInfo);
39                 }
40         }
41 }