axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r154675 - in webservices/axis/trunk/java/modules/samples: maven.xml src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java
Date Mon, 21 Feb 2005 13:52:48 GMT
Author: hemapani
Date: Mon Feb 21 05:52:47 2005
New Revision: 154675

URL: http://svn.apache.org/viewcvs?view=rev&rev=154675
Log:
get the build to work by avoid coping file to userguide sample ... need chatura to fix the
thingy correct

Modified:
    webservices/axis/trunk/java/modules/samples/maven.xml
    webservices/axis/trunk/java/modules/samples/src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java

Modified: webservices/axis/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/maven.xml?view=diff&r1=154674&r2=154675
==============================================================================
--- webservices/axis/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis/trunk/java/modules/samples/maven.xml Mon Feb 21 05:52:47 2005
@@ -44,7 +44,7 @@
 				<include name="userguide/sample1/**/*.class"/>
 			</fileset>
 		</copy>
-		<copy file="src/java/userguide/sample1/service.xml" tofile="target/jar-code/sample3/META-INF/service.xml"/>
+	<!---	<copy file="src/java/userguide/sample1/service.xml" tofile="target/jar-code/sample3/META-INF/service.xml"/>
-->
 		<jar jarfile="target/test-resources/samples/services/sample1.jar" basedir="target/jar-code/sample3"
>
 			<include name="**" />
 		</jar>

