X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=data%2Fnet_2_0%2FDefaultWsdlHelpGenerator.aspx;h=f4d74bff7f5bca96ad3fc764e518b4d710854177;hb=HEAD;hp=b1eac1fa1ccb307e2d09ad9cd17e233d1c37463e;hpb=5bbfa8860b090e465a3aa45edeb9c94481ef1a22;p=mono.git diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.aspx index b1eac1fa1cc..f4d74bff7f5 100644 --- a/data/net_2_0/DefaultWsdlHelpGenerator.aspx +++ b/data/net_2_0/DefaultWsdlHelpGenerator.aspx @@ -10,12 +10,15 @@ --%> <%@ Import Namespace="System.Collections" %> +<%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Xml.Serialization" %> <%@ Import Namespace="System.Xml" %> <%@ Import Namespace="System.Xml.Schema" %> <%@ Import Namespace="System.Web.Services" %> <%@ Import Namespace="System.Web.Services.Description" %> +<%@ Import Namespace="System.Web.Services.Configuration" %> +<%@ Import Namespace="System.Web.Configuration" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.Globalization" %> @@ -25,7 +28,9 @@ <%@ Import Namespace="System.CodeDom.Compiler" %> <%@ Import Namespace="Microsoft.CSharp" %> <%@ Import Namespace="Microsoft.VisualBasic" %> +<%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Text.RegularExpressions" %> +<%@ Import Namespace="System.Security.Cryptography.X509Certificates" %> <%@ Assembly name="System.Web.Services" %> <%@ Page debug="true" %> @@ -88,7 +93,9 @@ void Page_Load(object sender, EventArgs e) Page.DataBind(); ProfileViolations = new BasicProfileViolationCollection (); - WebServicesInteroperability.CheckConformance (WsiClaims.BP10, descriptions, ProfileViolations); + foreach (WsiProfilesElement claims in ((WebServicesSection) WebConfigurationManager.GetSection("system.web/webServices")).ConformanceWarnings) + if (claims.Name != WsiProfiles.None) + WebServicesInteroperability.CheckConformance (claims.Name, descriptions, ProfileViolations); } void BuildOperationInfo () @@ -116,13 +123,21 @@ void BuildOperationInfo () // Protocols supported by the operation CurrentOperationProtocols = ""; + WebServiceProtocols testProtocols = 0; ArrayList prots = FindServiceProtocols (CurrentOperationName); for (int n=0; n= 0) ? "GET" : "POST"; +} + +string GetQS () +{ bool fill = false; string qs = ""; - for (int n=0; n 0) { - CookieContainer container = new CookieContainer (); - for (int i = 0; i < last; i++) { - HttpCookie hcookie = cookies [i]; - Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain); - container.Add (uri, cookie); - } - ((HttpWebRequest) req).CookieContainer = container; - } - WebResponse resp = req.GetResponse(); - StreamReader sr = new StreamReader (resp.GetResponseStream()); - string s = sr.ReadToEnd (); - sr.Close (); - return "
" + ColorizeXml(WrapText(s,CodeTextColumns)) + "
"; - } - catch (Exception ex) - { - string res = "" + ex.Message + ""; - WebException wex = ex as WebException; - if (wex != null) - { - WebResponse resp = wex.Response; - if (resp != null) { - StreamReader sr = new StreamReader (resp.GetResponseStream()); - string s = sr.ReadToEnd (); - sr.Close (); - res += "
" + ColorizeXml(WrapText(s,CodeTextColumns)) + "
"; - } - } - return res; - } + return location + "/" + CurrentOperationName; } string GenerateOperationMessages (string protocol, bool generateInput) @@ -479,10 +474,15 @@ private CodeDomProvider GetProvider(string langId) // // Document generation // +class UTF8StringWriter : StringWriter { + public override Encoding Encoding { + get { return Encoding.UTF8; } + } +} string GenerateDocument () { - StringWriter sw = new StringWriter (); + UTF8StringWriter sw = new UTF8StringWriter (); if (CurrentDocType == "wsdl") descriptions [CurrentDocInd].Write (sw); @@ -1041,7 +1041,7 @@ public class HtmlSampleGenerator: SampleGenerator if (elem == null) throw new InvalidOperationException ("Element not found: " + qname); WriteElementSample (xtw, qname.Namespace, elem); } - + void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem) { bool sharedAnnType = false; @@ -1135,9 +1135,18 @@ public class HtmlSampleGenerator: SampleGenerator { WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute); } - + + Dictionary recursed_types = new Dictionary (); void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype) { + int prev = 0; + if (recursed_types.ContainsKey (stype)) + prev = recursed_types [stype]; + + if (prev > 1) + return; + recursed_types [stype] = ++prev; + if (stype.Particle != null) WriteParticleComplexContent (xtw, ns, stype.Particle); else @@ -1147,6 +1156,8 @@ public class HtmlSampleGenerator: SampleGenerator else if (stype.ContentModel is XmlSchemaComplexContent) WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel); } + prev = recursed_types [stype]; + recursed_types [stype] = --prev; } void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat) @@ -1526,9 +1537,10 @@ public class HtmlSampleGenerator: SampleGenerator - - - + + <% + Response.Write (""); + %> <%=WebServiceName%> Web Service - <% } else {%> The test form is not available for this operation because it has parameters with a complex structure.