Ejemplo n.º 1
0
        protected override void Render(HtmlTextWriter output)
        {
            var operationsPart = new TableTemplate
            {
                Title = "Operations:",
                Items = this.OperationNames,
                ForEachItem = RenderRow
            }.ToString();

            var xsdsPart = new ListTemplate
            {
                Title = "XSDS:",
                ListItemsIntMap = this.Xsds,
                ListItemTemplate = @"<li><a href=""?xsd={0}"">{1}</a></li>"
            }.ToString();

            var wsdlTemplate = new StringBuilder();
            var soap11Config = MetadataConfig.GetMetadataConfig("soap11") as SoapMetadataConfig;
            var soap12Config = MetadataConfig.GetMetadataConfig("soap12") as SoapMetadataConfig;
            if (soap11Config != null || soap12Config != null)
            {
                wsdlTemplate.AppendLine("<h3>WSDLS:</h3>");
                wsdlTemplate.AppendLine("<ul>");
                if (soap11Config != null)
                {
                    wsdlTemplate.AppendFormat(
                        @"<li><a href=""{0}"">{0}</a></li>",
                        soap11Config.WsdlMetadataUri);
                }
                if (soap12Config != null)
                {
                    wsdlTemplate.AppendFormat(
                        @"<li><a href=""{0}"">{0}</a></li>",
                        soap12Config.WsdlMetadataUri);
                }
                wsdlTemplate.AppendLine("</ul>");
            }

            var debugOnlyInfo = new StringBuilder();
            if (EndpointHost.DebugMode)
            {
                debugOnlyInfo.Append("<h3>Debug Info:</h3>");
                debugOnlyInfo.AppendLine("<ul>");
                debugOnlyInfo.AppendLine("<li><a href=\"operations/metadata\">Operations Metadata</a></li>");
                debugOnlyInfo.AppendLine("</ul>");
            }

            var renderedTemplate = HtmlTemplates.Format(
                HtmlTemplates.IndexOperationsTemplate,
                this.Title,
                this.MetadataPageBodyHtml,
                this.XsdServiceTypesIndex,
                operationsPart,
                xsdsPart,
                wsdlTemplate,
                debugOnlyInfo);

            output.Write(renderedTemplate);
        }
Ejemplo n.º 2
0
 protected override void Render(HtmlTextWriter output)
 {
     var operationsPart = new ListTemplate
     {
         ListItems = this.OperationNames,
         ListItemTemplate = @"<li><a href=""?op={0}"">{0}</a></li>"
     }.ToString();
     var renderedTemplate = HtmlTemplates.Format(HtmlTemplates.OperationsControlTemplate,
         this.Title, this.MetadataOperationPageBodyHtml, operationsPart);
     output.Write(renderedTemplate);
 }