home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comredis.cab / defaultsdlhelpgenerator.aspx < prev    next >
Encoding:
Text File  |  2000-06-12  |  9.2 KB  |  272 lines

  1. <%@ Import Namespace="System.Web.Services.Description" %>
  2. <%@ Import Namespace="System.Collections.Bases" %>
  3.  
  4. <html>
  5.  
  6.   <script language="C#" runat="server">
  7.  
  8.     ServiceDescription serviceDescription = null;
  9.  
  10.     void Page_Load(object sender, EventArgs e) {
  11.  
  12.       // Obtain SDL contract from Http Context
  13.  
  14.       serviceDescription = (ServiceDescription) Context.Items["sdl"];
  15.       
  16.       // Build up the List of Available Methods to Call
  17.       
  18.       ProtocolInfos protocols = serviceDescription.Protocols;
  19.       
  20.       for (int x = 0; x<protocols.Count; x++) {
  21.       
  22.         // BugBug: Use the SOAP Protocol Method List to Generate the List of web methods
  23.         // at the top of the page.  Note that this will hide methods where users 
  24.         // have deliberately disabled SOAP as a valid protocol
  25.       
  26.         if (protocols[x] is SoapProtocolInfo) {
  27.        
  28.           MethodList.DataSource = ((SoapProtocolInfo) protocols[x]).Service.Interactions;            
  29.         }
  30.         
  31.         // BugBug: Use the GET Protocol Method List to Generate the List of web methods
  32.         // at the top of the page.  Note that this will hide methods that only
  33.         // support SOAP as a protocol (for example: methods that accept DataSets are params)
  34.         
  35.         if (protocols[x] is HttpGetProtocolInfo) {
  36.         
  37.           MethodDetailsList.DataSource = ((HttpGetProtocolInfo) protocols[x]).Service.Interactions;
  38.         }        
  39.       }
  40.  
  41.       // Databind all values within the page
  42.       
  43.       Page.DataBind();
  44.     }
  45.  
  46.   </script>
  47.  
  48.   <head>
  49.  
  50.     <link rel="alternate" type="text/xml" href="default.disco"/>
  51.  
  52.     <style type="text/css">
  53.     
  54.       BODY { margin-left:20px;
  55.              margin-top:0px;
  56.              background-image:url(/global/xmlweb4.gif);
  57.              background-repeat:repeat-y;
  58.              font-family:"Verdana", sans-serif;
  59.              font-size:xx-small;
  60.       }
  61.       
  62.       #content { font-size:x-small;
  63.                  padding-bottom: 2em;
  64.       }
  65.                
  66.       A:link { color:rgb(78,72,135) }
  67.       A:visited { color:rgb(128,128,200) }
  68.       A:active { color:rgb(241,96,67) }
  69.       A:hover { color:rgb(241,96,67)  }
  70.                           
  71.       h1 { font-size:medium;
  72.            margin-top:1em;
  73.            margin-bottom:.5em;
  74.            border-left:12px solid #000033;
  75.            border-top:1px solid #000033;
  76.            padding-left:4px;
  77.            color:#000033;
  78.       }
  79.              
  80.       h2 { font-size:small;
  81.            margin-bottom:.5em;
  82.            margin-top:1em;
  83.            border-left:8px solid #000033;
  84.            border-top:1px solid #000033;
  85.            padding-left:4px;
  86.            color:#000033;
  87.       }
  88.  
  89.       ul, ol { margin-top:.5em;}
  90.            
  91.     </style>
  92.  
  93.     <title><%#serviceDescription.Name%> WebService </title>
  94.  
  95.   </head>
  96.  
  97.   <body>
  98.  
  99.     <div id="content" style="width:750;margin-left:1em">
  100.  
  101.       <h1 style="font-size:26"><%#serviceDescription.Name%> WebService</H1>
  102.  
  103.       <p>
  104.       
  105.       The <%#serviceDescription.Name%> WebService exposes the following web methods:
  106.  
  107.       <br><br>
  108.  
  109.       <asp:repeater id="MethodList" runat=server>
  110.       
  111.         <template name="headertemplate">
  112.           <ul>
  113.         </template>
  114.       
  115.         <template name="itemtemplate">
  116.           <li><a href=#<%#DataBinder.Eval(Container.DataItem, "Name")%>><%#DataBinder.Eval(Container.DataItem, "Name")%></a></li>
  117.         </template>
  118.       
  119.         <template name="footertemplate">
  120.           </ul>
  121.         </template>
  122.       
  123.       </asp:repeater>
  124.  
  125.       For a formal XML definition of the <%=serviceDescription.Name%> WebService, please
  126.       review its: <a href="?SDL">SDL Contract</a>
  127.       
  128.       <p>
  129.  
  130.       <asp:repeater id="MethodDetailsList" runat=server>
  131.       
  132.         <template name="HeaderTemplate">
  133.         
  134.           <H2 style='font-size:18'>Web Method Reference</H1>
  135.         
  136.         </template>
  137.       
  138.         <template name="ItemTemplate">
  139.         
  140.           <br>
  141.         
  142.           <a name='<%#DataBinder.Eval(Container.DataItem, "Name")%>'>
  143.           
  144.           <p>
  145.           
  146.           <table width=750 bgcolor=#FFFFCC>
  147.             <tr>
  148.               <td bgcolor="#000033" height=13 colspan=2>
  149.                 <font face="Verdana, Arial" size="2" color="white">
  150.                   <b><%#DataBinder.Eval(Container.DataItem, "Name")%> Web Method</b>
  151.                 </font>
  152.               </td>
  153.             </tr>
  154.             <tr>
  155.               <td bgcolor="#FFFFCC" width=10> </td>
  156.               <td bgcolor="#FFFFCC">
  157.               
  158.                 <p>
  159.               
  160.                 <font face="Verdana, Arial" size=2>
  161.                 
  162.                   <br>
  163.                 
  164.                   No additional reference information about the <%#DataBinder.Eval(Container.DataItem, "Name")%> web method is available at this time.
  165.                         
  166.                   <p>
  167.                   
  168.                   <asp:repeater datasource='<%# DataBinder.Eval(Container.DataItem, "Request.Parameters")%>' runat=server>
  169.                  
  170.                       <template name="HeaderTemplate">
  171.                         
  172.                         <!-- BugBug: Open Design Issue for Beta1 -->
  173.                         
  174.                         <span visible='<%# ((Repeater)Container.Parent).DataSource.Count != 0%>' runat=server>
  175.                         
  176.                           <b>Request parameters: </b>
  177.                           
  178.                         </span>
  179.                         
  180.                       </template>
  181.                  
  182.                       <template name="ItemTemplate">
  183.                       
  184.                         <div style='margin-left:1em;font-family:verdana;font-size:13'>
  185.                           <li><%# ((HttpParameterInfo)Container.DataItem ).Name %> </li>
  186.                         </div>
  187.                         
  188.                       </template>
  189.                   
  190.                   </asp:repeater>
  191.                   
  192.                   <p>
  193.                   
  194.                   <b>Response type: </b>
  195.                   
  196.                   <div style='margin-left:1em;font-family:verdana;font-size:13'>
  197.                   
  198.                     <asp:repeater datasource='<%# DataBinder.Eval(Container.DataItem, "Response.Contents")%>' runat=server>
  199.                  
  200.                       <template name="ItemTemplate">
  201.                         <li><%# ((XmlMimeInfo)Container.DataItem ).ElementRef.Name %></li>
  202.                       </template>
  203.                   
  204.                     </asp:repeater>
  205.                   
  206.                   </div>
  207.                   
  208.                   <br>
  209.                   
  210.                   <b>Invoke the <%#DataBinder.Eval(Container.DataItem, "Name")%> Web Method: </b>
  211.                   
  212.                   <div style='margin-left:1em;font-family:verdana;font-size:13'>
  213.                   
  214.                     <br>
  215.                     
  216.                     Enter parameter values and then click the 'Invoke' button to invoke the <%#DataBinder.Eval(Container.DataItem, "Name")%> web method.
  217.                   
  218.                     <form target="_blank" action='<%#DataBinder.Eval(Container.DataItem, "Href")%>'>
  219.                     
  220.                      <table>
  221.                     
  222.                         <asp:repeater datasource='<%# DataBinder.Eval(Container.DataItem, "Request.Parameters")%>' runat=server>
  223.                  
  224.                           <template name="HeaderTemplate">
  225.                          
  226.                               <!-- BugBug: Open Design Issue for Beta1 -->
  227.                          
  228.                               <tr visible='<%# ((Repeater)Container.Parent).DataSource.Count != 0%>' runat=server>
  229.                                 <td style="font-family:verdana;font-size:13"><u>Parameter</u></td>
  230.                                 <td width=10></td>
  231.                                 <td style="font-family:verdana;font-size:13"><u>Value</u></td>
  232.                               </tr>
  233.                           
  234.                           </template>
  235.                  
  236.                           <template name="ItemTemplate">
  237.                             <tr>
  238.                               <td style="font-family:verdana;font-size:13"> <%# ((HttpParameterInfo)Container.DataItem ).Name %>:</td>
  239.                               <td width=10></td>
  240.                               <td><input type="text" size="50" name='<%# ((HttpParameterInfo)Container.DataItem ).Name %>'\"></td>
  241.                             </tr>
  242.                           </template>
  243.                   
  244.                         </asp:repeater>
  245.                         
  246.                         <tr>
  247.                           <td></td>
  248.                           <td></td>
  249.                           <td align=right> <input type=submit value="Invoke"> </td>
  250.                         </tr>
  251.                       </table>
  252.                     
  253.                     </form>
  254.                     
  255.                   </div>
  256.                 </font>
  257.               </td>
  258.             </tr>
  259.           
  260.           </table> 
  261.           
  262.         </template>
  263.       
  264.       </asp:repeater>
  265.       
  266.     </div>
  267.      
  268.   </body>
  269.  
  270. </html>
  271.  
  272.