Author: atsushi
Date: 2007-11-09 09:45:31 -0500 (Fri, 09 Nov 2007)
New Revision: 89317

Modified:
   trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
   
trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
Log:
2007-11-09  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * SoapDocumentationHandler.cs : handle 'schema' HTTP parameter like
          "...blah.asmx?schema=MySchemaID". (Such URL does not work yet.)



Modified: 
trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog 
2007-11-09 14:30:00 UTC (rev 89316)
+++ trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog 
2007-11-09 14:45:31 UTC (rev 89317)
@@ -1,3 +1,8 @@
+2007-11-09  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * SoapDocumentationHandler.cs : handle 'schema' HTTP parameter like
+         "...blah.asmx?schema=MySchemaID". (Such URL does not work yet.)
+
 2007-10-29  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * SoapException.cs : serialization constructor didn't call base.

Modified: 
trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
===================================================================
--- 
trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
       2007-11-09 14:30:00 UTC (rev 89316)
+++ 
trunk/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
       2007-11-09 14:45:31 UTC (rev 89317)
@@ -189,9 +189,22 @@
                
                void GenerateSchema (HttpContext context, string schemaId)
                {
-                       int di = 0;
-                       if (schemaId != null && schemaId != "") di = int.Parse 
(schemaId);
-                       
+                       int di = -1;
+                       if (schemaId != null && schemaId != "") {
+                               try {
+                                       di = int.Parse (schemaId);
+                               } catch {
+                                       XmlSchemas xss = GetSchemas ();
+                                       for (int i = 0; i < xss.Count; i++) {
+                                               if (xss [i].Id == schemaId) {
+                                                       di = i;
+                                                       break;
+                                               }
+                                       }
+                               }
+                               if (di < 0)
+                                       throw new InvalidOperationException 
(String.Format ("HTTP parameter 'schema' needs to specify an Id of a schema in 
the schemas. {0} points to nowhere.", schemaId));
+                       }
                        context.Response.ContentType = "text/xml; 
charset=utf-8";
                        XmlTextWriter xtw = new XmlTextWriter 
(context.Response.OutputStream, new UTF8Encoding (false));
                        xtw.Formatting = Formatting.Indented;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to