--%>
<%@ Import Namespace="System.Collections" %>
+<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml.Serialization" %>
<%@ Import Namespace="System.Xml" %>
// Protocols supported by the operation
CurrentOperationProtocols = "";
+ WebServiceProtocols testProtocols = 0;
ArrayList prots = FindServiceProtocols (CurrentOperationName);
for (int n=0; n<prots.Count; n++) {
+ string prot = (string) prots [n];
if (n != 0) CurrentOperationProtocols += ", ";
- CurrentOperationProtocols += (string) prots[n];
+ CurrentOperationProtocols += prot;
+ if (prot == "HttpGet")
+ testProtocols |= WebServiceProtocols.HttpGet;
+ else if (prot == "HttpPost") {
+ testProtocols |= WebServiceProtocols.HttpPost;
+ if (Context.Request.IsLocal)
+ testProtocols |= WebServiceProtocols.HttpPostLocalhost;
+ }
}
-
- WebServiceProtocols testProtocols = WebServiceProtocols.HttpGet | WebServiceProtocols.HttpPost;
- if (Context.Request.IsLocal)
- testProtocols |= WebServiceProtocols.HttpPostLocalhost;
CurrentOperationSupportsTest = (WebServicesSection.Current.EnabledProtocols & testProtocols) != 0;
// Operation format
//
// 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);
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;
{
WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
}
-
+
+ Dictionary<XmlSchemaComplexType,int> recursed_types = new Dictionary<XmlSchemaComplexType,int> ();
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
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)
</script>
<head runat="server">
- <link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
-
+ <%
+ Response.Write ("<link rel=\"alternate\" type=\"text/xml\" href=\"" + Request.FilePath + "?disco\"/>");
+ %>
<title><%=WebServiceName%> Web Service</title>
<style type="text/css">
BODY { font-family: Arial; margin-left: 20px; margin-top: 20px; font-size: x-small}