You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/02/22 15:57:17 UTC

svn commit: r154855 - webservices/axis/trunk/java/modules/samples/src/java/interop/util webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp

Author: deepal
Date: Tue Feb 22 06:57:14 2005
New Revision: 154855

URL: http://svn.apache.org/viewcvs?view=rev&rev=154855
Log:
added interopt testing jsp and related classes

Added:
    webservices/axis/trunk/java/modules/samples/src/java/interop/util/
    webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java
    webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp

Added: webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java?view=auto&rev=154855
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java (added)
+++ webservices/axis/trunk/java/modules/samples/src/java/interop/util/InteropTO.java Tue Feb 22 06:57:14 2005
@@ -0,0 +1,110 @@
+package org.apache.axis.interop.util;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Author : Deepal Jayasinghe
+ * Date: Feb 22, 2005
+ * Time: 5:49:58 PM
+ */
+public class InteropTO {
+    private String URL;
+    private String SOAPAction;
+    private String StringValue;
+    private String [] arraValue;
+    private String request;
+    private String response;
+
+    private String structString;
+    private int structint;
+    private float structfloat;
+
+    private int type;
+
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public String getURL() {
+        return URL;
+    }
+
+    public void setURL(String URL) {
+        this.URL = URL;
+    }
+
+    public String getSOAPAction() {
+        return SOAPAction;
+    }
+
+    public void setSOAPAction(String SOAPAction) {
+        this.SOAPAction = SOAPAction;
+    }
+
+    public String getStringValue() {
+        return StringValue;
+    }
+
+    public void setStringValue(String stringValue) {
+        this.StringValue = stringValue;
+    }
+
+    public String[] getArraValue() {
+        return arraValue;
+    }
+
+    public void setArraValue(String[] arraValue) {
+        this.arraValue = arraValue;
+    }
+
+    public String getStructString() {
+        return structString;
+    }
+
+    public void setStructString(String structString) {
+        this.structString = structString;
+    }
+
+    public int getStructint() {
+        return structint;
+    }
+
+    public void setStructint(int structint) {
+        this.structint = structint;
+    }
+
+    public float getStructfloat() {
+        return structfloat;
+    }
+
+    public void setStructfloat(float structfloat) {
+        this.structfloat = structfloat;
+    }
+
+    public String getRequest() {
+        return request;
+    }
+
+    public void setRequest(String request) {
+        this.request = request;
+    }
+
+    public String getResponse() {
+        return response;
+    }
+
+    public void setResponse(String response) {
+        this.response = response;
+    }
+
+    public void printMe(){
+        System.out.println("URL = " + URL);
+        System.out.println("StringValue = " + StringValue);
+        System.out.println("type = " + type);
+        System.out.println("SOAPAction = " + SOAPAction);
+    }
+}

