You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mirae-dev@ws.apache.org by da...@apache.org on 2005/02/03 13:41:15 UTC
svn commit: r151149 [19/19] - in webservices/mirae/trunk: ./ bin/ bin/linux/
bin/windows/ build/ docs/ docs/images/ docs/images/CVS/ docs/javadoc/
genstub/ genstub/example8/ genstub/lk/ genstub/lk/opensource/
genstub/lk/opensource/wsmobile/ genstub/org/ genstub/org/apache/
genstub/org/apache/mirae/ genstub/org/apache/mirae/builtin/
genstub/org/apache/mirae/builtin/simpletypes/ genstub/uk/ genstub/uk/co/
genstub/uk/co/dsdata/ genstub/uk/co/dsdata/ws/
genstub/uk/co/dsdata/ws/travel/ genstub/uk/co/dsdata/ws/travel/sbg/
genstub/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/
genstub/ws_mobile_point/ lib/ logs/ samples/ samples/documentsamples/
samples/documentsamples/calculator/
samples/documentsamples/calculator/calculator/
samples/documentsamples/calculator/calculator/axis/
samples/documentsamples/calculator/calculator/axis/localhost/
samples/documentsamples/calculator/org/
samples/documentsamples/calculator/org/apache/
samples/documentsamples/calculator/org/apache/mirae/
samples/documentsamples/calculator/org/apache/mirae/builtin/
samples/documentsamples/calculator/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/echo/ samples/documentsamples/echo/org/
samples/documentsamples/echo/org/apache/
samples/documentsamples/echo/org/apache/mirae/
samples/documentsamples/echo/org/apache/mirae/builtin/
samples/documentsamples/echo/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/echo/org/soapinterop/
samples/documentsamples/employee/
samples/documentsamples/employee/jSR172UseCases/
samples/documentsamples/employee/jSR172UseCases/com/
samples/documentsamples/employee/jSR172UseCases/com/sun/
samples/documentsamples/employee/jSR172UseCases/com/sun/www/
samples/documentsamples/employee/org/
samples/documentsamples/employee/org/apache/
samples/documentsamples/employee/org/apache/mirae/
samples/documentsamples/employee/org/apache/mirae/builtin/
samples/documentsamples/employee/org/apache/mirae/builtin/simpletypes/
samples/documentsamples/employee/xsd/
samples/documentsamples/employee/xsd/JSR172AppendixA/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/sun/
samples/documentsamples/employee/xsd/JSR172AppendixA/com/sun/www/
samples/rpcsamples/ samples/rpcsamples/airfarequote/
samples/rpcsamples/airfarequote/org/
samples/rpcsamples/airfarequote/org/apache/
samples/rpcsamples/airfarequote/org/apache/mirae/
samples/rpcsamples/airfarequote/org/apache/mirae/builtin/
samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/airfarequote/uk/ samples/rpcsamples/airfarequote/uk/co/
samples/rpcsamples/airfarequote/uk/co/dsdata/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/
samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/
samples/rpcsamples/calculator/ samples/rpcsamples/calculator/lk/
samples/rpcsamples/calculator/lk/opensource/
samples/rpcsamples/calculator/lk/opensource/wsmobile/
samples/rpcsamples/calculator/org/ samples/rpcsamples/calculator/org/apache/
samples/rpcsamples/calculator/org/apache/mirae/
samples/rpcsamples/calculator/org/apache/mirae/builtin/
samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/distance/ samples/rpcsamples/distance/org/
samples/rpcsamples/distance/org/apache/
samples/rpcsamples/distance/org/apache/mirae/
samples/rpcsamples/distance/org/apache/mirae/builtin/
samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/distance/wsdl/
samples/rpcsamples/distance/wsdl/DistanceService/
samples/rpcsamples/distance/wsdl/DistanceService/sd/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/
samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/
samples/rpcsamples/point/ samples/rpcsamples/point/org/
samples/rpcsamples/point/org/apache/
samples/rpcsamples/point/org/apache/mirae/
samples/rpcsamples/point/org/apache/mirae/builtin/
samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/
samples/rpcsamples/point/ws_mobile_point/ samples/rpcsamples/student/
samples/rpcsamples/student/example8/ samples/rpcsamples/student/org/
samples/rpcsamples/student/org/apache/
samples/rpcsamples/student/org/apache/mirae/
samples/rpcsamples/student/org/apache/mirae/builtin/
samples/rpcsamples/student/org/apache/mirae/builtin/simpletypes/ src/
src/mirae/ src/mirae/jaxp/ src/mirae/jaxp/javax/ src/mirae/jaxp/javax/xml/
src/mirae/jaxp/javax/xml/parsers/ src/mirae/jaxp/org/
src/mirae/jaxp/org/apache/ src/mirae/jaxp/org/apache/mirae/
src/mirae/jaxp/org/apache/mirae/j2me/
src/mirae/jaxp/org/apache/mirae/j2me/xml/
src/mirae/jaxp/org/apache/mirae/j2me/xml/sax/ src/mirae/jaxp/org/xml/
src/mirae/jaxp/org/xml/sax/ src/mirae/jaxp/org/xml/sax/helpers/
src/mirae/jaxrpc/ src/mirae/jaxrpc/javax/ src/mirae/jaxrpc/javax/xml/
src/mirae/jaxrpc/javax/xml/namespace/ src/mirae/jaxrpc/javax/xml/rpc/
src/mirae/jaxrpc/org/ src/mirae/jaxrpc/org/apache/
src/mirae/jaxrpc/org/apache/mirae/ src/mirae/jaxrpc/org/apache/mirae/util/
src/mirae/jaxrpc/org/apache/mirae/xml/
src/mirae/jaxrpc/org/apache/mirae/xml/rpc/ src/tools/
src/tools/simpletypes/ src/tools/wsdl2ws_j2me/ src/tools/wsdl2ws_j2me/org/
src/tools/wsdl2ws_j2me/org/apache/ src/tools/wsdl2ws_j2me/org/apache/axis/
src/tools/wsdl2ws_j2me/org/apache/axis/wsdl/
src/tools/wsdl2ws_j2me/org/apache/axis/wsdl/symbolTable/
src/tools/wsdl2ws_j2me/org/apache/mirae/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/doclit/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/info/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/j2me/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/j2me/client/
src/tools/wsdl2ws_j2me/org/apache/mirae/wsdl2ws/rpc/ tests/
tests/functional/ tests/functional/client/
tests/functional/client/SBGGetAirFareQuote-client1/
tests/functional/client/SBGGetAirFareQuote-client2/
tests/functional/client/calculator/ tests/functional/client/point/
tests/functional/client/wst/ tests/functional/wsdl/ tests/unit/
tests/unit/inmessage/ tests/unit/mirae/ tests/unit/outmessage/
tests/unit/wsdl2ws/ wsdl/ wsdltests/ wsdltests/calculator/
wsdltests/calculator/client/ wsdltests/calculator/server/
wsdltests/exceptiontest/ wsdltests/exceptiontest/client/
wsdltests/exceptiontest/server/ wsdltests/interoptestround1/
wsdltests/interoptestround1/client/ wsdltests/interoptestround1/server/
Added: webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionOutOfBoundMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionOutOfBoundMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionOutOfBoundMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionOutOfBoundMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,253 @@
+/* -*- Mirae -*- */
+/*
+ * Copyright 2003-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.
+ *
+ *
+ * @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+ *
+ */
+
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import wsdl.exceptiontest.ExceptionTestStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ExceptionOutOfBoundMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public ExceptionOutOfBoundMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ ExceptionTestStub stub = new ExceptionTestStub("http://localhost:8080/axis/services/ExceptionTest");
+ int i = stub.div(10, -5);
+ System.out.println("res " + i);
+ stResult.setText("" + i);
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionSpecialDetailMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionSpecialDetailMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionSpecialDetailMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionSpecialDetailMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,253 @@
+/* -*- Mirae -*- */
+/*
+ * Copyright 2003-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.
+ *
+ *
+ * @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+ *
+ */
+
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import wsdl.exceptiontest.ExceptionTestStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ExceptionSpecialDetailMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public ExceptionSpecialDetailMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ ExceptionTestStub stub = new ExceptionTestStub("http://localhost:8080/axis/services/ExceptionTest");
+ int i = stub.div(1000, 5);
+ System.out.println("res " + i);
+ stResult.setText("" + i);
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionWrongUriMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionWrongUriMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionWrongUriMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/client/ExceptionWrongUriMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,253 @@
+/* -*- Mirae -*- */
+/*
+ * Copyright 2003-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.
+ *
+ *
+ * @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+ *
+ */
+
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import wsdl.exceptiontest.ExceptionTestStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ExceptionWrongUriMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public ExceptionWrongUriMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ ExceptionTestStub stub = new ExceptionTestStub("http://localhost/axis");
+ int i = stub.div(10, 5);
+ System.out.println("res " + i);
+ stResult.setText("" + i);
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/ExceptionTestBindingImpl.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/ExceptionTestBindingImpl.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/ExceptionTestBindingImpl.java (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/ExceptionTestBindingImpl.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,72 @@
+/* -*- Mirae -*- */
+/*
+ * Copyright 2003-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.
+ *
+ *
+ * @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+ *
+ */
+
+/**
+ * ExceptionTestBindingImpl.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis WSDL2Java emitter.
+ */
+
+package exceptiontest.wsdl;
+import exceptiontest.types.*;
+
+public class ExceptionTestBindingImpl implements exceptiontest.wsdl.ExceptionTest{
+ public int div(int int0, int int1) throws java.rmi.RemoteException, exceptiontest.types.OutOfBound, exceptiontest.types.DivByZero, exceptiontest.types.SpecialDetail {
+ if (0 == int1)
+ {
+ DivByZero pObjFault = new DivByZero();
+ if(null != pObjFault)
+ {
+ pObjFault.setVarString("Division by zero exception");
+ pObjFault.setVarInt(10);
+ pObjFault.setVarByte((byte) 3);
+ throw pObjFault;
+ }
+ }
+ if(int0 < 0 || int1 < 0)
+ {
+ OutOfBound pObjFault = new OutOfBound();
+ SpecialDetail pObjSpecialDetailFault = new SpecialDetail();
+ if(null != pObjSpecialDetailFault)
+ pObjSpecialDetailFault.setVarString("This bound exception is a forced limitation");
+ if (null != pObjFault)
+ {
+ pObjFault.setVarString("Value out of bound exception");
+ pObjFault.setVarInt(2);
+ pObjFault.setSpecialDetail(pObjSpecialDetailFault);
+ throw pObjFault;
+ }
+ }
+
+ if(int0 == 1000)
+ {
+ SpecialDetail pObjFault = new SpecialDetail();
+ if(null != pObjFault)
+ {
+ pObjFault.setVarString("You have entered 1000 for the 1st paramter. 1000 is reserved. Please do not use it");
+ throw pObjFault;
+ }
+ }
+ return int0/int1;
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/build.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/build.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/build.sh (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/build.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+cp -f ./ExceptionTestBindingImpl.java exceptiontest/wsdl/
+
+javac -classpath ../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar:$CLASSPATH -d /home/damitha/programs/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/classes exceptiontest/wsdl/*.java exceptiontest/types/*.java
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.sh (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java org.apache.axis.client.AdminClient deploy.wsdd
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.wsdd?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.wsdd (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/deploy.wsdd Thu Feb 3 04:39:48 2005
@@ -0,0 +1,55 @@
+<!-- Use this file to deploy some handlers/chains and services -->
+<!-- Two ways to do this: -->
+<!-- java org.apache.axis.client.AdminClient deploy.wsdd -->
+<!-- after the axis server is running -->
+<!-- or -->
+<!-- java org.apache.axis.utils.Admin client|server deploy.wsdd -->
+<!-- from the same directory that the Axis engine runs -->
+
+<deployment
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <!-- Services from ExceptionTestService WSDL service -->
+
+ <service name="ExceptionTest" provider="java:RPC" style="rpc" use="encoded">
+ <parameter name="wsdlTargetNamespace" value="http://exceptiontest/wsdl"/>
+ <parameter name="wsdlServiceElement" value="ExceptionTestService"/>
+ <parameter name="wsdlServicePort" value="ExceptionTest"/>
+ <parameter name="className" value="exceptiontest.wsdl.ExceptionTestBindingImpl"/>
+ <parameter name="wsdlPortType" value="ExceptionTest"/>
+ <operation name="div" qname="operNS:div" xmlns:operNS="http://localhost/axis/ExceptionTest" returnQName="addReturn" returnType="rtns:int" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="int0" type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ <parameter name="int1" type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ <fault name="OutOfBound" qname="fns:fault2" xmlns:fns="http://exceptiontest/wsdl" class="exceptiontest.types.OutOfBound" type="tns:OutOfBound" xmlns:tns="http://exceptiontest/types"/>
+ <fault name="DivByZero" qname="fns:fault1" xmlns:fns="http://exceptiontest/wsdl" class="exceptiontest.types.DivByZero" type="tns:DivByZero" xmlns:tns="http://exceptiontest/types"/>
+ <fault name="NormalDetail" qname="fns:fault3" xmlns:fns="http://exceptiontest/wsdl" class="exceptiontest.types.SpecialDetail" type="tns:SpecialDetail" xmlns:tns="http://exceptiontest/types"/>
+ </operation>
+ <parameter name="allowedMethods" value="div"/>
+
+ <typeMapping
+ xmlns:ns="http://exceptiontest/types"
+ qname="ns:SpecialDetail"
+ type="java:exceptiontest.types.SpecialDetail"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ <typeMapping
+ xmlns:ns="http://exceptiontest/types"
+ qname="ns:OutOfBound"
+ type="java:exceptiontest.types.OutOfBound"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ <typeMapping
+ xmlns:ns="http://exceptiontest/types"
+ qname="ns:DivByZero"
+ type="java:exceptiontest.types.DivByZero"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ </service>
+</deployment>
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.sh (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java org.apache.axis.client.AdminClient undeploy.wsdd
Added: webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.wsdd?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.wsdd (added)
+++ webservices/mirae/trunk/wsdltests/exceptiontest/server/undeploy.wsdd Thu Feb 3 04:39:48 2005
@@ -0,0 +1,15 @@
+<!-- Use this file to undeploy some handlers/chains and services -->
+<!-- Two ways to do this: -->
+<!-- java org.apache.axis.client.AdminClient undeploy.wsdd -->
+<!-- after the axis server is running -->
+<!-- or -->
+<!-- java org.apache.axis.utils.Admin client|server undeploy.wsdd -->
+<!-- from the same directory that the Axis engine runs -->
+
+<undeployment
+ xmlns="http://xml.apache.org/axis/wsdd/">
+
+ <!-- Services from ExceptionTestService WSDL service -->
+
+ <service name="ExceptionTest"/>
+</undeployment>
Added: webservices/mirae/trunk/wsdltests/genCalculatorClient.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genCalculatorClient.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genCalculatorClient.sh (added)
+++ webservices/mirae/trunk/wsdltests/genCalculatorClient.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+java -DWSMOBILE_HOME=$WSMOBILE_HOME -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar j2me.wsdl2ws.WSDL2Ws ../wsdl/Calculator.wsdl -lclient -o$WTK_HOME/apps/calculator/src
+cp -rf ../src/mirae/jaxp $WTK_HOME/apps/calculator/src
+cp -rf ../src/mirae/jaxrpc $WTK_HOME/apps/calculator/src
+cp -rf ../genstub/j2me $WTK_HOME/apps/calculator/src
+cp -f calculator/client/*.java $WTK_HOME/apps/calculator/src
+
+
+
Added: webservices/mirae/trunk/wsdltests/genCalculatorServer.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genCalculatorServer.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genCalculatorServer.sh (added)
+++ webservices/mirae/trunk/wsdltests/genCalculatorServer.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,23 @@
+#!/lib/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+java -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar org.apache.axis.wsdl.WSDL2Java ../wsdl/Calculator.wsdl --server-side -ocalculator/server
Added: webservices/mirae/trunk/wsdltests/genExceptionTestClient.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genExceptionTestClient.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genExceptionTestClient.sh (added)
+++ webservices/mirae/trunk/wsdltests/genExceptionTestClient.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+java -DWSMOBILE_HOME=$WSMOBILE_HOME -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar j2me.wsdl2ws.WSDL2Ws ../wsdl/ExceptionTest.wsdl -lclient -o$WTK_HOME/apps/exceptiontest/src
+
+cp -rf ../src/mirae/jaxp $WTK_HOME/apps/exceptiontest/src
+cp -rf ../src/mirae/jaxrpc $WTK_HOME/apps/exceptiontest/src
+cp -rf ../genstub/j2me $WTK_HOME/apps/exceptiontest/src
+cp -f exceptiontest/client/*.java $WTK_HOME/apps/exceptiontest/src
+
Added: webservices/mirae/trunk/wsdltests/genExceptionTestServer.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genExceptionTestServer.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genExceptionTestServer.sh (added)
+++ webservices/mirae/trunk/wsdltests/genExceptionTestServer.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+java -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar org.apache.axis.wsdl.WSDL2Java ../wsdl/ExceptionTest.wsdl --server-side -oexceptiontest/server
Added: webservices/mirae/trunk/wsdltests/genInteropTestRound1Client.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genInteropTestRound1Client.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genInteropTestRound1Client.sh (added)
+++ webservices/mirae/trunk/wsdltests/genInteropTestRound1Client.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+java -DWSMOBILE_HOME=$WSMOBILE_HOME -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar j2me.wsdl2ws.WSDL2Ws ../wsdl/InteropTestRound1.wsdl -lclient -o$WTK_HOME/apps/interoptestround1/src
+cp -rf ../src/mirae/jaxp $WTK_HOME/apps/interoptestround1/src
+cp -rf ../src/mirae/jaxrpc $WTK_HOME/apps/interoptestround1/src
+cp -rf ../genstub/j2me $WTK_HOME/apps/interoptestround1/src
+cp -f interoptestround1/client/*.java $WTK_HOME/apps/interoptestround1/src
+
Added: webservices/mirae/trunk/wsdltests/genInteropTestRound1Server.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/genInteropTestRound1Server.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/genInteropTestRound1Server.sh (added)
+++ webservices/mirae/trunk/wsdltests/genInteropTestRound1Server.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+java -cp ../lib/wsdl2ws_j2me.jar:../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar org.apache.axis.wsdl.WSDL2Java ../wsdl/InteropTestRound1.wsdl --server-side -ointeroptestround1/server
Added: webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoBoolMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoBoolMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoBoolMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoBoolMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,241 @@
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import org.soapinterop.InteropTestPortTypeStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class InteropR1EchoBoolMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public InteropR1EchoBoolMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ InteropTestPortTypeStub stub = new InteropTestPortTypeStub();
+ boolean bool = stub.echoBoolean(true);
+ if( true == bool)
+ {
+ System.out.println("success");
+ stResult.setText("success");
+ }
+ else
+ {
+ System.out.println("failure");
+ stResult.setText("failure");
+ }
+
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoIntMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoIntMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoIntMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoIntMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,241 @@
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import org.soapinterop.InteropTestPortTypeStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class InteropR1EchoIntMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public InteropR1EchoIntMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ InteropTestPortTypeStub stub = new InteropTestPortTypeStub();
+ int i = stub.echoInteger(5);
+ if( 5 == i)
+ {
+ System.out.println("success");
+ stResult.setText("success");
+ }
+ else
+ {
+ System.out.println("failure");
+ stResult.setText("failure");
+ }
+
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringArrayMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringArrayMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringArrayMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringArrayMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,242 @@
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import org.soapinterop.InteropTestPortTypeStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class InteropR1EchoStringArrayMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public InteropR1EchoStringArrayMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ InteropTestPortTypeStub stub = new InteropTestPortTypeStub();
+ String[] strArray1 = {"We", "are", "the", "world"};
+ String[] strArray2 = stub.echoStringArray(strArray1);
+ if(strArray1 == strArray2)
+ {
+ System.out.println("success");
+ stResult.setText("success");
+ }
+ else
+ {
+ System.out.println("failure");
+ stResult.setText("failure");
+ }
+
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringMIDLet.java (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/client/InteropR1EchoStringMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,241 @@
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+import javax.microedition.lcdui.Gauge;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import org.soapinterop.InteropTestPortTypeStub;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class InteropR1EchoStringMIDLet extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ private Gauge gauge;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public InteropR1EchoStringMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+ gauge = new Gauge("Progress Tracking", false, 100, 0);
+ // gauge.setPreferredSize(200,10);
+
+ form = new Form("Access Web Service");
+ quitCommand = new Command("Quit", Command.CANCEL, 1);
+ sendCommand = new Command("Send", Command.OK, 2);
+
+ tf = new StringItem("Method: ",
+ "Click \"SEND\" to send 2 points for adding");
+ form.addCommand(quitCommand);
+ form.addCommand(sendCommand);
+
+ form.append(tf);
+
+ form.setCommandListener(this);
+ isSafeToExit = true;
+ }
+
+ protected void startApp() throws MIDletStateChangeException {
+ display.setCurrent(form);
+ }
+
+ protected void pauseApp() {
+ }
+
+ protected void destroyApp(boolean unconditional)
+ throws MIDletStateChangeException {
+ if (!unconditional) {
+ throw new MIDletStateChangeException();
+ }
+ }
+
+ public void commandAction(Command command, Displayable displayable) {
+
+ if (command == quitCommand) {
+ try {
+ destroyApp(isSafeToExit);
+ notifyDestroyed();
+ System.gc();
+ } catch (MIDletStateChangeException Error) {
+ Alert alert = new Alert("Busy", "Please try again.", null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ if (command == backCommand) {
+ System.gc();
+ this.setting();
+ try {
+ startApp();
+ } catch (Exception e) {
+ Alert alert = new Alert("Busy", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(1500);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ }
+
+ else if (command == sendCommand) {
+ try {
+ form.append(gauge);
+ form.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.start();
+ new Thread(new GuagueUpdater()).start();
+
+ } catch (Exception e) {
+ Alert alert = new Alert("Error", e.getMessage(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+ }
+ } else {
+ try {
+ notifyDestroyed();
+ destroyApp(true);
+ } catch (MIDletStateChangeException e) {
+ }
+ }
+ }
+
+ public void run() {
+ try {
+
+ InteropTestPortTypeStub stub = new InteropTestPortTypeStub();
+ String str = stub.echoString("Hello World");
+ if(str.equals("Hello World"))
+ {
+ System.out.println("success");
+ stResult.setText("success");
+ }
+ else
+ {
+ System.out.println("failure");
+ stResult.setText("failure");
+ }
+
+
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ String faultString = null;
+
+ Alert alert = new Alert("Error", e.toString(), null, AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+
+ class GuagueUpdater implements Runnable {
+ GuagueUpdater() {
+ }
+
+ public void run() {
+ isSafeToExit = false;
+ try {
+ while (gauge.getValue() < gauge.getMaxValue()) {
+ Thread.sleep(100);
+ gauge.setValue(gauge.getValue() + 1);
+ if (gauge.getValue() == gauge.getMaxValue()) {
+ gauge.setValue(0);
+ }
+ if (gotResult == true) {
+ gauge.setValue(gauge.getMaxValue());
+ }
+
+ }
+ isSafeToExit = true;
+ gauge.setLabel("Process Completed.");
+
+ } catch (InterruptedException Error) {
+ throw new RuntimeException(Error.getMessage());
+ }
+ }
+ }
+
+ private class MemoHandler extends DefaultHandler {
+ private StringBuffer textBuffer;
+
+ private StringItem memoBox;
+
+ MemoHandler(StringItem memoBox) {
+ this.memoBox = memoBox;
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+
+ if (qName.equals("x")) {
+ textBuffer.append("x=");
+ } else if (qName.equals("y")) {
+ textBuffer.append("y=");
+ }
+
+ System.out.println("--" + uri + "**" + localName + "++" + qName
+ + "--" + attributes);
+
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ }
+
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ String s = new String(ch, start, length);
+ if (textBuffer == null) {
+ textBuffer = new StringBuffer(s);
+ memoBox.setText(textBuffer.toString().trim());
+
+ } else {
+
+ textBuffer.append(s);
+ memoBox.setText(textBuffer.toString().trim());
+ System.out.println("char " + textBuffer.toString());
+ }
+ }
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/InteropTestSoapBindingImpl.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/InteropTestSoapBindingImpl.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/InteropTestSoapBindingImpl.java (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/InteropTestSoapBindingImpl.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,71 @@
+/* -*- Mirae -*- */
+/*
+ * Copyright 2003-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.
+ *
+ *
+ * @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+ *
+ */
+
+/**
+ * InteropTestSoapBindingImpl.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis WSDL2Java emitter.
+ */
+
+package org.soapinterop;
+
+public class InteropTestSoapBindingImpl implements org.soapinterop.InteropTestPortType{
+ public java.lang.String echoString(java.lang.String inputString) throws java.rmi.RemoteException {
+ return inputString;
+ }
+
+ public java.lang.String[] echoStringArray(java.lang.String[] inputStringArray) throws java.rmi.RemoteException {
+ return inputStringArray;
+ }
+
+ public int echoInteger(int inputInteger) throws java.rmi.RemoteException {
+ return inputInteger;
+ }
+
+ public int[] echoIntegerArray(int[] inputIntegerArray) throws java.rmi.RemoteException {
+ return inputIntegerArray;
+ }
+
+ public org.soapinterop.xsd.SOAPStruct echoStruct(org.soapinterop.xsd.SOAPStruct inputStruct) throws java.rmi.RemoteException {
+ return inputStruct;
+ }
+
+ public org.soapinterop.xsd.SOAPStruct[] echoStructArray(org.soapinterop.xsd.SOAPStruct[] inputStructArray) throws java.rmi.RemoteException {
+ return inputStructArray;
+ }
+
+ public void echoVoid() throws java.rmi.RemoteException {
+ }
+
+ public byte[] echoBase64(byte[] inputBase64) throws java.rmi.RemoteException {
+ return inputBase64;
+ }
+
+ public byte[] echoHexBinary(byte[] inputHexBinary) throws java.rmi.RemoteException {
+ return inputHexBinary;
+ }
+
+ public boolean echoBoolean(boolean inputBoolean) throws java.rmi.RemoteException {
+ return inputBoolean;
+ }
+
+}
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/build.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/build.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/build.sh (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/build.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# -*- Mirae -*-
+#
+# Copyright 2003-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.
+#
+#
+# @author Damitha Kumarage (damitha@hsenid.lk, damitha@opensource.lk)
+#
+#
+
+cp -f InteropTestSoapBindingImpl.java org/soapinterop/
+
+javac -classpath ../lib/activation.jar:../lib/commons-discovery.jar:../lib/Jaxrpc.jar:../lib/Saaj.jar:../lib/Axis.jar:../lib/commons-logging.jar:../lib/log4j-1.2.8.jar:../lib/Wsdl4j.jar:$CLASSPATH -d /home/damitha/programs/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/classes org/soapinterop/*.java
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.sh (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java org.apache.axis.client.AdminClient deploy.wsdd
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.wsdd?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.wsdd (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/deploy.wsdd Thu Feb 3 04:39:48 2005
@@ -0,0 +1,85 @@
+<!-- Use this file to deploy some handlers/chains and services -->
+<!-- Two ways to do this: -->
+<!-- java org.apache.axis.client.AdminClient deploy.wsdd -->
+<!-- after the axis server is running -->
+<!-- or -->
+<!-- java org.apache.axis.utils.Admin client|server deploy.wsdd -->
+<!-- from the same directory that the Axis engine runs -->
+
+<deployment
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <!-- Services from InteropTestRound1 WSDL service -->
+
+ <service name="InteropBaseTest" provider="java:RPC" style="rpc" use="encoded">
+ <parameter name="wsdlTargetNamespace" value="http://soapinterop.org/"/>
+ <parameter name="wsdlServiceElement" value="InteropTestRound1"/>
+ <parameter name="wsdlServicePort" value="InteropBaseTest"/>
+ <parameter name="className" value="org.soapinterop.InteropTestSoapBindingImpl"/>
+ <parameter name="wsdlPortType" value="InteropTestPortType"/>
+ <operation name="echoString" qname="operNS:echoString" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:string" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="inputString" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ </operation>
+ <operation name="echoStringArray" qname="operNS:echoStringArray" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:ArrayOfstring" xmlns:rtns="http://soapinterop.org/xsd" >
+ <parameter name="inputStringArray" type="tns:ArrayOfstring" xmlns:tns="http://soapinterop.org/xsd"/>
+ </operation>
+ <operation name="echoInteger" qname="operNS:echoInteger" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:int" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="inputInteger" type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ </operation>
+ <operation name="echoIntegerArray" qname="operNS:echoIntegerArray" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:ArrayOfint" xmlns:rtns="http://soapinterop.org/xsd" >
+ <parameter name="inputIntegerArray" type="tns:ArrayOfint" xmlns:tns="http://soapinterop.org/xsd"/>
+ </operation>
+ <operation name="echoStruct" qname="operNS:echoStruct" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:SOAPStruct" xmlns:rtns="http://soapinterop.org/xsd" >
+ <parameter name="inputStruct" type="tns:SOAPStruct" xmlns:tns="http://soapinterop.org/xsd"/>
+ </operation>
+ <operation name="echoStructArray" qname="operNS:echoStructArray" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:ArrayOfSOAPStruct" xmlns:rtns="http://soapinterop.org/xsd" >
+ <parameter name="inputStructArray" type="tns:ArrayOfSOAPStruct" xmlns:tns="http://soapinterop.org/xsd"/>
+ </operation>
+ <operation name="echoVoid" qname="operNS:echoVoid" xmlns:operNS="http://soapinterop.org/" >
+ </operation>
+ <operation name="echoBase64" qname="operNS:echoBase64" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:base64Binary" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="inputBase64" type="tns:base64Binary" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ </operation>
+ <operation name="echoHexBinary" qname="operNS:echoHexBinary" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:hexBinary" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="inputHexBinary" type="tns:hexBinary" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ </operation>
+ <operation name="echoBoolean" qname="operNS:echoBoolean" xmlns:operNS="http://soapinterop.org/" returnQName="return" returnType="rtns:boolean" xmlns:rtns="http://www.w3.org/2001/XMLSchema" >
+ <parameter name="inputBoolean" type="tns:boolean" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
+ </operation>
+ <parameter name="allowedMethods" value="echoVoid echoInteger echoBoolean echoStringArray echoStructArray echoBase64 echoStruct echoString echoIntegerArray echoHexBinary"/>
+
+ <typeMapping
+ xmlns:ns="http://soapinterop.org/xsd"
+ qname="ns:ArrayOfint"
+ type="java:int[]"
+ serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ <typeMapping
+ xmlns:ns="http://soapinterop.org/xsd"
+ qname="ns:ArrayOfstring"
+ type="java:java.lang.String[]"
+ serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ <typeMapping
+ xmlns:ns="http://soapinterop.org/xsd"
+ qname="ns:SOAPStruct"
+ type="java:org.soapinterop.xsd.SOAPStruct"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ <typeMapping
+ xmlns:ns="http://soapinterop.org/xsd"
+ qname="ns:ArrayOfSOAPStruct"
+ type="java:org.soapinterop.xsd.SOAPStruct[]"
+ serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ />
+ </service>
+</deployment>
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.sh
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.sh?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.sh (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.sh Thu Feb 3 04:39:48 2005
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java org.apache.axis.client.AdminClient undeploy.wsdd
Added: webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.wsdd
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.wsdd?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.wsdd (added)
+++ webservices/mirae/trunk/wsdltests/interoptestround1/server/undeploy.wsdd Thu Feb 3 04:39:48 2005
@@ -0,0 +1,15 @@
+<!-- Use this file to undeploy some handlers/chains and services -->
+<!-- Two ways to do this: -->
+<!-- java org.apache.axis.client.AdminClient undeploy.wsdd -->
+<!-- after the axis server is running -->
+<!-- or -->
+<!-- java org.apache.axis.utils.Admin client|server undeploy.wsdd -->
+<!-- from the same directory that the Axis engine runs -->
+
+<undeployment
+ xmlns="http://xml.apache.org/axis/wsdd/">
+
+ <!-- Services from InteropTestRound1 WSDL service -->
+
+ <service name="InteropBaseTest"/>
+</undeployment>