* Methods.cs: Set the correct element name and namespace for headers (those
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / HttpPostTypeStubInfo.cs
1 //
2 // HttpPostTypeStubInfo.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 HttpPostMethodStubInfo : HttpSimpleMethodStubInfo
13         {
14                 public HttpPostMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo source): base (parent, source)
15                 {
16                         ParameterReaderType = new MimeFormatterInfo (typeof(HtmlFormParameterReader));
17                         ReturnWriterType = new MimeFormatterInfo (typeof(XmlReturnWriter));
18
19                         if (ParameterWriterType == null) ParameterWriterType = new MimeFormatterInfo (typeof(HtmlFormParameterWriter));
20                 }
21         }
22         
23         internal class HttpPostTypeStubInfo : HttpSimpleTypeStubInfo
24         {
25                 public HttpPostTypeStubInfo (LogicalTypeInfo logicalTypeInfo): base (logicalTypeInfo)
26                 {
27                 }
28
29                 public override string ProtocolName
30                 {
31                         get { return "HttpPost"; }
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 HttpPostMethodStubInfo (typeInfo, methodInfo);
39                 }
40         }
41 }