Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Someone
Friday, October 13th, 2006 at 3:27:53pm MDT 

  1. package testing;
  2.  
  3. import java.io.IOException;
  4. import javax.microedition.lcdui.*;
  5. import javax.microedition.midlet.*;
  6. import org.ksoap2.serialization.SoapObject;
  7. import org.ksoap2.serialization.SoapSerializationEnvelope;
  8. import org.ksoap2.transport.HttpTransport;
  9. import org.ksoap2.SoapEnvelope;
  10. import org.ksoap2.serialization.PropertyInfo;
  11. import org.xmlpull.v1.XmlPullParserException;
  12. import java.util.Vector;
  13.  
  14. public class Test
  15.         extends MIDlet
  16.         implements Runnable {
  17.        
  18.         private Display display;
  19.         private List AirChoose;
  20.         private String url = "http://127.0.0.1:8080/axis/services/";
  21.         private Thread t;
  22.         private SoapObject soapObject;
  23.         private HttpTransport transport;
  24.         private SoapSerializationEnvelope envelope;
  25.        
  26.         public void startApp() {
  27.                 display = Display.getDisplay(this);
  28.                 display.setCurrent(AirChoose);
  29.         }
  30.        
  31.         public void pauseApp() { }
  32.        
  33.         public void destroyApp(boolean unconditional) { }
  34.        
  35.         public void run() {
  36.                
  37.                 String method = "getAirLines";
  38.                 Vector airlines = new Vector();
  39.                
  40.                 soapObject = new SoapObject(url, method);
  41.                 transport = new HttpTransport(url);
  42.                
  43.                 try {
  44.                         airlines = this.soapCallVector(method);
  45.                 } catch(IOException ex) {
  46.                         System.out.println("Vai busca-la");
  47.                 }
  48.                
  49.                
  50.                 String[] airline = new String[airlines.size()];
  51.                
  52.                 for(int i=0; i<airline.length; i++) {
  53.                         airline[i] = airlines.elementAt(i).toString();
  54.                 }
  55.                
  56.                 AirChoose = new List("AirLines",
  57.                                 List.IMPLICIT, airline, null);
  58.                
  59.                 display.setCurrent(AirChoose);
  60.                
  61.         }
  62.        
  63.         public Test() {
  64.                 t = new Thread(this);
  65.                 t.start();
  66.         }
  67.        
  68.         public Vector soapCallVector(String method)
  69.         throws java.io.IOException {
  70.                
  71.                 Vector list = new Vector();
  72.                
  73.                 envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  74.                 envelope.bodyOut = soapObject;
  75.                 envelope.addMapping("http://xml.apache.org/xml-soap","Vector",PropertyInfo.VECTOR_CLASS);
  76.                
  77.                 try {
  78.                         transport.call(method, envelope);       
  79.                 }catch(XmlPullParserException io) {
  80.                         System.err.println(io);
  81.                 }
  82.                
  83.                 list = (Vector) envelope.getResponse();
  84.                
  85.                 return list;
  86.         }
  87. }
  88.  
  89.  
  90. java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
  91.         at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
  92.         at com.sun.midp.midlet.Scheduler.schedule(+52)
  93.         at com.sun.midp.main.Main.runLocalClass(+28)
  94.         at com.sun.midp.main.Main.main(+116)
  95.  
  96. ksoap2 -> http://jaist.dl.sourceforge.net/sourceforge/ksoap2/ksoap2-j2me-full-2.1.1.jar

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right