Merge pull request #2942 from jogibear9988/patch-2
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / SoapServerType.cs
index cffe31facd5c356340126a8dfc72a2870f19ea92..fae6580c945003e8330e405128c339eecc629075 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
+using System.Collections;
+using System.Web.Services.Description;
 using System.Web.Services.Configuration;
 
 namespace System.Web.Services.Protocols
 {
        public sealed class SoapServerType : ServerType
        {
-               [MonoTODO]
+               Hashtable serverMethods = new Hashtable ();
+
                public SoapServerType (Type type, WebServiceProtocols protocolsSupported)
                        : base (type)
                {
+                       // FIXME: these calls could be altered. Here they
+                       // are invoked to verify attributes.
+                       if ((protocolsSupported & WebServiceProtocols.HttpSoap) != 0)
+                               LogicalType.GetTypeStub ("Soap");
+                       if ((protocolsSupported & WebServiceProtocols.HttpSoap12) != 0)
+                               LogicalType.GetTypeStub ("Soap12");
+
+                       foreach (LogicalMethodInfo m in LogicalType.LogicalMethods) {
+                               SoapServerMethod sm = new SoapServerMethod (type, m);
+                               serverMethods.Add (sm.Action, sm);
+                       }
                }
 
                [MonoTODO]
@@ -48,27 +61,24 @@ namespace System.Web.Services.Protocols
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public SoapServerMethod GetMethod (object key)
                {
-                       throw new NotImplementedException ();
+                       if (key == null)
+                               throw new ArgumentNullException ("key");
+                       return serverMethods [key] as SoapServerMethod;
                }
 
-               [MonoTODO]
                public bool ServiceDefaultIsEncoded {
-                       get { throw new NotImplementedException (); }
+                       get { return LogicalType.BindingUse == SoapBindingUse.Encoded; }
                }
 
-               [MonoTODO]
                public string ServiceNamespace {
-                       get { throw new NotImplementedException (); }
+                       get { return LogicalType.WebServiceNamespace; }
                }
 
-               [MonoTODO]
                public bool ServiceRoutingOnSoapAction {
-                       get { throw new NotImplementedException (); }
+                       get { return LogicalType.RoutingStyle == SoapServiceRoutingStyle.SoapAction; }
                }
        }
 }
 
-#endif