Added: webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp?view=auto&rev=154855
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp (added)
+++ webservices/axis/trunk/java/modules/samples/src/jsp/index.jsp Tue Feb 22 06:57:14 2005
@@ -0,0 +1,272 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:useBean id="interopBean" scope="request" class="org.apache.axis.interop.util.InteropTO" />
+<jsp:setProperty name="interopBean" property="*" />
+
+
+<html>
+<%
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ %>
+<head>
+    <title>Axis 2 - Home</title>
+    <link href="css/axis-style.css" rel="stylesheet" type="text/css">
+    <script>
+       function displayStringRow(){
+              document.getElementById('StringRow').style.display = '';
+        }
+        function hideStringRow(){
+              document.getElementById('StringRow').style.display = 'none';
+        }
+
+        function displayStringArrayRow(){
+              document.getElementById('StringArrayRow').style.display = '';
+        }
+        function hideStringArrayRow(){
+              document.getElementById('StringArrayRow').style.display = 'none';
+        }
+
+        function displayStructRow(){
+              document.getElementById('StringStruct').style.display = '';
+        }
+        function hideStructRow(){
+              document.getElementById('StringStruct').style.display = 'none';
+        }
+
+
+
+    </script>
+</head>
+	<body>
+
+    <%
+      if (request.getParameter("submit") != null) {
+          int type = interopBean.getType();
+          switch(type){
+              case 1: {
+                   interopBean.setStringValue((String)request.getParameter("StringValue"));
+                  break;
+              }
+              case 2: {
+                  String [] values = new String[10];
+                  for(int i =1 ; i<= 10 ; i++){
+                     values[i] =(String)request.getParameter("arryValue" + i);
+                  }
+                  interopBean.setArraValue(values);
+                  break;
+              }
+              case 3 : {
+                  interopBean.setStructString((String)request.getParameter("structValue1"));
+                  interopBean.setStructint(Integer.parseInt(request.getParameter("structValue2")));
+                  interopBean.setStructfloat(Float.parseFloat(request.getParameter("structValue3")));
+                  break;
+              }
+          }
+          interopBean.setRequest(" <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
+"   <soapenv:Header></soapenv:Header>\n" +
+"   <soapenv:Body>\n" +
+"      <itop:echoStructParam xmlns:itop=\"http://soapinterop.org/xsd\">\n" +
+"         <itop:varString>Hello</itop:varString>\n" +
+"         <itop:varInt>12</itop:varInt>\n" +
+"         <itop:varFloat>22.22</itop:varFloat>\n" +
+"      </itop:echoStructParam>\n" +
+"   </soapenv:Body></soapenv:Envelope>");
+          interopBean.setResponse(" <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
+"   <soapenv:Header></soapenv:Header>\n" +
+"   <soapenv:Body>\n" +
+"      <itop:echoStructParam xmlns:itop=\"http://soapinterop.org/xsd\">\n" +
+"         <itop:varString>Hello</itop:varString>\n" +
+"         <itop:varInt>12</itop:varInt>\n" +
+"         <itop:varFloat>22.22</itop:varFloat>\n" +
+"      </itop:echoStructParam>\n" +
+"   </soapenv:Body></soapenv:Envelope>");
+          interopBean.printMe();
+      }
+    %>
+
+
+
+
+
+
+
+        <jsp:include page="include/header.inc"></jsp:include>
+       	<h3>Welcome to Axis interop testing.</h3><br/>
+        <br>
+        <form method="post" name="InteropTesting" action="index.jsp">
+         <table border="0" width="100%" cellspacing="1" cellpadding="1">
+          <tr>
+            <td vAlign="top" align="right" class="formText">Service URL :</td>
+            <td>
+                <input name="URL" maxlength="99" size="38" type="text" id="Name" class="textBox" value="<%= (interopBean.getURL()==null)?"":interopBean.getURL()%>">&nbsp;<small><font color="red">*</font></small>
+            </td>
+          </tr>
+          <tr>
+            <td vAlign="top" align="right" class="formText">SOAP Action :</td>
+            <td>
+                <input name="SOAPAction" maxlength="99" size="38" type="text" id="Name" class="textBox" value="<%= (interopBean.getSOAPAction()==null)?"":interopBean.getSOAPAction()%>">&nbsp;<small><font color="red">*</font></small>
+            </td>
+          </tr>
+          <td></td>
+          <tr>
+          <td></td>
+          <td>
+              <input type="radio" name="type" value="1"  onclick="displayStringRow();hideStringArrayRow();hideStructRow();"  checked>Echo String</input>
+          </td>
+          </tr>
+           <tr>
+           <td></td>
+            <td>
+              <input type="radio" name="type" onclick="hideStringRow(); displayStringArrayRow();hideStructRow();"  value="2">Echo String Array</input>
+          </td>
+          </tr>
+           <tr><td></td>
+           <td>
+              <input type="radio" name="type" onclick="hideStringRow();hideStringArrayRow();displayStructRow();" value="3">Echo strct</input>
+          </td>
+          </tr>
+          </table>
+<%--           <tr>--%>
+<%--          <td>--%>
+          <table border="1" width="100%" cellspacing="1" cellpadding="1">
+             <tr style="display:''" id="StringRow">
+               <td vAlign="top" align="right" class="formText">Enter String value :</td>
+               <td>
+                    <input name="StringValue" maxlength="99" size="38" type="text" class="textBox" value="<%= (interopBean.getStringValue()==null)?"":interopBean.getStringValue()%>">&nbsp;<small><font color="red">*</font></small>
+               </td>
+              </tr>
+              <tr style="display:none" id="StringArrayRow">
+           <td vAlign="top" align="right" class="formText">Enter String values for array :</td>
+           <td>
+            <table border="0" width="100%" cellspacing="1" cellpadding="1">
+                <tr>
+                   <input name="arryValue1" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue2" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue3" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue4" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue5" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue6" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue7" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue8" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue9" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+                <tr>
+                   <input name="arryValue10" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+                </tr>
+            </table>
+            </td>
+          </tr>
+          <tr style="display:none" id="StringStruct">
+          <td></td>
+          <td>
+          <table border="0" width="100%" cellspacing="1" cellpadding="1">
+          <tr>
+            <td vAlign="top" align="right" class="formText">Enter String values for array :</td>
+            <td>
+              <input name="structValue1" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+            </td>
+          </tr>
+            <tr>
+            <td vAlign="top" align="right" class="formText">Enter integer value for array :</td>
+            <td>
+              <input name="structValue2" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+            </td>
+          </tr>
+            <tr>
+            <td vAlign="top" align="right" class="formText">Enter float values for array :</td>
+            <td>
+              <input name="structValue3" maxlength="99" size="38" type="text" class="textBox">&nbsp;<small></small>
+            </td>
+            </td>
+          </tr>
+          </table>
+          </tr>
+
+          </table>
+          <table  border="0" width="100%" cellspacing="1" cellpadding="1">
+          <tr>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+           </tr>
+           <tr>
+           <tr>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+           </tr>
+          <tr>
+                <td width="40%" ></td>
+                <td>
+                     <input name="submit" type="submit" value=" Send " class="buttons" >
+                     <input name="reset" type="reset" value=" Clear " class="buttons" >
+                </td>
+           </tr>
+           <tr>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+           </tr>
+           <tr>
+           <tr>
+           <td>&nbsp;</td>
+           <td>&nbsp;</td>
+           </tr>
+          </table>
+          <table border="1" width="100%" cellspacing="1" cellpadding="1">
+          <tr><td>
+          <table border="1" width="100%" cellspacing="1" cellpadding="1">
+             <tr>
+              <td><b>Requst SOAP Message</b></td>
+             </tr>
+             <tr>
+             <td >
+              <textarea cols="55"  name="SOAPRequest" rows="20"><%= (interopBean.getRequest()==null) ? "" : interopBean.getRequest() %>
+</textarea>
+             </td>
+             </tr>
+          </table></td>
+          <td>
+            <table border="1" width="100%" cellspacing="1" cellpadding="1">
+             <tr>
+              <td><b>Response SOAP Message</b></td>
+             </tr>
+             <tr>
+             <td ><textarea cols="55" name="SOAPResponse" rows="20" ><%= (interopBean.getResponse()==null) ? "" : interopBean.getResponse() %>
+</textarea></td>
+             </tr>
+          </table>
+          </td>
+          </tr>
+        </form>
+
+
+        <jsp:include page="include/footer.inc"></jsp:include>
+	</body>
+</html>
\ No newline at end of file