2 // System.Web.Services.Description.HttpGetProtocolImporter.cs
5 // Lluis Sanchez Gual (lluis@ximian.com)
7 // Copyright (C) 2003 Ximian, Inc.
12 using System.Web.Services;
13 using System.Web.Services.Protocols;
14 using System.Xml.Serialization;
16 using System.Collections;
17 using System.Configuration;
19 namespace System.Web.Services.Description
21 internal class HttpGetProtocolImporter : HttpSimpleProtocolImporter
25 public HttpGetProtocolImporter ()
29 #endregion // Constructors
33 public override string ProtocolName {
34 get { return "HttpGet"; }
37 #endregion // Properties
41 protected override CodeTypeDeclaration BeginClass ()
43 CodeTypeDeclaration codeClass = base.BeginClass ();
44 CodeTypeReference ctr = new CodeTypeReference ("System.Web.Services.Protocols.HttpGetClientProtocol");
45 codeClass.BaseTypes.Add (ctr);
49 protected override Type GetInMimeFormatter ()
51 HttpUrlEncodedBinding bin = OperationBinding.Input.Extensions.Find (typeof(HttpUrlEncodedBinding)) as HttpUrlEncodedBinding;
52 if (bin == null) throw new Exception ("Http urlEncoded binding not found");
53 return typeof (UrlParameterWriter);
56 protected override bool IsBindingSupported ()
58 HttpBinding bin = (HttpBinding) Binding.Extensions.Find (typeof(HttpBinding));
59 if (bin == null) return false;
60 return bin.Verb == "GET";