Modified: webservices/axis/trunk/java/modules/samples/src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java?view=diff&r1=154674&r2=154675
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java
(original)
+++ webservices/axis/trunk/java/modules/samples/src/java/org/apache/axis/testUtils/SimpleTypeEncodingUtils.java
Mon Feb 21 05:52:47 2005
@@ -13,200 +13,215 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
-package org.apache.axis.testUtils;
-
-import org.apache.axis.engine.AxisFault;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import java.util.ArrayList;
-
-public class SimpleTypeEncodingUtils {
-
-     public static byte[] deserializeByteArray(XMLStreamReader xpp)
-             throws AxisFault {
-        String val = deserializeString(xpp);
-        if (val == null) {
-            throw new AxisFault("Null recieved!!");
-        }
-        return val.getBytes();
-
-
-    }
-
-    public static String[] deserializeStringArray(XMLStreamReader xpp)
-            throws AxisFault {
-        ArrayList strings = new ArrayList();
-
-        try {
-            int event = xpp.next();
-            while (true) {
-                if (XMLStreamConstants.START_ELEMENT == event) {
-                    strings.add(deserializeString(xpp));
-                } else if (XMLStreamConstants.END_ELEMENT == event) {
-                    break;
-                } else if (XMLStreamConstants.END_DOCUMENT == event) {
-                    throw new AxisFault("premature and of file");
-                }
-                event = xpp.next();
-            }
-            String[] stringvals = new String[strings.size()];
-            for (int i = 0; i < strings.size(); i++) {
-                stringvals[i] = (String) strings.get(i);
-            }
-            return stringvals;
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-
-    }
-
-    public static String deserializeStringWithWiteSpaces(XMLStreamReader xpp)
-            throws AxisFault {
-        StringBuffer value = new StringBuffer();
-        try {
-            int event = xpp.getEventType();
-            while (XMLStreamConstants.START_ELEMENT != event) {
-                event = xpp.next();
-            }
-            event = xpp.next();
-            while (XMLStreamConstants.END_ELEMENT != event) {
-                if (XMLStreamConstants.CHARACTERS == event) {
-                    value.append(xpp.getText());
-                }
-                event = xpp.next();
-            }
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-        if (value.length() == 0) {
-            return null;
-        } else {
-            return value.toString();
-        }
-    }
-
-    public static String deserializeString(XMLStreamReader xpp)
-            throws AxisFault {
-        String value = null;
-        try {
-            int event = xpp.getEventType();
-            while (XMLStreamConstants.START_ELEMENT != event) {
-                event = xpp.next();
-            }
-            event = xpp.next();
-            while (XMLStreamConstants.END_ELEMENT != event) {
-                if (XMLStreamConstants.CHARACTERS == event
-                        && !xpp.isWhiteSpace()) {
-                    value = xpp.getText();
-                }
-                event = xpp.next();
-            }
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-        return value;
-    }
-
-    public static int deserializeInt(XMLStreamReader xpp) throws AxisFault {
-        String val = deserializeString(xpp);
-        if (val == null) {
-            throw new AxisFault("Number format exception value is null");
-        }
-        return Integer.parseInt(val);
-    }
-
-    public static double deserializeDouble(XMLStreamReader xpp) throws AxisFault {
-        String val = deserializeString(xpp);
-        if (val == null) {
-            throw new AxisFault("Number format exception value is null");
-        }
-        return Double.parseDouble(val);
-    }
-
-    public static int[] deserializeIntArray(XMLStreamReader xpp)
-            throws AxisFault {
-        ArrayList ints = new ArrayList();
-
-        try {
-            int event = xpp.next();
-
-            while (true) {
-                if (XMLStreamConstants.START_ELEMENT == event) {
-                    String stringValue = deserializeString(xpp);
-                    if (stringValue == null) {
-                        throw new AxisFault("Wrong type of argument");
-                    }
-                    ints.add(stringValue);
-                } else if (XMLStreamConstants.END_ELEMENT == event) {
-                    break;
-                } else if (XMLStreamConstants.END_DOCUMENT == event) {
-                    throw new AxisFault("premature end of file");
-                }
-                event = xpp.next();
-            }
-            int intCount = ints.size();
-            int[] intVals = new int[intCount];
-            for (int i = 0; i < intCount; i++) {
-                intVals[i] = Integer.parseInt(ints.get(i).toString());
-            }
-            return intVals;
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-
-    }
-
-    public static double[] deserializeDoubleArray(XMLStreamReader xpp)
-            throws AxisFault {
-        ArrayList doubles = new ArrayList();
-
-        try {
-            int event = xpp.next();
-
-            while (true) {
-                if (XMLStreamConstants.START_ELEMENT == event) {
-                    String stringValue = deserializeString(xpp);
-                    if (stringValue == null) {
-                        throw new AxisFault("Wrong type of argument");
-                    }
-                    doubles.add(stringValue);
-                } else if (XMLStreamConstants.END_ELEMENT == event) {
-                    break;
-                } else if (XMLStreamConstants.END_DOCUMENT == event) {
-                    throw new AxisFault("premature end of file");
-                }
-                event = xpp.next();
-            }
-            int doubleCount = doubles.size();
-            double[] doubleVals = new double[doubleCount];
-            for (int i = 0; i < doubleCount; i++) {
-                doubleVals[i] = Double.parseDouble(doubles.get(i).toString());
-            }
-            return doubleVals;
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-
-    }
-
-    public static void serialize(XMLStreamWriter out,
-                                 QName elementName,
-                                 String value)
-            throws AxisFault {
-        try {
-            out.writeStartElement(elementName.getNamespaceURI(),
-                    elementName.getLocalPart());
-            out.writeCharacters(value);
-            out.writeEndElement();
-        } catch (XMLStreamException e) {
-            throw AxisFault.makeFault(e);
-        }
-
-    }
-
-}
+
+package org.apache.axis.testUtils;
+
+import org.apache.axis.engine.AxisFault;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import java.util.ArrayList;
+
+public class SimpleTypeEncodingUtils {
+
+    public static byte[] deserializeByteArray(XMLStreamReader xpp) throws AxisFault {
+        String val = deserializeString(xpp);
+        if (val == null) {
+            throw new AxisFault("Null recieved!!");
+        }
+        return val.getBytes();
+
+    }
+
+    public static String[] deserializeStringArray(XMLStreamReader xpp) throws AxisFault {
+        ArrayList strings = new ArrayList();
+
+        try {
+            int event = xpp.next();
+            while (true) {
+                if (XMLStreamConstants.START_ELEMENT == event) {
+                    strings.add(deserializeString(xpp));
+                } else if (XMLStreamConstants.END_ELEMENT == event) {
+                    break;
+                } else if (XMLStreamConstants.END_DOCUMENT == event) {
+                    throw new AxisFault("premature and of file");
+                }
+                event = xpp.next();
+            }
+            String[] stringvals = new String[strings.size()];
+            for (int i = 0; i < strings.size(); i++) {
+                stringvals[i] = (String) strings.get(i);
+            }
+            return stringvals;
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+
+    }
+
+    public static String deserializeStringWithWiteSpaces(XMLStreamReader xpp) throws AxisFault
{
+        StringBuffer value = new StringBuffer();
+        try {
+            int event = xpp.getEventType();
+            while (XMLStreamConstants.START_ELEMENT != event) {
+                event = xpp.next();
+            }
+            event = xpp.next();
+            while (XMLStreamConstants.END_ELEMENT != event) {
+                if (XMLStreamConstants.CHARACTERS == event) {
+                    value.append(xpp.getText());
+                }
+                event = xpp.next();
+            }
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+        if (value.length() == 0) {
+            return null;
+        } else {
+            return value.toString();
+        }
+    }
+
+    public static String deserializeString(XMLStreamReader xpp) throws AxisFault {
+        String value = null;
+        try {
+            int event = xpp.getEventType();
+            while (XMLStreamConstants.START_ELEMENT != event) {
+                event = xpp.next();
+            }
+            event = xpp.next();
+            while (XMLStreamConstants.END_ELEMENT != event) {
+                if (XMLStreamConstants.CHARACTERS == event && !xpp.isWhiteSpace())
{
+                    value = xpp.getText();
+                }
+                event = xpp.next();
+            }
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+        return value;
+    }
+
+    public static int deserializeInt(XMLStreamReader xpp) throws AxisFault {
+        String val = deserializeString(xpp);
+        if (val == null) {
+            throw new AxisFault("Number format exception value is null");
+        }
+        return Integer.parseInt(val);
+    }
+
+    public static double deserializeDouble(XMLStreamReader xpp) throws AxisFault {
+        String val = deserializeString(xpp);
+        if (val == null) {
+            throw new AxisFault("Number format exception value is null");
+        }
+        return Double.parseDouble(val);
+    }
+
+    public static float deserializeFloat(XMLStreamReader xpp) throws AxisFault {
+        String val = deserializeString(xpp);
+        if (val == null) {
+            throw new AxisFault("Number format exception value is null");
+        }
+        return Float.parseFloat(val);
+    }
+
+    public static int[] deserializeIntArray(XMLStreamReader xpp) throws AxisFault {
+        ArrayList ints = new ArrayList();
+
+        try {
+            int event = xpp.next();
+
+            while (true) {
+                if (XMLStreamConstants.START_ELEMENT == event) {
+                    String stringValue = deserializeString(xpp);
+                    if (stringValue == null) {
+                        throw new AxisFault("Wrong type of argument");
+                    }
+                    ints.add(stringValue);
+                } else if (XMLStreamConstants.END_ELEMENT == event) {
+                    break;
+                } else if (XMLStreamConstants.END_DOCUMENT == event) {
+                    throw new AxisFault("premature end of file");
+                }
+                event = xpp.next();
+            }
+            int intCount = ints.size();
+            int[] intVals = new int[intCount];
+            for (int i = 0; i < intCount; i++) {
+                intVals[i] = Integer.parseInt(ints.get(i).toString());
+            }
+            return intVals;
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+
+    }
+
+    public static double[] deserializeDoubleArray(XMLStreamReader xpp) throws AxisFault {
+        ArrayList doubles = new ArrayList();
+
+        try {
+            int event = xpp.next();
+
+            while (true) {
+                if (XMLStreamConstants.START_ELEMENT == event) {
+                    String stringValue = deserializeString(xpp);
+                    if (stringValue == null) {
+                        throw new AxisFault("Wrong type of argument");
+                    }
+                    doubles.add(stringValue);
+                } else if (XMLStreamConstants.END_ELEMENT == event) {
+                    break;
+                } else if (XMLStreamConstants.END_DOCUMENT == event) {
+                    throw new AxisFault("premature end of file");
+                }
+                event = xpp.next();
+            }
+            int doubleCount = doubles.size();
+            double[] doubleVals = new double[doubleCount];
+            for (int i = 0; i < doubleCount; i++) {
+                doubleVals[i] = Double.parseDouble(doubles.get(i).toString());
+            }
+            return doubleVals;
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+
+    }
+
+    public static void serialize(XMLStreamWriter out, QName elementName, String value)
+        throws AxisFault {
+        try {
+            out.writeStartElement(elementName.getNamespaceURI(), elementName.getLocalPart());
+            out.writeCharacters(value);
+            out.writeEndElement();
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+
+    }
+
+    public static void writeElement(
+        ContentHandler contentHandler,
+        String localName,
+        String uri,
+        String prefixed,
+        String value)
+        throws SAXException {
+        contentHandler.startElement(uri, localName, prefixed, null);
+
+        char[] str = ((value == null) ? new char[] {
+        }
+        : value.toCharArray());
+        contentHandler.characters(str, 0, str.length);
+        contentHandler.endElement(uri, localName, prefixed);
+
+    }
+}



Mime
View raw message