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:10 UTC
svn commit: r151149 [4/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/samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/StringParam.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/StringParam.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/StringParam.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/org/apache/mirae/builtin/simpletypes/StringParam.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2001-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.
+ */
+
+package org.apache.mirae.builtin.simpletypes;
+
+import java.io.IOException;
+
+
+import org.apache.mirae.xml.rpc.InOutParameter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+
+
+public class StringParam implements InOutParameter {
+ public String param;
+
+ public StringParam() {
+ }
+
+ public StringParam(String param) {
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ this.param=value;
+ }
+
+ public void serialize(StringBuffer buffer) throws IOException,Exception {
+
+ buffer.append(param);
+
+ }
+
+ public String getParam() {
+ return param;
+ }
+
+ public String toString() {
+ return param;
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#createArray()
+ */
+ public void createArray() throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuote.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuote.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuote.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuote.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,229 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2WS_J2ME.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+*/public class AirFareQuote implements org.apache.mirae.xml.rpc.InOutParameter{
+ private java.util.Vector obj;
+
+private org.apache.mirae.xml.rpc.InOutParameter childObj; private java.lang.String errorMessage;
+ private boolean scrapeError;
+ private boolean errorOccurred;
+ private int fare;
+ private uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest request;
+ private uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest arrayT4;
+ private java.lang.String returnTime;
+ private java.lang.String airlineName;
+ private java.lang.String outwardTime;
+
+ public AirFareQuote(){
+ obj=new java.util.Vector();
+ }
+ public AirFareQuote(java.lang.String errorMessage,boolean scrapeError,boolean errorOccurred,int fare,uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest request,java.lang.String returnTime,java.lang.String airlineName,java.lang.String outwardTime){
+ this.errorMessage = errorMessage;
+ this.scrapeError = scrapeError;
+ this.errorOccurred = errorOccurred;
+ this.fare = fare;
+ this.request = request;
+ this.returnTime = returnTime;
+ this.airlineName = airlineName;
+ this.outwardTime = outwardTime;
+ }
+
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1203236063:
+ this.errorMessage = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case -1828470860:
+ this.scrapeError = (new org.apache.mirae.builtin.simpletypes.BooleanParam(value)).getParam();
+ break;
+ case -99476659:
+ this.errorOccurred = (new org.apache.mirae.builtin.simpletypes.BooleanParam(value)).getParam();
+ break;
+ case 3135534:
+ this.fare = (new org.apache.mirae.builtin.simpletypes.IntParam(value)).getParam();
+ break;
+ case 1095692943:
+ break;
+ case 1337191453:
+ this.returnTime = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case -367586327:
+ this.airlineName = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case -2133443401:
+ this.outwardTime = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ default:
+ if (childObj!=null)
+ childObj.decode(uri,localName,qName,attributes,value);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1203236063:
+ break;
+ case -1828470860:
+ break;
+ case -99476659:
+ break;
+ case 3135534:
+ break;
+ case 1095692943:
+ break;
+ case 1337191453:
+ break;
+ case -367586327:
+ break;
+ case -2133443401:
+ break;
+ default:
+ if (childObj!=null)
+ childObj.endElement(uri,localName,qName);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1203236063:
+ break;
+ case -1828470860:
+ break;
+ case -99476659:
+ break;
+ case 3135534:
+ break;
+ case 1095692943:
+ this.request= (new uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest());
+ childObj=this.request;
+ break;
+ case 1337191453:
+ break;
+ case -367586327:
+ break;
+ case -2133443401:
+ break;
+ default:
+ if (childObj!=null)
+ childObj.startElement(uri,localName,qName,attributes);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+ public void createArray()throws SAXException {
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ java.lang.String m_URI ="urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk";
+ java.lang.String type_name = "AirFareQuote";
+ //write the parameters
+
+ buffer.append("<errorMessage>");
+ if(this.errorMessage!=null){
+ buffer.append(java.lang.String.valueOf(errorMessage));
+ }
+ buffer.append("</errorMessage>\n");
+
+ buffer.append("<scrapeError>");
+ buffer.append(java.lang.String.valueOf(scrapeError));
+ buffer.append("</scrapeError>\n");
+
+ buffer.append("<errorOccurred>");
+ buffer.append(java.lang.String.valueOf(errorOccurred));
+ buffer.append("</errorOccurred>\n");
+
+ buffer.append("<fare>");
+ buffer.append(java.lang.String.valueOf(fare));
+ buffer.append("</fare>\n");
+
+ buffer.append("<request>");
+ if(this.request!=null){
+ request.serialize(buffer);
+ }
+ buffer.append("</request>\n");
+
+ buffer.append("<returnTime>");
+ if(this.returnTime!=null){
+ buffer.append(java.lang.String.valueOf(returnTime));
+ }
+ buffer.append("</returnTime>\n");
+
+ buffer.append("<airlineName>");
+ if(this.airlineName!=null){
+ buffer.append(java.lang.String.valueOf(airlineName));
+ }
+ buffer.append("</airlineName>\n");
+
+ buffer.append("<outwardTime>");
+ if(this.outwardTime!=null){
+ buffer.append(java.lang.String.valueOf(outwardTime));
+ }
+ buffer.append("</outwardTime>\n");
+
+ }
+
+ public void setErrorMessage(java.lang.String errorMessage){
+ this.errorMessage = errorMessage;
+ }
+ public java.lang.String getErrorMessage(){
+ return errorMessage;
+ }
+ public void setScrapeError(boolean scrapeError){
+ this.scrapeError = scrapeError;
+ }
+ public boolean getScrapeError(){
+ return scrapeError;
+ }
+ public void setErrorOccurred(boolean errorOccurred){
+ this.errorOccurred = errorOccurred;
+ }
+ public boolean getErrorOccurred(){
+ return errorOccurred;
+ }
+ public void setFare(int fare){
+ this.fare = fare;
+ }
+ public int getFare(){
+ return fare;
+ }
+ public void setRequest(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest request){
+ this.request = request;
+ }
+ public uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest getRequest(){
+ return request;
+ }
+ public void setReturnTime(java.lang.String returnTime){
+ this.returnTime = returnTime;
+ }
+ public java.lang.String getReturnTime(){
+ return returnTime;
+ }
+ public void setAirlineName(java.lang.String airlineName){
+ this.airlineName = airlineName;
+ }
+ public java.lang.String getAirlineName(){
+ return airlineName;
+ }
+ public void setOutwardTime(java.lang.String outwardTime){
+ this.outwardTime = outwardTime;
+ }
+ public java.lang.String getOutwardTime(){
+ return outwardTime;
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuoteRequest.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuoteRequest.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuoteRequest.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/AirFareQuoteRequest.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,149 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2WS_J2ME.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+*/public class AirFareQuoteRequest implements org.apache.mirae.xml.rpc.InOutParameter{
+ private java.util.Vector obj;
+
+private org.apache.mirae.xml.rpc.InOutParameter childObj; private java.lang.String returnDate;
+ private java.lang.String destinationAirport;
+ private java.lang.String originAirport;
+ private java.lang.String outwardDate;
+
+ public AirFareQuoteRequest(){
+ obj=new java.util.Vector();
+ }
+ public AirFareQuoteRequest(java.lang.String returnDate,java.lang.String destinationAirport,java.lang.String originAirport,java.lang.String outwardDate){
+ this.returnDate = returnDate;
+ this.destinationAirport = destinationAirport;
+ this.originAirport = originAirport;
+ this.outwardDate = outwardDate;
+ }
+
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1336707326:
+ this.returnDate = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case 1892852957:
+ this.destinationAirport = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case -835383611:
+ this.originAirport = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ case -2133927528:
+ this.outwardDate = (new org.apache.mirae.builtin.simpletypes.StringParam(value)).getParam();
+ break;
+ default:
+ if (childObj!=null)
+ childObj.decode(uri,localName,qName,attributes,value);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1336707326:
+ break;
+ case 1892852957:
+ break;
+ case -835383611:
+ break;
+ case -2133927528:
+ break;
+ default:
+ if (childObj!=null)
+ childObj.endElement(uri,localName,qName);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 1336707326:
+ break;
+ case 1892852957:
+ break;
+ case -835383611:
+ break;
+ case -2133927528:
+ break;
+ default:
+ if (childObj!=null)
+ childObj.startElement(uri,localName,qName,attributes);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+ public void createArray()throws SAXException {
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ java.lang.String m_URI ="urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk";
+ java.lang.String type_name = "AirFareQuoteRequest";
+ //write the parameters
+
+ buffer.append("<returnDate>");
+ if(this.returnDate!=null){
+ buffer.append(java.lang.String.valueOf(returnDate));
+ }
+ buffer.append("</returnDate>\n");
+
+ buffer.append("<destinationAirport>");
+ if(this.destinationAirport!=null){
+ buffer.append(java.lang.String.valueOf(destinationAirport));
+ }
+ buffer.append("</destinationAirport>\n");
+
+ buffer.append("<originAirport>");
+ if(this.originAirport!=null){
+ buffer.append(java.lang.String.valueOf(originAirport));
+ }
+ buffer.append("</originAirport>\n");
+
+ buffer.append("<outwardDate>");
+ if(this.outwardDate!=null){
+ buffer.append(java.lang.String.valueOf(outwardDate));
+ }
+ buffer.append("</outwardDate>\n");
+
+ }
+
+ public void setReturnDate(java.lang.String returnDate){
+ this.returnDate = returnDate;
+ }
+ public java.lang.String getReturnDate(){
+ return returnDate;
+ }
+ public void setDestinationAirport(java.lang.String destinationAirport){
+ this.destinationAirport = destinationAirport;
+ }
+ public java.lang.String getDestinationAirport(){
+ return destinationAirport;
+ }
+ public void setOriginAirport(java.lang.String originAirport){
+ this.originAirport = originAirport;
+ }
+ public java.lang.String getOriginAirport(){
+ return originAirport;
+ }
+ public void setOutwardDate(java.lang.String outwardDate){
+ this.outwardDate = outwardDate;
+ }
+ public java.lang.String getOutwardDate(){
+ return outwardDate;
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOfAirFareQuote.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOfAirFareQuote.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOfAirFareQuote.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOfAirFareQuote.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,78 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2WS_J2ME.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+*/public class ArrayOfAirFareQuote implements org.apache.mirae.xml.rpc.InOutParameter{
+ public ArrayOfAirFareQuote(){
+ obj=new java.util.Vector();
+ }
+
+ private java.util.Vector obj;
+ private org.apache.mirae.xml.rpc.InOutParameter childObj;
+ private uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote item;
+ private uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[] param;
+ public uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[] getParam(){
+ return this.param;
+ }
+ public void setParam(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[] param){
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 3242771:
+ break;
+ default:
+ if(item!=null){
+ item.decode(uri,localName,qName,attributes,value);
+ }else
+ throw new SAXException("unknown tag "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ item.endElement(uri,localName,qName);
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 3242771:
+ item =(new uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote());
+ obj.addElement(item);
+ break;
+ default:
+ if(item!=null){
+ item.startElement(uri,localName,qName,attributes);
+ }else
+ throw new SAXException("unknown tag "+ qName);
+ }
+
+ }
+ public void createArray()throws SAXException {
+ int length=obj.size();
+ param = new uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[length];
+ for(int i = 0;i<length;i++)
+ param[i] = (uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote)obj.elementAt(i);
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ if(param == null)
+ return;
+ for (int i = 0; i < param.length; i++) {
+ buffer.append("<item"+i+ " xsi:type=\"ns1:AirFareQuote\" xmlns:ns1 = \"urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk\">");
+ if(param[i]!=null){
+ param[i].serialize(buffer);
+ }
+ buffer.append("</item"+i+ ">");
+ }
+ }
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOf_xsd_string.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOf_xsd_string.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOf_xsd_string.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/ArrayOf_xsd_string.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,64 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2WS_J2ME.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+*/public class ArrayOf_xsd_string implements org.apache.mirae.xml.rpc.InOutParameter{
+ public ArrayOf_xsd_string(){
+ obj=new java.util.Vector();
+ }
+
+ private java.util.Vector obj;
+ private org.apache.mirae.xml.rpc.InOutParameter childObj;
+ private java.lang.String item;
+ private java.lang.String[] param;
+ public java.lang.String[] getParam(){
+ return this.param;
+ }
+ public void setParam(java.lang.String[] param){
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 3242771:
+ org.apache.mirae.builtin.simpletypes.StringParam item =(new org.apache.mirae.builtin.simpletypes.StringParam(value));
+ obj.addElement(item);
+ break;
+ default:
+ throw new SAXException("unknown tag "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+
+ }
+ public void createArray()throws SAXException {
+ int length=obj.size();
+ param = new java.lang.String[length];
+ for(int i = 0;i<length;i++)
+ param[i] = (java.lang.String)((org.apache.mirae.builtin.simpletypes.StringParam)obj.elementAt(i)).getParam();
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ if(param == null)
+ return;
+ for (int i = 0; i < param.length; i++) {
+ buffer.append("<item"+i+ " xsi:type=\"ns2:string\" xmlns:ns2 = \"http://www.w3.org/2001/XMLSchema\">");
+ if(param[i]!=null){
+ buffer.append(java.lang.String.valueOf(param[i]));
+ }
+ buffer.append("</item"+i+ ">");
+ }
+ }
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteIF.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteIF.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteIF.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteIF.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,10 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+/*This interface is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side representation of the web service.
+*/
+
+public interface SBGGetAirFareQuoteIF {
+ public uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[] getAirFareQuote(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest param0)throws Exception;
+ public java.lang.String[] getAirlines()throws Exception;
+}
Added: webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteStub.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteStub.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteStub.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/airfarequote/uk/co/dsdata/ws/travel/sbg/SBGAirFareQuotes/SBGGetAirFareQuoteStub.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,49 @@
+package uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes;
+/*This class is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side stub of the web service.
+*/
+
+public class SBGGetAirFareQuoteStub implements uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.SBGGetAirFareQuoteIF{
+
+ private java.lang.String enduri;
+ private javax.xml.namespace.QName SOAPAction;
+ public SBGGetAirFareQuoteStub() throws Exception{
+ this.enduri="http://localhost:8080/axis/services/SBGGetAirFareQuote";
+ this.SOAPAction = new javax.xml.namespace.QName("SBGGetAirFareQuoteService");
+ }
+
+ public SBGGetAirFareQuoteStub(java.lang.String enduri) throws Exception {
+ this.enduri = enduri;
+ this.SOAPAction = new javax.xml.namespace.QName("SBGGetAirFareQuoteService");
+ }
+
+ public uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[] getAirFareQuote(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuoteRequest param0) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk","getAirFareQuote");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.addParameter(param0,"param0",new javax.xml.namespace.QName("urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk","AirFareQuoteRequest"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_ARRAY);
+ call.setReturnType( new uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOfAirFareQuote());
+ uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOfAirFareQuote res =(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOfAirFareQuote)call.invoke();
+ return (uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.AirFareQuote[])res.getParam();
+
+ }
+
+ public java.lang.String[] getAirlines() throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:SBGAirFareQuotes.sbg.travel.ws.dsdata.co.uk","getAirlines");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_ARRAY);
+ call.setReturnType( new uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOf_xsd_string());
+ uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOf_xsd_string res =(uk.co.dsdata.ws.travel.sbg.SBGAirFareQuotes.ArrayOf_xsd_string)call.invoke();
+ return (java.lang.String[])res.getParam();
+
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/calculator/CalClientMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/calculator/CalClientMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/calculator/CalClientMIDLet.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/calculator/CalClientMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2001-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.
+ */
+
+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.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+import lk.opensource.wsmobile.CalculatorStub;
+
+public class CalClientMIDLet extends MIDlet implements CommandListener,
+ Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public CalClientMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+ display = Display.getDisplay(this);
+ 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 integers 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);
+ }
+ }
+
+ else 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.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.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 {
+ form.append(stResult);
+ CalculatorStub stub = new CalculatorStub();
+ int i = stub.add(7, 6);
+
+ stResult.setText(stResult.getText() + " " + i);
+
+ 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);
+
+ }
+ }
+}
\ No newline at end of file
Added: webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorIF.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorIF.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorIF.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorIF.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,11 @@
+package lk.opensource.wsmobile;
+/*This interface is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side representation of the web service.
+*/
+
+public interface CalculatorIF {
+ public int add(int param0,int param1)throws Exception;
+ public int sub(int param0,int param1)throws Exception;
+ public int mul(int param0,int param1)throws Exception;
+}
Added: webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorStub.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorStub.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorStub.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/calculator/lk/opensource/wsmobile/CalculatorStub.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,74 @@
+package lk.opensource.wsmobile;
+/*This class is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side stub of the web service.
+*/
+
+public class CalculatorStub implements lk.opensource.wsmobile.CalculatorIF{
+
+ private java.lang.String enduri;
+ private javax.xml.namespace.QName SOAPAction;
+ public CalculatorStub() throws Exception{
+ this.enduri="http://localhost:8080/axis/services/servicesClient";
+ this.SOAPAction = new javax.xml.namespace.QName("CalculatorService");
+ }
+
+ public CalculatorStub(java.lang.String enduri) throws Exception {
+ this.enduri = enduri;
+ this.SOAPAction = new javax.xml.namespace.QName("CalculatorService");
+ }
+
+ public int add(int param0,int param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("http://wsmobile.opensource.lk","add");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op1 = new org.apache.mirae.builtin.simpletypes.IntParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public int sub(int param0,int param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("http://wsmobile.opensource.lk","sub");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op1 = new org.apache.mirae.builtin.simpletypes.IntParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public int mul(int param0,int param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("http://wsmobile.opensource.lk","mul");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op1 = new org.apache.mirae.builtin.simpletypes.IntParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/IntParam.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/IntParam.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/IntParam.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/calculator/org/apache/mirae/builtin/simpletypes/IntParam.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2001-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.
+ */
+
+
+package org.apache.mirae.builtin.simpletypes;
+
+import java.io.IOException;
+
+
+import org.apache.mirae.xml.rpc.InOutParameter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class IntParam implements InOutParameter {
+ private int param;
+
+ public IntParam() {
+ }
+
+ public IntParam(String value) {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ System.out.println(param);
+ }
+
+ public IntParam(int param) {
+ this.param = param;
+ }
+
+ public IntParam(Integer param) {
+ this.param = param.intValue();
+ }
+
+ public void serialize(StringBuffer buffer) throws IOException,Exception {
+ buffer.append(Integer.toString(param));
+
+ }
+
+ /**
+ * @return
+ */
+ public int getParam() {
+ return param;
+ }
+
+ public String toString() {
+ return Integer.toString(param);
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#createArray()
+ */
+ public void createArray() throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/distance/DistanceClient.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/distance/DistanceClient.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/distance/DistanceClient.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/distance/DistanceClient.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2001-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.
+ */
+
+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.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import wsdl.DistanceService.sd.net.xmethods.www.DistancePortTypeStub;
+
+public class DistanceClient extends MIDlet implements CommandListener, Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public DistanceClient() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+
+ display = Display.getDisplay(this);
+
+ 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 country names for getting distance");
+ 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);
+ }
+ }
+
+ else 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.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+
+ Thread me = new Thread(this);
+ me.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 {
+ form.append(stResult);
+ DistancePortTypeStub stub= new DistancePortTypeStub();
+ int dis= stub.getDistance("Sri Lanka","UK");
+
+ stResult.setText(stResult.getText()+" "+dis);
+
+
+ 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);
+
+ }
+ }
+}
\ No newline at end of file
Added: webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/IntParam.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/IntParam.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/IntParam.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/IntParam.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2001-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.
+ */
+
+
+package org.apache.mirae.builtin.simpletypes;
+
+import java.io.IOException;
+
+
+import org.apache.mirae.xml.rpc.InOutParameter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class IntParam implements InOutParameter {
+ private int param;
+
+ public IntParam() {
+ }
+
+ public IntParam(String value) {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ System.out.println(param);
+ }
+
+ public IntParam(int param) {
+ this.param = param;
+ }
+
+ public IntParam(Integer param) {
+ this.param = param.intValue();
+ }
+
+ public void serialize(StringBuffer buffer) throws IOException,Exception {
+ buffer.append(Integer.toString(param));
+
+ }
+
+ /**
+ * @return
+ */
+ public int getParam() {
+ return param;
+ }
+
+ public String toString() {
+ return Integer.toString(param);
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#createArray()
+ */
+ public void createArray() throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/StringParam.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/StringParam.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/StringParam.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/distance/org/apache/mirae/builtin/simpletypes/StringParam.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2001-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.
+ */
+
+package org.apache.mirae.builtin.simpletypes;
+
+import java.io.IOException;
+
+
+import org.apache.mirae.xml.rpc.InOutParameter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+
+
+public class StringParam implements InOutParameter {
+ public String param;
+
+ public StringParam() {
+ }
+
+ public StringParam(String param) {
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ this.param=value;
+ }
+
+ public void serialize(StringBuffer buffer) throws IOException,Exception {
+
+ buffer.append(param);
+
+ }
+
+ public String getParam() {
+ return param;
+ }
+
+ public String toString() {
+ return param;
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#createArray()
+ */
+ public void createArray() throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeIF.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeIF.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeIF.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeIF.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,9 @@
+package wsdl.DistanceService.sd.net.xmethods.www;
+/*This interface is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side representation of the web service.
+*/
+
+public interface DistancePortTypeIF {
+ public int getDistance(java.lang.String param0,java.lang.String param1)throws Exception;
+}
Added: webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeStub.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeStub.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeStub.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/distance/wsdl/DistanceService/sd/net/xmethods/www/DistancePortTypeStub.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,38 @@
+package wsdl.DistanceService.sd.net.xmethods.www;
+/*This class is automatically generated by
+*WSDL2WS_J2ME tool
+*The client side stub of the web service.
+*/
+
+public class DistancePortTypeStub implements wsdl.DistanceService.sd.net.xmethods.www.DistancePortTypeIF{
+
+ private java.lang.String enduri;
+ private javax.xml.namespace.QName SOAPAction;
+ public DistancePortTypeStub() throws Exception{
+ this.enduri="http://localhost:8080/axis/services/DistancePort";
+ this.SOAPAction = new javax.xml.namespace.QName("DistanceService");
+ }
+
+ public DistancePortTypeStub(java.lang.String enduri) throws Exception {
+ this.enduri = enduri;
+ this.SOAPAction = new javax.xml.namespace.QName("DistanceService");
+ }
+
+ public int getDistance(java.lang.String param0,java.lang.String param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("http://www.xmethods.net/sd/DistanceService.wsdl","getDistance");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.StringParam op0 = new org.apache.mirae.builtin.simpletypes.StringParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","string"));
+ org.apache.mirae.builtin.simpletypes.StringParam op1 = new org.apache.mirae.builtin.simpletypes.StringParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","string"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/point/PointClientMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/PointClientMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/PointClientMIDLet.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/PointClientMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2001-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.
+ */
+
+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.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import ws_mobile_point.Point;
+import ws_mobile_point.PointStub;
+
+public class PointClientMIDLet extends MIDlet implements CommandListener,
+ Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public PointClientMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+ display = Display.getDisplay(this);
+ 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);
+ }
+ }
+
+ else 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.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+ Thread me = new Thread(this);
+ me.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 {
+
+ Point p1 = new Point(20, 4);
+ Point p2 = new Point(10, 3);
+
+ PointStub stub = new PointStub();
+ Point p = stub.addPoint(p1, p2);
+
+ result = p.getX() + " , " + p.getY();
+ stResult.setText(result);
+ 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);
+ }
+ }
+}
\ No newline at end of file
Added: webservices/mirae/trunk/samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/IntParam.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/IntParam.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/IntParam.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/org/apache/mirae/builtin/simpletypes/IntParam.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2001-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.
+ */
+
+
+package org.apache.mirae.builtin.simpletypes;
+
+import java.io.IOException;
+
+
+import org.apache.mirae.xml.rpc.InOutParameter;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class IntParam implements InOutParameter {
+ private int param;
+
+ public IntParam() {
+ }
+
+ public IntParam(String value) {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ if (value != null)
+ this.param = Integer.parseInt(value.trim());
+ System.out.println(param);
+ }
+
+ public IntParam(int param) {
+ this.param = param;
+ }
+
+ public IntParam(Integer param) {
+ this.param = param.intValue();
+ }
+
+ public void serialize(StringBuffer buffer) throws IOException,Exception {
+ buffer.append(Integer.toString(param));
+
+ }
+
+ /**
+ * @return
+ */
+ public int getParam() {
+ return param;
+ }
+
+ public String toString() {
+ return Integer.toString(param);
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ */
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#endElement(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see j2me.xml.rpc.InOutParameter#createArray()
+ */
+ public void createArray() throws SAXException {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/ArrayOf_xsd_int.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/ArrayOf_xsd_int.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/ArrayOf_xsd_int.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/ArrayOf_xsd_int.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,66 @@
+package ws_mobile_point;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2Ws.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+ * except for the serialize(), desirialize() methods it it a bean class.
+ * We are specially concerned about the alogorithem used in the desirialize method.
+ * If you have any suggestions to improve, your comments are welcome.</p>
+ */
+public class ArrayOf_xsd_int implements org.apache.mirae.xml.rpc.InOutParameter{
+ public ArrayOf_xsd_int(){
+ obj=new java.util.Vector();
+ }
+
+ private java.util.Vector obj;
+ private org.apache.mirae.xml.rpc.InOutParameter childObj;
+ private int item;
+ private int[] param;
+ public int[] getParam(){
+ return this.param;
+ }
+ public void setParam(int[] param){
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 3242771:
+ org.apache.mirae.builtin.simpletypes.IntParam item =(new org.apache.mirae.builtin.simpletypes.IntParam(value));
+ obj.addElement(item);
+ break;
+ default:
+ throw new SAXException("unknown tag "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+
+ }
+ public void createArray()throws SAXException {
+ int length=obj.size();
+ param = new int[length];
+ for(int i = 0;i<length;i++)
+ param[i] = (int)((org.apache.mirae.builtin.simpletypes.IntParam)obj.elementAt(i)).getParam();
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ if(param == null)
+ return;
+ for (int i = 0; i < param.length; i++) {
+ buffer.append("<item"+i+ " xsi:type=\"ns1:int\" xmlns:ns1 = \"http://www.w3.org/2001/XMLSchema\">");
+ buffer.append(java.lang.String.valueOf(param[i]));
+ buffer.append("</item"+i+ ">");
+ }
+ }
+
+}
Added: webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/Point.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/Point.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/Point.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/Point.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,95 @@
+package ws_mobile_point;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2Ws.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+ * except for the serialize(), desirialize() methods it it a bean class.
+ * We are specially concerned about the alogorithem used in the desirialize method.
+ * If you have any suggestions to improve, your comments are welcome.</p>
+ */
+public class Point implements org.apache.mirae.xml.rpc.InOutParameter{
+ private java.util.Vector obj;
+
+private org.apache.mirae.xml.rpc.InOutParameter childObj; private int x;
+ private int y;
+
+ public Point(){
+ obj=new java.util.Vector();
+ }
+ public Point(int x,int y){
+ this.x = x;
+ this.y = y;
+ }
+
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 120:
+ this.x = (new org.apache.mirae.builtin.simpletypes.IntParam(value)).getParam();
+ break;
+ case 121:
+ this.y = (new org.apache.mirae.builtin.simpletypes.IntParam(value)).getParam();
+ break;
+ default:
+ if (childObj!=null)
+ childObj.decode(uri,localName,qName,attributes,value);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 120:
+ break;
+ case 121:
+ break;
+ default:
+ if (childObj!=null)
+ childObj.endElement(uri,localName,qName);
+ else
+ throw new SAXException("unknown tag find "+ qName);
+ }
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+
+ }
+ public void createArray()throws SAXException {
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ java.lang.String m_URI ="urn:ws_mobile_point";
+ java.lang.String type_name = "Point";
+ //write the parameters
+
+ buffer.append("<x>");
+ buffer.append(java.lang.String.valueOf(x));
+ buffer.append("</x>\n");
+
+ buffer.append("<y>");
+ buffer.append(java.lang.String.valueOf(y));
+ buffer.append("</y>\n");
+
+ }
+
+ public void setX(int x){
+ this.x = x;
+ }
+ public int getX(){
+ return x;
+ }
+ public void setY(int y){
+ this.y = y;
+ }
+ public int getY(){
+ return y;
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointIF.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointIF.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointIF.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointIF.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,18 @@
+package ws_mobile_point;
+/*This interface is automatically generated by
+*WS_Mobile client service generator
+*The client side representation of the web service.
+*/
+
+public interface PointIF {
+ public java.lang.String getName(java.lang.String param0,java.lang.String param1)throws Exception;
+ public int add(int param0,int param1)throws Exception;
+ public ws_mobile_point.Point operations(int param0,int param1,int param2)throws Exception;
+ public ws_mobile_point.Point addPoint(ws_mobile_point.Point param0,ws_mobile_point.Point param1)throws Exception;
+ public int distance(ws_mobile_point.Point param0,ws_mobile_point.Point param1)throws Exception;
+ public int[] addArray(int[] param0,int[] param1)throws Exception;
+ public int getX()throws Exception;
+ public int getY()throws Exception;
+ public void setX(int param0)throws Exception;
+ public void setY(int param0)throws Exception;
+}
Added: webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointStub.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointStub.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointStub.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/point/ws_mobile_point/PointStub.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,181 @@
+package ws_mobile_point;
+/*This class is automatically generated by
+*WS_Mobile client stub generator
+*The client side stub of the web service.
+*/
+
+public class PointStub implements ws_mobile_point.PointIF{
+
+ private java.lang.String enduri;
+ private javax.xml.namespace.QName SOAPAction;
+ public PointStub() throws Exception{
+ this.enduri="http://localhost:8080/axis/services/Point";
+ this.SOAPAction = new javax.xml.namespace.QName("PointService");
+ }
+
+ public PointStub(java.lang.String enduri) throws Exception {
+ this.enduri = enduri;
+ this.SOAPAction = new javax.xml.namespace.QName("PointService");
+ }
+
+ public java.lang.String getName(java.lang.String param0,java.lang.String param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","getName");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.StringParam op0 = new org.apache.mirae.builtin.simpletypes.StringParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","string"));
+ org.apache.mirae.builtin.simpletypes.StringParam op1 = new org.apache.mirae.builtin.simpletypes.StringParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","string"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.StringParam());
+ org.apache.mirae.builtin.simpletypes.StringParam res = (org.apache.mirae.builtin.simpletypes.StringParam)call.invoke();
+ return new java.lang.String(res.getParam());
+
+ }
+
+ public int add(int param0,int param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","add");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op1 = new org.apache.mirae.builtin.simpletypes.IntParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public ws_mobile_point.Point operations(int param0,int param1,int param2) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","operations");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op1 = new org.apache.mirae.builtin.simpletypes.IntParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ org.apache.mirae.builtin.simpletypes.IntParam op2 = new org.apache.mirae.builtin.simpletypes.IntParam(param2);
+ call.addParameter(op2,"param2",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_COMPLEX);
+ call.setReturnType( new ws_mobile_point.Point());
+ ws_mobile_point.Point res = (ws_mobile_point.Point)call.invoke();
+ return res;
+
+ }
+
+ public ws_mobile_point.Point addPoint(ws_mobile_point.Point param0,ws_mobile_point.Point param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","addPoint");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.addParameter(param0,"param0",new javax.xml.namespace.QName("urn:ws_mobile_point","Point"));
+ call.addParameter(param1,"param1",new javax.xml.namespace.QName("urn:ws_mobile_point","Point"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_COMPLEX);
+ call.setReturnType( new ws_mobile_point.Point());
+ ws_mobile_point.Point res = (ws_mobile_point.Point)call.invoke();
+ return res;
+
+ }
+
+ public int distance(ws_mobile_point.Point param0,ws_mobile_point.Point param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","distance");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.addParameter(param0,"param0",new javax.xml.namespace.QName("urn:ws_mobile_point","Point"));
+ call.addParameter(param1,"param1",new javax.xml.namespace.QName("urn:ws_mobile_point","Point"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public int[] addArray(int[] param0,int[] param1) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","addArray");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ ws_mobile_point.ArrayOf_xsd_int op0 = new ws_mobile_point.ArrayOf_xsd_int();
+ op0.setParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("urn:ws_mobile_point","ArrayOf_xsd_int"));
+ ws_mobile_point.ArrayOf_xsd_int op1 = new ws_mobile_point.ArrayOf_xsd_int();
+
+ op1.setParam(param1);
+ call.addParameter(op1,"param1",new javax.xml.namespace.QName("urn:ws_mobile_point","ArrayOf_xsd_int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_ARRAY);
+ call.setReturnType( new ws_mobile_point.ArrayOf_xsd_int());
+ ws_mobile_point.ArrayOf_xsd_int res =(ws_mobile_point.ArrayOf_xsd_int)call.invoke();
+ return (int[])res.getParam();
+
+ }
+
+ public int getX() throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","getX");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public int getY() throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","getY");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ call.setTargetEndpointAddress(this.enduri);
+ call.setReturnCategory(org.apache.mirae.util.Constants.TYPE_SIMPLE);
+ call.setReturnType( new org.apache.mirae.builtin.simpletypes.IntParam());
+ org.apache.mirae.builtin.simpletypes.IntParam res = (org.apache.mirae.builtin.simpletypes.IntParam)call.invoke();
+ return res.getParam();
+
+ }
+
+ public void setX(int param0) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","setX");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.invoke();
+ }
+
+ public void setY(int param0) throws Exception{
+ javax.xml.namespace.QName methodName = new javax.xml.namespace.QName("urn:ws_mobile_point","setY");
+ org.apache.mirae.xml.rpc.Call call = new org.apache.mirae.xml.rpc.Call();
+ call.setStyle(org.apache.mirae.util.Constants.STYLE_RPC);
+ call.setOperationName(methodName);
+ call.setSoapActonURI(SOAPAction);
+ org.apache.mirae.builtin.simpletypes.IntParam op0 = new org.apache.mirae.builtin.simpletypes.IntParam(param0);
+ call.addParameter(op0,"param0",new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema","int"));
+ call.setTargetEndpointAddress(this.enduri);
+ call.invoke();
+ }
+}
Added: webservices/mirae/trunk/samples/rpcsamples/student/StudentClientMIDLet.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/student/StudentClientMIDLet.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/student/StudentClientMIDLet.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/student/StudentClientMIDLet.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2001-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.
+ */
+
+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.StringItem;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+import example8.Student;
+import example8.StudentOpStub;
+
+public class StudentClientMIDLet extends MIDlet implements CommandListener,
+ Runnable {
+
+ public static StringItem stResult;
+
+ private Display display;
+
+ private Form form;
+
+ private Command quitCommand, sendCommand, backCommand;
+
+ private boolean isSafeToExit;
+
+ public String result;
+
+ boolean gotResult = false;
+
+ private StringItem tf;
+
+ public StudentClientMIDLet() {
+ setting();
+ }
+
+ public void setting() {
+ stResult = new StringItem("Result:", "");
+ display = Display.getDisplay(this);
+ 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 string and get Student");
+ 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);
+ }
+ }
+
+ else 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.removeCommand(sendCommand);
+ form.removeCommand(quitCommand);
+ backCommand = new Command("Back", Command.SCREEN, 1);
+ form.addCommand(backCommand);
+ Thread me = new Thread(this);
+ me.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 {
+ StudentOpStub stub = new StudentOpStub();
+ Student st = stub.getStudentObj(null);
+ stResult.setText(st.getName() + " " + st.getDetail()[0] + " "
+ + st.getDetail()[1]);
+ form.append(stResult);
+ gotResult = true;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ Alert alert = new Alert("Error", e.toString(), null,
+ AlertType.ERROR);
+ alert.setTimeout(5000);
+ alert.setCommandListener(this);
+ display.setCurrent(alert, form);
+
+ }
+ }
+}
\ No newline at end of file
Added: webservices/mirae/trunk/samples/rpcsamples/student/example8/ArrayOf_xsd_string.java
URL: http://svn.apache.org/viewcvs/webservices/mirae/trunk/samples/rpcsamples/student/example8/ArrayOf_xsd_string.java?view=auto&rev=151149
==============================================================================
--- webservices/mirae/trunk/samples/rpcsamples/student/example8/ArrayOf_xsd_string.java (added)
+++ webservices/mirae/trunk/samples/rpcsamples/student/example8/ArrayOf_xsd_string.java Thu Feb 3 04:39:48 2005
@@ -0,0 +1,64 @@
+package example8;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+/**
+ * <p>This class is genarated by the tool WSDL2WS_J2ME.
+ * It take care of the serialization and the desirialization of
+ * the parameter types.
+*/public class ArrayOf_xsd_string implements org.apache.mirae.xml.rpc.InOutParameter{
+ public ArrayOf_xsd_string(){
+ obj=new java.util.Vector();
+ }
+
+ private java.util.Vector obj;
+ private org.apache.mirae.xml.rpc.InOutParameter childObj;
+ private java.lang.String item;
+ private java.lang.String[] param;
+ public java.lang.String[] getParam(){
+ return this.param;
+ }
+ public void setParam(java.lang.String[] param){
+ this.param = param;
+ }
+
+ public void decode(String uri, String localName, String qName, Attributes attributes, String value)throws SAXException {
+ int localNameHash = qName.hashCode();
+ switch(localNameHash){
+ case 3242771:
+ org.apache.mirae.builtin.simpletypes.StringParam item =(new org.apache.mirae.builtin.simpletypes.StringParam(value));
+ obj.addElement(item);
+ break;
+ default:
+ throw new SAXException("unknown tag "+ qName);
+ }
+
+ }
+
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+
+ }
+ public void createArray()throws SAXException {
+ int length=obj.size();
+ param = new java.lang.String[length];
+ for(int i = 0;i<length;i++)
+ param[i] = (java.lang.String)((org.apache.mirae.builtin.simpletypes.StringParam)obj.elementAt(i)).getParam();
+
+ }
+
+ public void serialize(StringBuffer buffer)throws java.io.IOException, Exception{
+ if(param == null)
+ return;
+ for (int i = 0; i < param.length; i++) {
+ buffer.append("<item"+i+ " xsi:type=\"ns1:string\" xmlns:ns1 = \"http://www.w3.org/2001/XMLSchema\">");
+ if(param[i]!=null){
+ buffer.append(java.lang.String.valueOf(param[i]));
+ }
+ buffer.append("</item"+i+ ">");
+ }
+ }
+
+}