annotate Chapter5/MovingBalls.app/Contents/Data/Managed/etc/mono/1.0/DefaultWsdlHelpGenerator.aspx @ 2:fdab88fc2cb9

add game projects
author Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2015 23:14:45 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <%--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // DefaultWsdlHelpGenerator.aspx:
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // Author:
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // Lluis Sanchez Gual (lluis@ximian.com)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // (C) 2003 Ximian, Inc. http://www.ximian.com
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 --%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 <%@ Import Namespace="System.Collections" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 <%@ Import Namespace="System.IO" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 <%@ Import Namespace="System.Xml.Serialization" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 <%@ Import Namespace="System.Xml" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 <%@ Import Namespace="System.Xml.Schema" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 <%@ Import Namespace="System.Web.Services.Description" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <%@ Import Namespace="System" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <%@ Import Namespace="System.Net" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 <%@ Import Namespace="System.Globalization" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 <%@ Import Namespace="System.Resources" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 <%@ Import Namespace="System.Diagnostics" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <%@ Import Namespace="System.CodeDom" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 <%@ Import Namespace="System.CodeDom.Compiler" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 <%@ Import Namespace="Microsoft.CSharp" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 <%@ Import Namespace="Microsoft.VisualBasic" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 <%@ Import Namespace="System.Text" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 <%@ Import Namespace="System.Text.RegularExpressions" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 <%@ Import Namespace="System.Security.Cryptography.X509Certificates" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 <%@ Assembly name="System.Web.Services" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 <%@ Page debug="true" %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 <html>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 <script language="C#" runat="server">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 ServiceDescriptionCollection descriptions;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 XmlSchemas schemas;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 string WebServiceName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 string WebServiceDescription;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 string PageName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 string DefaultBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 ArrayList ServiceProtocols;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 string CurrentOperationName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 string CurrentOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 string OperationDocumentation;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 string CurrentOperationFormat;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 bool CurrentOperationSupportsTest;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 ArrayList InParams;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 ArrayList OutParams;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 string CurrentOperationProtocols;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 int CodeTextColumns = 95;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 void Page_Load(object sender, EventArgs e)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 descriptions = (ServiceDescriptionCollection) Context.Items["wsdls"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 schemas = (XmlSchemas) Context.Items["schemas"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 ServiceDescription desc = descriptions [0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 if (schemas.Count == 0) schemas = desc.Types.Schemas;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 Service service = desc.Services[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 WebServiceName = service.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 if (desc.Bindings.Count == 0)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 return;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 DefaultBinding = desc.Bindings[0].Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 WebServiceDescription = service.Documentation;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 ServiceProtocols = FindServiceProtocols (null);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 CurrentOperationName = Request.QueryString["op"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 CurrentOperationBinding = Request.QueryString["bnd"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 if (CurrentOperationName != null) BuildOperationInfo ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 PageName = HttpUtility.UrlEncode (Path.GetFileName(Request.Path), Encoding.UTF8);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 ArrayList list = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 foreach (ServiceDescription sd in descriptions) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 foreach (Binding bin in sd.Bindings)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 if (bin.Extensions.Find (typeof(SoapBinding)) != null) list.Add (bin);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 BindingsRepeater.DataSource = list;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 Page.DataBind();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 void BuildOperationInfo ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 InParams = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 OutParams = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 Port port = FindPort (CurrentOperationBinding, null);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 Binding binding = descriptions.GetBinding (port.Binding);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 PortType portType = descriptions.GetPortType (binding.Type);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 Operation oper = FindOperation (portType, CurrentOperationName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 OperationDocumentation = oper.Documentation;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 if (OperationDocumentation == null || OperationDocumentation == "")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 OperationDocumentation = "No additional remarks";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 foreach (OperationMessage opm in oper.Messages)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 if (opm is OperationInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 BuildParameters (InParams, opm);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 else if (opm is OperationOutput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 BuildParameters (OutParams, opm);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 // Protocols supported by the operation
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 CurrentOperationProtocols = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 ArrayList prots = FindServiceProtocols (CurrentOperationName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 for (int n=0; n<prots.Count; n++) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 if (n != 0) CurrentOperationProtocols += ", ";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 CurrentOperationProtocols += (string) prots[n];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 // Operation format
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 OperationBinding obin = FindOperation (binding, CurrentOperationName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 if (obin != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 CurrentOperationFormat = GetOperationFormat (obin);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 InputParamsRepeater.DataSource = InParams;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 InputFormParamsRepeater.DataSource = InParams;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 OutputParamsRepeater.DataSource = OutParams;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 void BuildParameters (ArrayList list, OperationMessage opm)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 Message msg = descriptions.GetMessage (opm.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 MessagePart part = msg.Parts[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 XmlSchemaComplexType ctype;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 if (part.Element == XmlQualifiedName.Empty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 ctype = (XmlSchemaComplexType) schemas.Find (part.Type, typeof(XmlSchemaComplexType));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 ctype = (XmlSchemaComplexType) elem.SchemaType;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 XmlSchemaSequence seq = ctype.Particle as XmlSchemaSequence;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 if (seq == null) return;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 foreach (XmlSchemaObject ob in seq.Items)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 Parameter p = new Parameter();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 p.Description = "No additional remarks";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 if (ob is XmlSchemaElement)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 XmlSchemaElement selem = GetRefElement ((XmlSchemaElement)ob);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 p.Name = selem.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 p.Type = selem.SchemaTypeName.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 p.Name = "Unknown";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 p.Type = "Unknown";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 list.Add (p);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 foreach (MessagePart part in msg.Parts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 Parameter p = new Parameter ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 p.Description = "No additional remarks";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 p.Name = part.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 if (part.Element == XmlQualifiedName.Empty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 p.Type = part.Type.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 p.Type = elem.SchemaTypeName.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 list.Add (p);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 string GetOperationFormat (OperationBinding obin)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 string format = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 if (sob != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 format = sob.Style.ToString ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 if (sbb != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 format += " / " + sbb.Use;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 return format;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
201
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 XmlSchemaElement GetRefElement (XmlSchemaElement elem)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 if (!elem.RefName.IsEmpty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 return elem;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
209
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 ArrayList FindServiceProtocols(string operName)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 ArrayList table = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 Service service = descriptions[0].Services[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 foreach (Port port in service.Ports)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 string prot = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 Binding bin = descriptions.GetBinding (port.Binding);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 if (bin.Extensions.Find (typeof(SoapBinding)) != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 prot = "Soap";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 HttpBinding hb = (HttpBinding) bin.Extensions.Find (typeof(HttpBinding));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 if (hb != null && hb.Verb == "POST") prot = "HttpPost";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 else if (hb != null && hb.Verb == "GET") prot = "HttpGet";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 if (prot != null && operName != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 if (FindOperation (bin, operName) == null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 prot = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 if (prot != null && !table.Contains (prot))
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 table.Add (prot);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 return table;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
238
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 Port FindPort (string portName, string protocol)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 Service service = descriptions[0].Services[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 foreach (Port port in service.Ports)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 if (portName == null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 Binding binding = descriptions.GetBinding (port.Binding);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 if (GetProtocol (binding) == protocol) return port;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 else if (port.Name == portName)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 return port;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
254
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 string GetProtocol (Binding binding)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 if (binding.Extensions.Find (typeof(SoapBinding)) != null) return "Soap";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 HttpBinding hb = (HttpBinding) binding.Extensions.Find (typeof(HttpBinding));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 if (hb == null) return "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 if (hb.Verb == "POST") return "HttpPost";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 if (hb.Verb == "GET") return "HttpGet";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 return "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
264
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
265
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 Operation FindOperation (PortType portType, string name)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 foreach (Operation oper in portType.Operations) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 if (oper.Messages.Input.Name != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 if (oper.Messages.Input.Name == name) return oper;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 if (oper.Name == name) return oper;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
275
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
278
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 OperationBinding FindOperation (Binding binding, string name)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 foreach (OperationBinding oper in binding.Operations) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 if (oper.Input.Name != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 if (oper.Input.Name == name) return oper;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 if (oper.Name == name) return oper;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
288
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
291
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 string FormatBindingName (string name)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 if (name == DefaultBinding) return "Methods";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 else return "Methods for binding<br>" + name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
297
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 string GetOpName (object op)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 OperationBinding ob = op as OperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 if (ob == null) return "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 if (ob.Input.Name != null) return ob.Input.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 else return ob.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
305
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 bool HasFormResult
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 get { return Request.QueryString ["ext"] == "testform"; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
310
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 class NoCheckCertificatePolicy : ICertificatePolicy {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 public bool CheckValidationResult (ServicePoint a, X509Certificate b, WebRequest c, int d)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 return true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
317
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 string GetTestResult ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 if (!HasFormResult) return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
321
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 bool fill = false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 string qs = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 for (int n=0; n<Request.QueryString.Count; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 if (fill) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 if (qs != "") qs += "&";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 if (Request.QueryString.GetKey(n) == "ext") fill = true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
332
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 string location = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 ServiceDescription desc = descriptions [0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 Service service = desc.Services[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 foreach (Port port in service.Ports)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 if (port.Name == CurrentOperationBinding)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 SoapAddressBinding sbi = (SoapAddressBinding) port.Extensions.Find (typeof(SoapAddressBinding));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 if (sbi != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 location = sbi.Location;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
343
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 if (location == null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 return "Could not locate web service";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
346
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 try
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 string url = location + "/" + CurrentOperationName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 Uri uri = new Uri (url);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 WebRequest req;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 req = WebRequest.Create (url);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 req.Method = "POST";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 if (qs != null && qs.Length > 0) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 req.ContentType = "application/x-www-form-urlencoded";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 byte [] postBuffer = Encoding.UTF8.GetBytes (qs);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 req.ContentLength = postBuffer.Length;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 using (Stream requestStream = req.GetRequestStream ())
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 requestStream.Write (postBuffer, 0, postBuffer.Length);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 req = WebRequest.Create (url + "?" + qs);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 if (url.StartsWith ("https:"))
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 HttpCookieCollection cookies = Request.Cookies;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 int last = cookies.Count;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 if (last > 0) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 CookieContainer container = new CookieContainer ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 for (int i = 0; i < last; i++) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 HttpCookie hcookie = cookies [i];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
374 container.Add (uri, cookie);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 ((HttpWebRequest) req).CookieContainer = container;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 WebResponse resp = req.GetResponse();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
379 StreamReader sr = new StreamReader (resp.GetResponseStream());
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 string s = sr.ReadToEnd ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 sr.Close ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
384 catch (Exception ex)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 string res = "<b style='color:red'>" + ex.Message + "</b>";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 WebException wex = ex as WebException;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
388 if (wex != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 WebResponse resp = wex.Response;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 if (resp != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 StreamReader sr = new StreamReader (resp.GetResponseStream());
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 string s = sr.ReadToEnd ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 sr.Close ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 return res;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
401
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 string GenerateOperationMessages (string protocol, bool generateInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 if (!IsOperationSupported (protocol)) return "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
405
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 Port port;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 if (protocol != "Soap") port = FindPort (null, protocol);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 else port = FindPort (CurrentOperationBinding, null);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
409
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 Binding binding = descriptions.GetBinding (port.Binding);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 OperationBinding obin = FindOperation (binding, CurrentOperationName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 PortType portType = descriptions.GetPortType (binding.Type);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 Operation oper = FindOperation (portType, CurrentOperationName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
414
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 HtmlSampleGenerator sg = new HtmlSampleGenerator (descriptions, schemas);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
416 string txt = sg.GenerateMessage (port, obin, oper, protocol, generateInput);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 if (protocol == "Soap") txt = WrapText (txt,CodeTextColumns);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 txt = ColorizeXml (txt);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 txt = txt.Replace ("@placeholder!","<span class='literal-placeholder'>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
420 txt = txt.Replace ("!placeholder@","</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 return txt;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
423
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 bool IsOperationSupported (string protocol)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 if (CurrentPage != "op" || CurrentTab != "msg") return false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 if (protocol == "Soap") return true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
428
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 Port port = FindPort (null, protocol);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 if (port == null) return false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 Binding binding = descriptions.GetBinding (port.Binding);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 if (binding == null) return false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 return FindOperation (binding, CurrentOperationName) != null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
435
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 // Proxy code generation
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
439
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 string GetProxyCode ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 CodeNamespace codeNamespace = new CodeNamespace();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 CodeCompileUnit codeUnit = new CodeCompileUnit();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
444
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 codeUnit.Namespaces.Add (codeNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
446
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
448
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 foreach (ServiceDescription sd in descriptions)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 importer.AddServiceDescription(sd, null, null);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
451
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 foreach (XmlSchema sc in schemas)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 importer.Schemas.Add (sc);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
454
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 importer.Import(codeNamespace, codeUnit);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
456
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 string langId = Request.QueryString ["lang"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 if (langId == null || langId == "") langId = "cs";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 CodeDomProvider provider = GetProvider (langId);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 ICodeGenerator generator = provider.CreateGenerator();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 CodeGeneratorOptions options = new CodeGeneratorOptions();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
462
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 StringWriter sw = new StringWriter ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 generator.GenerateCodeFromCompileUnit(codeUnit, sw, options);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
465
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 return Colorize (WrapText (sw.ToString (), CodeTextColumns), langId);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
468
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 public string CurrentLanguage
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 get {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 string langId = Request.QueryString ["lang"];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 if (langId == null || langId == "") langId = "cs";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 return langId;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
477
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 public string CurrentProxytName
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 get {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 string lan = CurrentLanguage == "cs" ? "C#" : "Visual Basic";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 return lan + " Client Proxy";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
485
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 private CodeDomProvider GetProvider(string langId)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 switch (langId.ToUpper())
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 case "CS": return new CSharpCodeProvider();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 case "VB": return new VBCodeProvider();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 default: return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
495
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 // Document generation
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
499
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 string GenerateDocument ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 StringWriter sw = new StringWriter ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
503
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 if (CurrentDocType == "wsdl")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 descriptions [CurrentDocInd].Write (sw);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 else if (CurrentDocType == "schema")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 schemas [CurrentDocInd].Write (sw);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
508
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 return Colorize (WrapText (sw.ToString (), CodeTextColumns), "xml");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
511
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 public string CurrentDocType
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 get { return Request.QueryString ["doctype"] != null ? Request.QueryString ["doctype"] : "wsdl"; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
515 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
516
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 public int CurrentDocInd
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
518 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 get { return Request.QueryString ["docind"] != null ? int.Parse (Request.QueryString ["docind"]) : 0; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
521
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 public string CurrentDocumentName
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 get {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 if (CurrentDocType == "wsdl")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 return "WSDL document for namespace \"" + descriptions [CurrentDocInd].TargetNamespace + "\"";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 return "Xml Schema for namespace \"" + schemas [CurrentDocInd].TargetNamespace + "\"";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
531
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 // Pages and tabs
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
535
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 bool firstTab = true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 ArrayList disabledTabs = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
538
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 string CurrentTab
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 get { return Request.QueryString["tab"] != null ? Request.QueryString["tab"] : "main" ; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
543
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 string CurrentPage
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 get { return Request.QueryString["page"] != null ? Request.QueryString["page"] : "main" ; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
548
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 void WriteTabs ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 if (CurrentOperationName != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 WriteTab ("main","Overview");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 WriteTab ("test","Test Form");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 WriteTab ("msg","Message Layout");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
558
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
559 void WriteTab (string id, string label)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 if (!firstTab) Response.Write("&nbsp;|&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 firstTab = false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
563
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 string cname = CurrentTab == id ? "tabLabelOn" : "tabLabelOff";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 Response.Write ("<a href='" + PageName + "?" + GetPageContext(null) + GetDataContext() + "tab=" + id + "' style='text-decoration:none'>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 Response.Write ("<span class='" + cname + "'>" + label + "</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 Response.Write ("</a>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
569
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
570 string GetTabContext (string pag, string tab)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 if (tab == null) tab = CurrentTab;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
573 if (pag == null) pag = CurrentPage;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 if (pag != CurrentPage) tab = "main";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 return "page=" + pag + "&tab=" + tab + "&";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
577
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 string GetPageContext (string pag)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 if (pag == null) pag = CurrentPage;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 return "page=" + pag + "&";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
583
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
584 class Tab
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
586 public string Id;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 public string Label;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
589
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
590 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 // Syntax coloring
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
592 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
593
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
594 static string keywords_cs =
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 "(\\babstract\\b|\\bevent\\b|\\bnew\\b|\\bstruct\\b|\\bas\\b|\\bexplicit\\b|\\bnull\\b|\\bswitch\\b|\\bbase\\b|\\bextern\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
596 "\\bobject\\b|\\bthis\\b|\\bbool\\b|\\bfalse\\b|\\boperator\\b|\\bthrow\\b|\\bbreak\\b|\\bfinally\\b|\\bout\\b|\\btrue\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
597 "\\bbyte\\b|\\bfixed\\b|\\boverride\\b|\\btry\\b|\\bcase\\b|\\bfloat\\b|\\bparams\\b|\\btypeof\\b|\\bcatch\\b|\\bfor\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
598 "\\bprivate\\b|\\buint\\b|\\bchar\\b|\\bforeach\\b|\\bprotected\\b|\\bulong\\b|\\bchecked\\b|\\bgoto\\b|\\bpublic\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 "\\bunchecked\\b|\\bclass\\b|\\bif\\b|\\breadonly\\b|\\bunsafe\\b|\\bconst\\b|\\bimplicit\\b|\\bref\\b|\\bushort\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 "\\bcontinue\\b|\\bin\\b|\\breturn\\b|\\busing\\b|\\bdecimal\\b|\\bint\\b|\\bsbyte\\b|\\bvirtual\\b|\\bdefault\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 "\\binterface\\b|\\bsealed\\b|\\bvolatile\\b|\\bdelegate\\b|\\binternal\\b|\\bshort\\b|\\bvoid\\b|\\bdo\\b|\\bis\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 "\\bsizeof\\b|\\bwhile\\b|\\bdouble\\b|\\block\\b|\\bstackalloc\\b|\\belse\\b|\\blong\\b|\\bstatic\\b|\\benum\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
603 "\\bnamespace\\b|\\bstring\\b)";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
604
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 static string keywords_vb =
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 "(\\bAddHandler\\b|\\bAddressOf\\b|\\bAlias\\b|\\bAnd\\b|\\bAndAlso\\b|\\bAnsi\\b|\\bAs\\b|\\bAssembly\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
607 "\\bAuto\\b|\\bBoolean\\b|\\bByRef\\b|\\bByte\\b|\\bByVal\\b|\\bCall\\b|\\bCase\\b|\\bCatch\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 "\\bCBool\\b|\\bCByte\\b|\\bCChar\\b|\\bCDate\\b|\\bCDec\\b|\\bCDbl\\b|\\bChar\\b|\\bCInt\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 "\\bClass\\b|\\bCLng\\b|\\bCObj\\b|\\bConst\\b|\\bCShort\\b|\\bCSng\\b|\\bCStr\\b|\\bCType\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
610 "\\bDate\\b|\\bDecimal\\b|\\bDeclare\\b|\\bDefault\\b|\\bDelegate\\b|\\bDim\\b|\\bDirectCast\\b|\\bDo\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 "\\bDouble\\b|\\bEach\\b|\\bElse\\b|\\bElseIf\\b|\\bEnd\\b|\\bEnum\\b|\\bErase\\b|\\bError\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
612 "\\bEvent\\b|\\bExit\\b|\\bFalse\\b|\\bFinally\\b|\\bFor\\b|\\bFriend\\b|\\bFunction\\b|\\bGet\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 "\\bGetType\\b|\\bGoSub\\b|\\bGoTo\\b|\\bHandles\\b|\\bIf\\b|\\bImplements\\b|\\bImports\\b|\\bIn\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
614 "\\bInherits\\b|\\bInteger\\b|\\bInterface\\b|\\bIs\\b|\\bLet\\b|\\bLib\\b|\\bLike\\b|\\bLong\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 "\\bLoop\\b|\\bMe\\b|\\bMod\\b|\\bModule\\b|\\bMustInherit\\b|\\bMustOverride\\b|\\bMyBase\\b|\\bMyClass\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
616 "\\bNamespace\\b|\\bNew\\b|\\bNext\\b|\\bNot\\b|\\bNothing\\b|\\bNotInheritable\\b|\\bNotOverridable\\b|\\bObject\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 "\\bOn\\b|\\bOption\\b|\\bOptional\\b|\\bOr\\b|\\bOrElse\\b|\\bOverloads\\b|\\bOverridable\\b|\\bOverrides\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
618 "\\bParamArray\\b|\\bPreserve\\b|\\bPrivate\\b|\\bProperty\\b|\\bProtected\\b|\\bPublic\\b|\\bRaiseEvent\\b|\\bReadOnly\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
619 "\\bReDim\\b|\\bREM\\b|\\bRemoveHandler\\b|\\bResume\\b|\\bReturn\\b|\\bSelect\\b|\\bSet\\b|\\bShadows\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
620 "\\bShared\\b|\\bShort\\b|\\bSingle\\b|\\bStatic\\b|\\bStep\\b|\\bStop\\b|\\bString\\b|\\bStructure\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
621 "\\bSub\\b|\\bSyncLock\\b|\\bThen\\b|\\bThrow\\b|\\bTo\\b|\\bTrue\\b|\\bTry\\b|\\bTypeOf\\b|" +
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 "\\bUnicode\\b|\\bUntil\\b|\\bVariant\\b|\\bWhen\\b|\\bWhile\\b|\\bWith\\b|\\bWithEvents\\b|\\bWriteOnly\\b|\\bXor\\b)";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
623
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 string Colorize (string text, string lang)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 if (lang == "xml") return ColorizeXml (text);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
627 else if (lang == "cs") return ColorizeCs (text);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
628 else if (lang == "vb") return ColorizeVb (text);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 else return text;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
631
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
632 string ColorizeXml (string text)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
634 text = text.Replace (" ", "&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
635 Regex re = new Regex ("\r\n|\r|\n");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
636 text = re.Replace (text, "_br_");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
637
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 re = new Regex ("<\\s*(\\/?)\\s*([\\s\\S]*?)\\s*(\\/?)\\s*>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 text = re.Replace (text,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
640
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 re = new Regex ("\\{(\\w*):([\\s\\S]*?)\\}");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 text = re.Replace (text,"<span style='color:$1'>$2</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
643
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 re = new Regex ("\"(.*?)\"");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 text = re.Replace (text,"\"<span style='color:purple'>$1</span>\"");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
646
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
647
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 text = text.Replace ("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 text = text.Replace ("_br_", "<br>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 return text;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
652
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 string ColorizeCs (string text)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 text = text.Replace (" ", "&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
656
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 text = text.Replace ("<", "&lt;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 text = text.Replace (">", "&gt;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
659
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
662
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 re = new Regex ("//(((.(?!\"</span>))|\"(((?!\").)*)\"</span>)*)(\r|\n|\r\n)");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
665
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 re = new Regex (keywords_cs);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 text = re.Replace (text,"<span style='color:blue'>$1</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
668
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
669 text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 text = text.Replace ("\n","<br/>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
671
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
672 return text;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
674
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
675 string ColorizeVb (string text)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
676 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 text = text.Replace (" ", "&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
678
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 /* Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
680 text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
681
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 re = new Regex ("'(((.(?!\"\\<\\/span\\>))|\"(((?!\").)*)\"\\<\\/span\\>)*)(\r|\n|\r\n)");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
684
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
685 re = new Regex (keywords_vb);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 text = re.Replace (text,"<span style='color:blue'>$1</span>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 */
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 text = text.Replace ("\n","<br/>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 return text;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
692
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 // Helper methods and classes
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 //
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
696
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 string GetDataContext ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 return "op=" + CurrentOperationName + "&bnd=" + CurrentOperationBinding + "&";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
700 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
701
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 string GetOptionSel (string v1, string v2)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
704 string op = "<option ";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 if (v1 == v2) op += "selected ";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
706 return op + "value='" + v1 + "'>";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
707 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
708
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
709 string WrapText (string text, int maxChars)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 text = text.Replace(" />","/>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
712
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
713 string linspace = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
714 int lincount = 0;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
715 int breakpos = 0;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 int linstart = 0;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
717 bool inquotes = false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
718 char lastc = ' ';
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
719 string sublineIndent = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
720 System.Text.StringBuilder sb = new System.Text.StringBuilder ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
721 for (int n=0; n<text.Length; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
722 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
723 char c = text [n];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
724
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 if (c=='\r' || c=='\n' || n==text.Length-1)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
726 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
727 sb.Append (linspace + sublineIndent + text.Substring (linstart, n-linstart+1));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
728 linspace = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
729 lincount = 0;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
730 linstart = n+1;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
731 breakpos = linstart;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
732 sublineIndent = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
733 lastc = c;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
734 continue;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
735 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
736
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
737 if (lastc==',' || lastc=='(')
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
738 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
739 if (!inquotes) breakpos = n;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
740 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
741
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
742 if (lincount > maxChars && breakpos >= linstart)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
743 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
744 if (linspace != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
745 sb.Append (linspace + sublineIndent);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
746 sb.Append (text.Substring (linstart, breakpos-linstart));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
747 sb.Append ("\n");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
748 sublineIndent = " ";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
749 lincount = linspace.Length + sublineIndent.Length + (n-breakpos);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
750 linstart = breakpos;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
751 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
752
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
753 if (c==' ' || c=='\t')
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
754 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
755 if (!inquotes)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
756 breakpos = n;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
757 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
758 else if (c=='"')
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
760 inquotes = !inquotes;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
761 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
762 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
763 if (linspace == null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
764 linspace = text.Substring (linstart, n-linstart);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
765 linstart = n;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
766 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
767
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
768 lincount++;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
769 lastc = c;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
770 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
771 return sb.ToString ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
772 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
773
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
774 class Parameter
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
775 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
776 string name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
777 string type;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
778 string description;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
779
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
780 public string Name { get { return name; } set { name = value; } }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
781 public string Type { get { return type; } set { type = value; } }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
782 public string Description { get { return description; } set { description = value; } }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
783 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
784
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
785 public class HtmlSampleGenerator: SampleGenerator
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
786 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
787 public HtmlSampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
788 : base (services, schemas)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
789 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
790 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
791
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
792 protected override string GetLiteral (string s)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
793 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
794 return "@placeholder!" + s + "!placeholder@";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
795 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
796 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
797
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
798
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
799 public class SampleGenerator
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
800 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
801 protected ServiceDescriptionCollection descriptions;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
802 protected XmlSchemas schemas;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
803 XmlSchemaElement anyElement;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
804 ArrayList queue;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
805 SoapBindingUse currentUse;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
806 XmlDocument document = new XmlDocument ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
807
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
808 static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
809 static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array","http://schemas.xmlsoap.org/soap/encoding/");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
810 static readonly XmlQualifiedName arrayTypeRefName = new XmlQualifiedName ("arrayType","http://schemas.xmlsoap.org/soap/encoding/");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
811 const string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
812 const string WsdlNamespace = "http://schemas.xmlsoap.org/wsdl/";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
813 const string SoapEncodingNamespace = "http://schemas.xmlsoap.org/soap/encoding/";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
814
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
815 class EncodedType
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
816 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
817 public EncodedType (string ns, XmlSchemaElement elem) { Namespace = ns; Element = elem; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
818 public string Namespace;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
819 public XmlSchemaElement Element;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
820 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
821
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
822 public SampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
823 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
824 descriptions = services;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
825 this.schemas = schemas;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
826 queue = new ArrayList ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
827 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
828
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
829 public string GenerateMessage (Port port, OperationBinding obin, Operation oper, string protocol, bool generateInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
830 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
831 OperationMessage msg = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
832 foreach (OperationMessage opm in oper.Messages)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
833 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
834 if (opm is OperationInput && generateInput) msg = opm;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
835 else if (opm is OperationOutput && !generateInput) msg = opm;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
836 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
837 if (msg == null) return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
838
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
839 switch (protocol) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
840 case "Soap": return GenerateHttpSoapMessage (port, obin, oper, msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
841 case "HttpGet": return GenerateHttpGetMessage (port, obin, oper, msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
842 case "HttpPost": return GenerateHttpPostMessage (port, obin, oper, msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
843 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
844 return "Unknown protocol";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
845 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
846
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
847 public string GenerateHttpSoapMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
848 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
849 string req = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
850
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
851 if (msg is OperationInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
852 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
853 SoapAddressBinding sab = port.Extensions.Find (typeof(SoapAddressBinding)) as SoapAddressBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
854 SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
855 req += "POST " + new Uri (sab.Location).AbsolutePath + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
856 req += "SOAPAction: " + sob.SoapAction + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
857 req += "Content-Type: text/xml; charset=utf-8\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
858 req += "Content-Length: " + GetLiteral ("string") + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
859 req += "Host: " + GetLiteral ("string") + "\n\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
860 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
861 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
862 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
863 req += "HTTP/1.0 200 OK\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
864 req += "Content-Type: text/xml; charset=utf-8\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
865 req += "Content-Length: " + GetLiteral ("string") + "\n\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
866 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
867
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
868 req += GenerateSoapMessage (obin, oper, msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
869 return req;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
870 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
871
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
872 public string GenerateHttpGetMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
873 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
874 string req = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
875
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
876 if (msg is OperationInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
877 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
878 HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
879 HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
880 string location = new Uri (sab.Location).AbsolutePath + sob.Location + "?" + BuildQueryString (msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
881 req += "GET " + location + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
882 req += "Host: " + GetLiteral ("string");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
883 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
884 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
885 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
886 req += "HTTP/1.0 200 OK\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
887 req += "Content-Type: text/xml; charset=utf-8\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
888 req += "Content-Length: " + GetLiteral ("string") + "\n\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
889
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
890 MimeXmlBinding mxb = (MimeXmlBinding) obin.Output.Extensions.Find (typeof(MimeXmlBinding)) as MimeXmlBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
891 if (mxb == null) return req;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
892
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
893 Message message = descriptions.GetMessage (msg.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
894 XmlQualifiedName ename = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
895 foreach (MessagePart part in message.Parts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
896 if (part.Name == mxb.Part) ename = part.Element;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
897
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
898 if (ename == null) return req + GetLiteral("string");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
899
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
900 StringWriter sw = new StringWriter ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
901 XmlTextWriter xtw = new XmlTextWriter (sw);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
902 xtw.Formatting = Formatting.Indented;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
903 currentUse = SoapBindingUse.Literal;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
904 WriteRootElementSample (xtw, ename);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
905 xtw.Close ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
906 req += sw.ToString ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
907 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
908
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
909 return req;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
910 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
911
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
912 public string GenerateHttpPostMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
913 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
914 string req = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
915
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
916 if (msg is OperationInput)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
917 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
918 HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
919 HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
920 string location = new Uri (sab.Location).AbsolutePath + sob.Location;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
921 req += "POST " + location + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
922 req += "Content-Type: application/x-www-form-urlencoded\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
923 req += "Content-Length: " + GetLiteral ("string") + "\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
924 req += "Host: " + GetLiteral ("string") + "\n\n";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
925 req += BuildQueryString (msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
926 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
927 else return GenerateHttpGetMessage (port, obin, oper, msg);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
928
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
929 return req;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
930 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
931
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
932 string BuildQueryString (OperationMessage opm)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
933 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
934 string s = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
935 Message msg = descriptions.GetMessage (opm.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
936 foreach (MessagePart part in msg.Parts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
937 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
938 if (s.Length != 0) s += "&";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
939 s += part.Name + "=" + GetLiteral (part.Type.Name);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
940 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
941 return s;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
942 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
943
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
944 public string GenerateSoapMessage (OperationBinding obin, Operation oper, OperationMessage msg)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
945 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
946 SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
947 SoapBindingStyle style = (sob != null) ? sob.Style : SoapBindingStyle.Document;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
948
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
949 MessageBinding msgbin = (msg is OperationInput) ? (MessageBinding) obin.Input : (MessageBinding)obin.Output;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
950 SoapBodyBinding sbb = msgbin.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
951 SoapBindingUse bodyUse = (sbb != null) ? sbb.Use : SoapBindingUse.Literal;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
952
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
953 StringWriter sw = new StringWriter ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
954 XmlTextWriter xtw = new XmlTextWriter (sw);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
955 xtw.Formatting = Formatting.Indented;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
956
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
957 xtw.WriteStartDocument ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
958 xtw.WriteStartElement ("soap", "Envelope", SoapEnvelopeNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
959 xtw.WriteAttributeString ("xmlns", "xsi", null, XmlSchema.InstanceNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
960 xtw.WriteAttributeString ("xmlns", "xsd", null, XmlSchema.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
961
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
962 if (bodyUse == SoapBindingUse.Encoded)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
963 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
964 xtw.WriteAttributeString ("xmlns", "soapenc", null, SoapEncodingNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
965 xtw.WriteAttributeString ("xmlns", "tns", null, msg.Message.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
966 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
967
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
968 // Serialize headers
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
969
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
970 bool writtenHeader = false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
971 foreach (object ob in msgbin.Extensions)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
972 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
973 SoapHeaderBinding hb = ob as SoapHeaderBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
974 if (hb == null) continue;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
975
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
976 if (!writtenHeader) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
977 xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
978 writtenHeader = true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
979 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
980
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
981 WriteHeader (xtw, hb);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
982 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
983
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
984 if (writtenHeader)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
985 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
986
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
987 // Serialize body
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
988 xtw.WriteStartElement ("soap", "Body", SoapEnvelopeNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
989
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
990 currentUse = bodyUse;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
991 WriteBody (xtw, oper, msg, sbb, style);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
992
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
993 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
994 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
995 xtw.Close ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
996 return sw.ToString ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
997 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
998
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
999 void WriteHeader (XmlTextWriter xtw, SoapHeaderBinding header)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1000 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1001 Message msg = descriptions.GetMessage (header.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1002 if (msg == null) throw new InvalidOperationException ("Message " + header.Message + " not found");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1003 MessagePart part = msg.Parts [header.Part];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1004 if (part == null) throw new InvalidOperationException ("Message part " + header.Part + " not found in message " + header.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1005
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1006 currentUse = header.Use;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1007
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1008 if (currentUse == SoapBindingUse.Literal)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1009 WriteRootElementSample (xtw, part.Element);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1010 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1011 WriteTypeSample (xtw, part.Type);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1012 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1013
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1014 void WriteBody (XmlTextWriter xtw, Operation oper, OperationMessage opm, SoapBodyBinding sbb, SoapBindingStyle style)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1015 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1016 Message msg = descriptions.GetMessage (opm.Message);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1017 if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1018 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1019 MessagePart part = msg.Parts[0];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1020 if (part.Element == XmlQualifiedName.Empty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1021 WriteTypeSample (xtw, part.Type);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1022 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1023 WriteRootElementSample (xtw, part.Element);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1024 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1025 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1026 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1027 string elemName = oper.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1028 string ns = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1029 if (opm is OperationOutput) elemName += "Response";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1030
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1031 if (style == SoapBindingStyle.Rpc) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1032 xtw.WriteStartElement (elemName, sbb.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1033 ns = sbb.Namespace;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1034 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1035
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1036 foreach (MessagePart part in msg.Parts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1037 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1038 if (part.Element == XmlQualifiedName.Empty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1039 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1040 XmlSchemaElement elem = new XmlSchemaElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1041 elem.SchemaTypeName = part.Type;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1042 elem.Name = part.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1043 WriteElementSample (xtw, ns, elem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1044 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1045 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1046 WriteRootElementSample (xtw, part.Element);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1047 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1048
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1049 if (style == SoapBindingStyle.Rpc)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1050 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1051 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1052 WriteQueuedTypeSamples (xtw);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1053 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1054
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1055 void WriteRootElementSample (XmlTextWriter xtw, XmlQualifiedName qname)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1056 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1057 XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (qname, typeof(XmlSchemaElement));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1058 if (elem == null) throw new InvalidOperationException ("Element not found: " + qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1059 WriteElementSample (xtw, qname.Namespace, elem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1060 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1061
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1062 void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1063 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1064 bool sharedAnnType = false;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1065 XmlQualifiedName root;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1066
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1067 if (!elem.RefName.IsEmpty) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1068 XmlSchemaElement refElem = FindRefElement (elem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1069 if (refElem == null) throw new InvalidOperationException ("Global element not found: " + elem.RefName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1070 root = elem.RefName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1071 elem = refElem;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1072 sharedAnnType = true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1073 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1074 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1075 root = new XmlQualifiedName (elem.Name, ns);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1076
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1077 if (!elem.SchemaTypeName.IsEmpty)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1078 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1079 XmlSchemaComplexType st = FindComplexTyype (elem.SchemaTypeName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1080 if (st != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1081 WriteComplexTypeSample (xtw, st, root);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1082 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1083 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1084 xtw.WriteStartElement (root.Name, root.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1085 if (currentUse == SoapBindingUse.Encoded)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1086 xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, elem.SchemaTypeName));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1087 xtw.WriteString (GetLiteral (FindBuiltInType (elem.SchemaTypeName)));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1088 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1089 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1090 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1091 else if (elem.SchemaType == null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1092 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1093 xtw.WriteStartElement ("any");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1094 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1095 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1096 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1097 WriteComplexTypeSample (xtw, (XmlSchemaComplexType) elem.SchemaType, root);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1098 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1099
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1100 void WriteTypeSample (XmlTextWriter xtw, XmlQualifiedName qname)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1101 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1102 XmlSchemaComplexType ctype = FindComplexTyype (qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1103 if (ctype != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1104 WriteComplexTypeSample (xtw, ctype, qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1105 return;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1106 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1107
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1108 XmlSchemaSimpleType stype = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1109 if (stype != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1110 WriteSimpleTypeSample (xtw, stype);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1111 return;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1112 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1113
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1114 xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1115 throw new InvalidOperationException ("Type not found: " + qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1116 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1117
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1118 void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1119 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1120 WriteComplexTypeSample (xtw, stype, rootName, -1);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1121 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1122
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1123 void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName, int id)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1124 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1125 string ns = rootName.Namespace;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1126
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1127 if (rootName.Name.IndexOf ("[]") != -1) rootName = arrayType;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1128
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1129 if (currentUse == SoapBindingUse.Encoded) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1130 string pref = xtw.LookupPrefix (rootName.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1131 if (pref == null) pref = "q1";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1132 xtw.WriteStartElement (pref, rootName.Name, rootName.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1133 ns = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1134 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1135 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1136 xtw.WriteStartElement (rootName.Name, rootName.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1137
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1138 if (id != -1)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1139 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1140 xtw.WriteAttributeString ("id", "id" + id);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1141 if (rootName != arrayType)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1142 xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, rootName));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1143 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1144
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1145 WriteComplexTypeAttributes (xtw, stype);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1146 WriteComplexTypeElements (xtw, ns, stype);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1147
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1148 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1149 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1150
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1151 void WriteComplexTypeAttributes (XmlTextWriter xtw, XmlSchemaComplexType stype)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1152 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1153 WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1154 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1155
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1156 void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1157 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1158 if (stype.Particle != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1159 WriteParticleComplexContent (xtw, ns, stype.Particle);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1160 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1161 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1162 if (stype.ContentModel is XmlSchemaSimpleContent)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1163 WriteSimpleContent (xtw, (XmlSchemaSimpleContent)stype.ContentModel);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1164 else if (stype.ContentModel is XmlSchemaComplexContent)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1165 WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1166 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1167 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1168
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1169 void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1170 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1171 foreach (XmlSchemaObject at in atts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1172 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1173 if (at is XmlSchemaAttribute)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1174 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1175 string ns;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1176 XmlSchemaAttribute attr = (XmlSchemaAttribute)at;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1177 XmlSchemaAttribute refAttr = attr;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1178
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1179 // refAttr.Form; TODO
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1180
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1181 if (!attr.RefName.IsEmpty) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1182 refAttr = FindRefAttribute (attr.RefName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1183 if (refAttr == null) throw new InvalidOperationException ("Global attribute not found: " + attr.RefName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1184 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1185
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1186 string val;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1187 if (!refAttr.SchemaTypeName.IsEmpty) val = FindBuiltInType (refAttr.SchemaTypeName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1188 else val = FindBuiltInType ((XmlSchemaSimpleType) refAttr.SchemaType);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1189
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1190 xtw.WriteAttributeString (refAttr.Name, val);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1191 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1192 else if (at is XmlSchemaAttributeGroupRef)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1193 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1194 XmlSchemaAttributeGroupRef gref = (XmlSchemaAttributeGroupRef)at;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1195 XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1196 WriteAttributes (xtw, grp.Attributes, grp.AnyAttribute);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1197 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1198 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1199
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1200 if (anyat != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1201 xtw.WriteAttributeString ("custom-attribute","value");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1202 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1203
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1204 void WriteParticleComplexContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1205 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1206 WriteParticleContent (xtw, ns, particle, false);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1207 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1208
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1209 void WriteParticleContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle, bool multiValue)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1210 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1211 if (particle is XmlSchemaGroupRef)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1212 particle = GetRefGroupParticle ((XmlSchemaGroupRef)particle);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1213
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1214 if (particle.MaxOccurs > 1) multiValue = true;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1215
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1216 if (particle is XmlSchemaSequence) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1217 WriteSequenceContent (xtw, ns, ((XmlSchemaSequence)particle).Items, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1218 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1219 else if (particle is XmlSchemaChoice) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1220 if (((XmlSchemaChoice)particle).Items.Count == 1)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1221 WriteSequenceContent (xtw, ns, ((XmlSchemaChoice)particle).Items, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1222 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1223 WriteChoiceContent (xtw, ns, (XmlSchemaChoice)particle, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1224 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1225 else if (particle is XmlSchemaAll) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1226 WriteSequenceContent (xtw, ns, ((XmlSchemaAll)particle).Items, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1227 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1228 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1229
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1230 void WriteSequenceContent (XmlTextWriter xtw, string ns, XmlSchemaObjectCollection items, bool multiValue)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1231 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1232 foreach (XmlSchemaObject item in items)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1233 WriteContentItem (xtw, ns, item, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1234 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1235
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1236 void WriteContentItem (XmlTextWriter xtw, string ns, XmlSchemaObject item, bool multiValue)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1237 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1238 if (item is XmlSchemaGroupRef)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1239 item = GetRefGroupParticle ((XmlSchemaGroupRef)item);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1240
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1241 if (item is XmlSchemaElement)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1242 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1243 XmlSchemaElement elem = (XmlSchemaElement) item;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1244 XmlSchemaElement refElem;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1245 if (!elem.RefName.IsEmpty) refElem = FindRefElement (elem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1246 else refElem = elem;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1247
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1248 int num = (elem.MaxOccurs == 1 && !multiValue) ? 1 : 2;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1249 for (int n=0; n<num; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1250 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1251 if (currentUse == SoapBindingUse.Literal)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1252 WriteElementSample (xtw, ns, refElem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1253 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1254 WriteRefTypeSample (xtw, ns, refElem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1255 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1256 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1257 else if (item is XmlSchemaAny)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1258 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1259 xtw.WriteString (GetLiteral ("xml"));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1260 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1261 else if (item is XmlSchemaParticle) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1262 WriteParticleContent (xtw, ns, (XmlSchemaParticle)item, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1263 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1264 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1265
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1266 void WriteChoiceContent (XmlTextWriter xtw, string ns, XmlSchemaChoice choice, bool multiValue)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1267 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1268 foreach (XmlSchemaObject item in choice.Items)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1269 WriteContentItem (xtw, ns, item, multiValue);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1270 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1271
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1272 void WriteSimpleContent (XmlTextWriter xtw, XmlSchemaSimpleContent content)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1273 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1274 XmlSchemaSimpleContentExtension ext = content.Content as XmlSchemaSimpleContentExtension;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1275 if (ext != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1276 WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1277
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1278 XmlQualifiedName qname = GetContentBaseType (content.Content);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1279 xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1280 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1281
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1282 string FindBuiltInType (XmlQualifiedName qname)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1283 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1284 if (qname.Namespace == XmlSchema.Namespace)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1285 return qname.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1286
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1287 XmlSchemaComplexType ct = FindComplexTyype (qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1288 if (ct != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1289 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1290 XmlSchemaSimpleContent sc = ct.ContentModel as XmlSchemaSimpleContent;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1291 if (sc == null) throw new InvalidOperationException ("Invalid schema");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1292 return FindBuiltInType (GetContentBaseType (sc.Content));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1293 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1294
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1295 XmlSchemaSimpleType st = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1296 if (st != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1297 return FindBuiltInType (st);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1298
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1299 throw new InvalidOperationException ("Definition of type " + qname + " not found");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1300 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1301
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1302 string FindBuiltInType (XmlSchemaSimpleType st)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1303 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1304 if (st.Content is XmlSchemaSimpleTypeRestriction) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1305 return FindBuiltInType (GetContentBaseType (st.Content));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1306 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1307 else if (st.Content is XmlSchemaSimpleTypeList) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1308 string s = FindBuiltInType (GetContentBaseType (st.Content));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1309 return s + " " + s + " ...";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1310 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1311 else if (st.Content is XmlSchemaSimpleTypeUnion)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1312 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1313 //Check if all types of the union are equal. If not, then will use anyType.
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1314 XmlSchemaSimpleTypeUnion uni = (XmlSchemaSimpleTypeUnion) st.Content;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1315 string utype = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1316
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1317 // Anonymous types are unique
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1318 if (uni.BaseTypes.Count != 0 && uni.MemberTypes.Length != 0)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1319 return "string";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1320
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1321 foreach (XmlQualifiedName mt in uni.MemberTypes)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1322 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1323 string qn = FindBuiltInType (mt);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1324 if (utype != null && qn != utype) return "string";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1325 else utype = qn;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1326 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1327 return utype;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1328 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1329 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1330 return "string";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1331 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1332
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1333
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1334 XmlQualifiedName GetContentBaseType (XmlSchemaObject ob)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1335 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1336 if (ob is XmlSchemaSimpleContentExtension)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1337 return ((XmlSchemaSimpleContentExtension)ob).BaseTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1338 else if (ob is XmlSchemaSimpleContentRestriction)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1339 return ((XmlSchemaSimpleContentRestriction)ob).BaseTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1340 else if (ob is XmlSchemaSimpleTypeRestriction)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1341 return ((XmlSchemaSimpleTypeRestriction)ob).BaseTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1342 else if (ob is XmlSchemaSimpleTypeList)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1343 return ((XmlSchemaSimpleTypeList)ob).ItemTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1344 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1345 return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1346 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1347
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1348 void WriteComplexContent (XmlTextWriter xtw, string ns, XmlSchemaComplexContent content)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1349 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1350 XmlQualifiedName qname;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1351
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1352 XmlSchemaComplexContentExtension ext = content.Content as XmlSchemaComplexContentExtension;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1353 if (ext != null) qname = ext.BaseTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1354 else {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1355 XmlSchemaComplexContentRestriction rest = (XmlSchemaComplexContentRestriction)content.Content;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1356 qname = rest.BaseTypeName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1357 if (qname == arrayType) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1358 ParseArrayType (rest, out qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1359 XmlSchemaElement elem = new XmlSchemaElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1360 elem.Name = "Item";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1361 elem.SchemaTypeName = qname;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1362
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1363 xtw.WriteAttributeString ("arrayType", SoapEncodingNamespace, qname.Name + "[2]");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1364 WriteContentItem (xtw, ns, elem, true);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1365 return;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1366 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1367 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1368
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1369 // Add base map members to this map
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1370 XmlSchemaComplexType ctype = FindComplexTyype (qname);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1371 WriteComplexTypeAttributes (xtw, ctype);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1372
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1373 if (ext != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1374 // Add the members of this map
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1375 WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1376 if (ext.Particle != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1377 WriteParticleComplexContent (xtw, ns, ext.Particle);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1378 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1379
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1380 WriteComplexTypeElements (xtw, ns, ctype);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1381 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1382
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1383 void ParseArrayType (XmlSchemaComplexContentRestriction rest, out XmlQualifiedName qtype)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1384 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1385 XmlSchemaAttribute arrayTypeAt = FindArrayAttribute (rest.Attributes);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1386 XmlAttribute[] uatts = arrayTypeAt.UnhandledAttributes;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1387 if (uatts == null || uatts.Length == 0) throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1388
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1389 XmlAttribute xat = null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1390 foreach (XmlAttribute at in uatts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1391 if (at.LocalName == "arrayType" && at.NamespaceURI == WsdlNamespace)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1392 { xat = at; break; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1393
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1394 if (xat == null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1395 throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1396
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1397 string arrayType = xat.Value;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1398 string type, ns;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1399 int i = arrayType.LastIndexOf (":");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1400 if (i == -1) ns = "";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1401 else ns = arrayType.Substring (0,i);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1402
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1403 int j = arrayType.IndexOf ("[", i+1);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1404 if (j == -1) throw new InvalidOperationException ("Cannot parse WSDL array type: " + arrayType);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1405 type = arrayType.Substring (i+1);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1406 type = type.Substring (0, type.Length-2);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1407
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1408 qtype = new XmlQualifiedName (type, ns);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1409 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1410
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1411 XmlSchemaAttribute FindArrayAttribute (XmlSchemaObjectCollection atts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1412 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1413 foreach (object ob in atts)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1414 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1415 XmlSchemaAttribute att = ob as XmlSchemaAttribute;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1416 if (att != null && att.RefName == arrayTypeRefName) return att;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1417
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1418 XmlSchemaAttributeGroupRef gref = ob as XmlSchemaAttributeGroupRef;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1419 if (gref != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1420 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1421 XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1422 att = FindArrayAttribute (grp.Attributes);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1423 if (att != null) return att;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1424 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1425 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1426 return null;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1427 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1428
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1429 void WriteSimpleTypeSample (XmlTextWriter xtw, XmlSchemaSimpleType stype)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1430 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1431 xtw.WriteString (GetLiteral (FindBuiltInType (stype)));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1432 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1433
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1434 XmlSchemaParticle GetRefGroupParticle (XmlSchemaGroupRef refGroup)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1435 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1436 XmlSchemaGroup grp = (XmlSchemaGroup) schemas.Find (refGroup.RefName, typeof (XmlSchemaGroup));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1437 return grp.Particle;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1438 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1439
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1440 XmlSchemaElement FindRefElement (XmlSchemaElement elem)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1441 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1442 if (elem.RefName.Namespace == XmlSchema.Namespace)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1443 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1444 if (anyElement != null) return anyElement;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1445 anyElement = new XmlSchemaElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1446 anyElement.Name = "any";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1447 anyElement.SchemaTypeName = anyType;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1448 return anyElement;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1449 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1450 return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1451 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1452
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1453 XmlSchemaAttribute FindRefAttribute (XmlQualifiedName refName)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1454 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1455 if (refName.Namespace == XmlSchema.Namespace)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1456 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1457 XmlSchemaAttribute at = new XmlSchemaAttribute ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1458 at.Name = refName.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1459 at.SchemaTypeName = new XmlQualifiedName ("string",XmlSchema.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1460 return at;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1461 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1462 return (XmlSchemaAttribute) schemas.Find (refName, typeof(XmlSchemaAttribute));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1463 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1464
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1465 void WriteRefTypeSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1466 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1467 if (elem.SchemaTypeName.Namespace == XmlSchema.Namespace || schemas.Find (elem.SchemaTypeName, typeof(XmlSchemaSimpleType)) != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1468 WriteElementSample (xtw, ns, elem);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1469 else
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1470 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1471 xtw.WriteStartElement (elem.Name, ns);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1472 xtw.WriteAttributeString ("href", "#id" + (queue.Count+1));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1473 xtw.WriteEndElement ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1474 queue.Add (new EncodedType (ns, elem));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1475 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1476 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1477
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1478 void WriteQueuedTypeSamples (XmlTextWriter xtw)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1479 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1480 for (int n=0; n<queue.Count; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1481 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1482 EncodedType ec = (EncodedType) queue[n];
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1483 XmlSchemaComplexType st = FindComplexTyype (ec.Element.SchemaTypeName);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1484 WriteComplexTypeSample (xtw, st, ec.Element.SchemaTypeName, n+1);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1485 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1486 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1487
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1488 XmlSchemaComplexType FindComplexTyype (XmlQualifiedName qname)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1489 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1490 if (qname.Name.IndexOf ("[]") != -1)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1491 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1492 XmlSchemaComplexType stype = new XmlSchemaComplexType ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1493 stype.ContentModel = new XmlSchemaComplexContent ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1494
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1495 XmlSchemaComplexContentRestriction res = new XmlSchemaComplexContentRestriction ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1496 stype.ContentModel.Content = res;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1497 res.BaseTypeName = arrayType;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1498
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1499 XmlSchemaAttribute att = new XmlSchemaAttribute ();
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1500 att.RefName = arrayTypeRefName;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1501 res.Attributes.Add (att);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1502
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1503 XmlAttribute xat = document.CreateAttribute ("arrayType", WsdlNamespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1504 xat.Value = qname.Namespace + ":" + qname.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1505 att.UnhandledAttributes = new XmlAttribute[] {xat};
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1506 return stype;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1507 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1508
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1509 return (XmlSchemaComplexType) schemas.Find (qname, typeof(XmlSchemaComplexType));
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1510 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1511
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1512 string GetQualifiedNameString (XmlTextWriter xtw, XmlQualifiedName qname)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1513 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1514 string pref = xtw.LookupPrefix (qname.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1515 if (pref != null) return pref + ":" + qname.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1516
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1517 xtw.WriteAttributeString ("xmlns", "q1", null, qname.Namespace);
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1518 return "q1:" + qname.Name;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1519 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1520
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1521 protected virtual string GetLiteral (string s)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1522 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1523 return s;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1524 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1525
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1526 void GetOperationFormat (OperationBinding obin, out SoapBindingStyle style, out SoapBindingUse use)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1527 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1528 style = SoapBindingStyle.Document;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1529 use = SoapBindingUse.Literal;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1530 SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1531 if (sob != null) {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1532 style = sob.Style;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1533 SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1534 if (sbb != null)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1535 use = sbb.Use;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1536 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1537 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1538 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1539
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1540
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1541
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1542
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1543
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1544 </script>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1545
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1546 <head>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1547 <link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1548
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1549 <title><%=WebServiceName%> Web Service</title>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1550 <style type="text/css">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1551 BODY { font-family: Arial; margin-left: 20px; margin-top: 20px; font-size: x-small}
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1552 TABLE { font-size: x-small }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1553 .title { color:dimgray; font-family: Arial; font-size:20pt; font-weight:900}
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1554 .operationTitle { color:dimgray; font-family: Arial; font-size:15pt; font-weight:900}
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1555 .method { font-size: x-small }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1556 .bindingLabel { font-size: x-small; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1557 .label { font-size: small; font-weight:bold; color:darkgray }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1558 .paramTable { font-size: x-small }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1559 .paramTable TR { background-color: gainsboro }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1560 .paramFormTable { font-size: x-small; padding: 10px; background-color: gainsboro }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1561 .paramFormTable TR { background-color: gainsboro }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1562 .paramInput { border: solid 1px gray }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1563 .button {border: solid 1px gray }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1564 .smallSeparator { height:3px; overflow:hidden }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1565 .panel { background-color:whitesmoke; border: solid 1px silver; border-top: solid 1px silver }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1566 .codePanel { background-color: white; font-size:x-small; padding:7px; border:solid 1px silver}
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1567 .code-xml { font-size:10pt; font-family:courier }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1568 .code-cs { font-size:10pt; font-family:courier }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1569 .code-vb { font-size:10pt; font-family:courier }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1570 .tabLabelOn { font-weight:bold }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1571 .tabLabelOff {color: darkgray }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1572 .literal-placeholder {color: darkblue; font-weight:bold}
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1573 A:link { color: black; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1574 A:visited { color: black; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1575 A:active { color: black; }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1576 A:hover { color: blue }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1577 </style>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1578
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1579 <script>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1580 function clearForm ()
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1581 {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1582 document.getElementById("testFormResult").style.display="none";
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1583 }
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1584 </script>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1585
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1586 </head>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1587
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1588 <body>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1589 <div class="title" style="margin-left:20px">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1590 <span class="label">Web Service</span><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1591 <%=WebServiceName%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1592 </div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1593
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1594 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1595 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1596 Left panel
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1597 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1598
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1599 <table border="0" width="100%" cellpadding="15px" cellspacing="15px">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1600 <tr valign="top"><td width="150px" class="panel">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1601 <div style="width:150px"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1602 <a class="method" href='<%=PageName%>'>Overview</a><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1603 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1604 <a class="method" href='<%=PageName + "?" + GetPageContext("wsdl")%>'>Service Description</a>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1605 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1606 <a class="method" href='<%=PageName + "?" + GetPageContext("proxy")%>'>Client proxy</a>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1607 <br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1608 <asp:repeater id="BindingsRepeater" runat=server>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1609 <itemtemplate name="itemtemplate">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1610 <span class="bindingLabel"><%#FormatBindingName(DataBinder.Eval(Container.DataItem, "Name").ToString())%></span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1611 <asp:repeater id="OperationsRepeater" runat=server datasource='<%# ((Binding)Container.DataItem).Operations %>'>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1612 <itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1613 <a class="method" href="<%=PageName%>?<%=GetTabContext("op",null)%>op=<%#GetOpName(Container.DataItem)%>&bnd=<%#DataBinder.Eval(Container.DataItem, "Binding.Name")%>"><%#GetOpName(Container.DataItem)%></a>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1614 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1615 </itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1616 </asp:repeater>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1617 <br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1618 </itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1619 </asp:repeater>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1620
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1621 </td><td class="panel">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1622
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1623 <% if (CurrentPage == "main") {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1624
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1625 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1626 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1627 Web service overview
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1628 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1629
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1630 <p class="label">Web Service Overview</p>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1631 <%=WebServiceDescription%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1632
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1633 <%} if (DefaultBinding == null) {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1634 This service does not contain any public web method.
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1635 <%} else if (CurrentPage == "op") {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1636
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1637 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1638 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1639 Operation description
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1640 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1641
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1642 <span class="operationTitle"><%=CurrentOperationName%></span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1643 <br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1644 <% WriteTabs (); %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1645 <br><br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1646
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1647 <% if (CurrentTab == "main") { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1648 <span class="label">Input Parameters</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1649 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1650 <% if (InParams.Count == 0) { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1651 No input parameters<br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1652 <% } else { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1653 <table class="paramTable" cellspacing="1" cellpadding="5">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1654 <asp:repeater id="InputParamsRepeater" runat=server>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1655 <itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1656 <tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1657 <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1658 <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1659 </tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1660 </itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1661 </asp:repeater>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1662 </table>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1663 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1664 <br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1665
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1666 <% if (OutParams.Count > 0) { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1667 <span class="label">Output Parameters</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1668 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1669 <table class="paramTable" cellspacing="1" cellpadding="5">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1670 <asp:repeater id="OutputParamsRepeater" runat=server>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1671 <itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1672 <tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1673 <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1674 <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1675 </tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1676 </itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1677 </asp:repeater>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1678 </table>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1679 <br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1680 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1681
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1682 <span class="label">Remarks</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1683 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1684 <%=OperationDocumentation%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1685 <br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1686 <span class="label">Technical information</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1687 <div class="smallSeparator"></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1688 Format: <%=CurrentOperationFormat%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1689 <br>Supported protocols: <%=CurrentOperationProtocols%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1690 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1691
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1692 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1693 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1694 Operation description - Test form
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1695 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1696
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1697 <% if (CurrentTab == "test") {
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1698 if (CurrentOperationSupportsTest) {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1699 Enter values for the parameters and click the 'Invoke' button to test this method:<br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1700 <form action="<%=PageName%>" method="GET">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1701 <input type="hidden" name="page" value="<%=CurrentPage%>">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1702 <input type="hidden" name="tab" value="<%=CurrentTab%>">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1703 <input type="hidden" name="op" value="<%=CurrentOperationName%>">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1704 <input type="hidden" name="bnd" value="<%=CurrentOperationBinding%>">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1705 <input type="hidden" name="ext" value="testform">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1706 <table class="paramFormTable" cellspacing="0" cellpadding="3">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1707 <asp:repeater id="InputFormParamsRepeater" runat=server>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1708 <itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1709 <tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1710 <td><%#DataBinder.Eval(Container.DataItem, "Name")%>:&nbsp;</td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1711 <td width="150"><input class="paramInput" type="text" size="20" name="<%#DataBinder.Eval(Container.DataItem, "Name")%>"></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1712 </tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1713 </itemtemplate>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1714 </asp:repeater>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1715 <tr><td></td><td><input class="button" type="submit" value="Invoke">&nbsp;<input class="button" type="button" onclick="clearForm()" value="Clear"></td></tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1716 </table>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1717 </form>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1718 <div id="testFormResult" style="display:<%= (HasFormResult?"block":"none") %>">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1719 The web service returned the following result:<br/><br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1720 <div class="codePanel"><%=GetTestResult()%></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1721 </div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1722 <% } else {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1723 The test form is not available for this operation because it has parameters with a complex structure.
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1724 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1725 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1726
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1727 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1728 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1729 Operation description - Message Layout
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1730 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1731
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1732 <% if (CurrentTab == "msg") { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1733
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1734 The following are sample SOAP requests and responses for each protocol supported by this method:
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1735 <br/><br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1736
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1737 <% if (IsOperationSupported ("Soap")) { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1738 <span class="label">Soap</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1739 <br/><br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1740 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("Soap", true)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1741 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1742 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("Soap", false)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1743 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1744 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1745 <% if (IsOperationSupported ("HttpGet")) { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1746 <span class="label">HTTP Get</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1747 <br/><br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1748 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpGet", true)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1749 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1750 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpGet", false)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1751 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1752 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1753 <% if (IsOperationSupported ("HttpPost")) { %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1754 <span class="label">HTTP Post</span>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1755 <br/><br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1756 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpPost", true)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1757 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1758 <div class="codePanel"><div class="code-xml"><%=GenerateOperationMessages ("HttpPost", false)%></div></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1759 <br/>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1760 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1761
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1762 <% } %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1763 <%} else if (CurrentPage == "proxy") {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1764 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1765 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1766 Client Proxy
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1767 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1768 <form action="<%=PageName%>" name="langForm" method="GET">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1769 Select the language for which you want to generate a proxy
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1770 <input type="hidden" name="page" value="<%=CurrentPage%>">&nbsp;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1771 <SELECT name="lang" onchange="langForm.submit()">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1772 <%=GetOptionSel("cs",CurrentLanguage)%>C#</option>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1773 <%=GetOptionSel("vb",CurrentLanguage)%>Visual Basic</option>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1774 </SELECT>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1775 &nbsp;&nbsp;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1776 </form>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1777 <br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1778 <span class="label"><%=CurrentProxytName%></span>&nbsp;&nbsp;&nbsp;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1779 <a href="<%=PageName + "?code=" + CurrentLanguage%>">Download</a>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1780 <br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1781 <div class="codePanel">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1782 <div class="code-<%=CurrentLanguage%>"><%=GetProxyCode ()%></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1783 </div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1784 <%} else if (CurrentPage == "wsdl") {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1785 <!--
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1786 **********************************************************
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1787 Service description
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1788 -->
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1789 <% if (descriptions.Count > 1 || schemas.Count > 1) {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1790 The description of this web service is composed by several documents. Click on the document you want to see:
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1791
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1792 <ul>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1793 <%
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1794 for (int n=0; n<descriptions.Count; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1795 Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=wsdl&docind=" + n + "'>WSDL document " + descriptions[n].TargetNamespace + "</a></li>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1796 for (int n=0; n<schemas.Count; n++)
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1797 Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=schema&docind=" + n + "'>Xml Schema " + schemas[n].TargetNamespace + "</a></li>");
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1798 %>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1799 </ul>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1800
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1801 <%} else {%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1802 <%}%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1803 <br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1804 <span class="label"><%=CurrentDocumentName%></span>&nbsp;&nbsp;&nbsp;
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1805 <a href="<%=PageName + "?" + CurrentDocType + "=" + CurrentDocInd %>">Download</a>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1806 <br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1807 <div class="codePanel">
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1808 <div class="code-xml"><%=GenerateDocument ()%></div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1809 </div>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1810
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1811 <%}%>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1812
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1813 <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1814 </td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1815 <td width="20px"></td>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1816 </tr>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1817
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1818 </table>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1819 </body>
fdab88fc2cb9 add game projects
Yuta ANSE <e135745@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1820 </html>