×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    [Merged]HELP with a simple web service call

    Hi, i am a new j2me developer.

    I am working on a lyrics app that gets lyrics from this web service

    http://api.chartlyrics.com/apiv1.asmx?WSDL.

    i was able to generate a stub class.

    i then wrote a simple j2me app to test whether i can get a lyrics from the site which i had already tested using the my web browser and knew the lyrics was available.

    i tried running it on my phone and it gave a this application error "Class Cast java/lang/ClassCastException".

    Thanks for your needed help in advance.

    the Midlet class i wrote is this

    package apiv1;

    import java.rmi.RemoteException;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;

    /**
    * @author Administrator
    */
    public class Midlet extends MIDlet {
    public void startApp() {
    Display d = Display.getDisplay(this);



    apiv1_Stub apiS = new apiv1_Stub();
    //apiS.ENDPOINT_ADDRESS_PROPERTY = javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY;
    GetLyricResult glr = new GetLyricResult();
    // List<SearchLyricResult> slr = new Arraylist<SearchLyricResult>();

    try {
    glr = apiS.getLyric(103254, "c95ecd781b0c6d6e5673f0f8eea04d61");
    String lyrics = glr.getLyric();
    // Displayable dp = new TextBox("Lyrics", lyrics,100, 100);
    // d.setCurrent(dp);

    } catch (RemoteException ex) {
    String message = ex.getMessage();
    // Displayable dp1 = new TextBox("Error", message, 100, 100);
    //d.setCurrent(dp1);
    }
    //String s = glr.getLyric();
    //Displayable dp1 = new TextBox("Lyrics", s, 300, 100);
    //d.setCurrent(dp1);


    //println(ex.toString());



    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void run() {

    }

    /* public String getLyric() {
    try {
    apiv1_Stub apiS = new apiv1_Stub();
    // apiS.
    GetLyricResult glr = new GetLyricResult();
    glr = apiS.getLyric(103254, "c95ecd781b0c6d6e5673f0f8eea04d61");

    // println(glr.getLyric());
    return glr.getLyric();

    }
    catch (Exception ex) {
    //println(ex.toString());
    //TextBox tb1 = new TextBox("Title", ex.toString(), 600, 300);
    return ex.toString();
    }

    }*/

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: HELP with a simple web service call

    did you run it on an emulator prior to a phone?

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: HELP with a simple web service call


  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Re: HELP with a simple web service call

    I am trying to test run a J2ME app that i download from the web on my Netbeans IDE Emulator but it gives me this error

    java.lang.SecurityExceptions
    Application not authorized to access the restricted API

    When i click the exit on the screen it bring a display that contains

    Install Application
    Manage Certificate Authorities

    I have ran the app on my mobile phone and am sure it is working perfectly.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: HELP with a simple web service call

    is the application signed ?

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Netbeans IDE Emulator cant connected to the Internet

    I am trying to test run a J2ME app that i download from the web on my Netbeans IDE Emulator but it gives me this error

    java.lang.SecurityExceptions
    Application not authorized to access the restricted API

    When i click the exit on the screen it bring a display that contains

    Install Application
    Manage Certificate Authorities

    I have ran the app on my mobile phone and am sure it is working perfectly.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Netbeans IDE Emulator cant connected to the Internet

    like i said, is your application signed ?

    (and btw, you do realize that you post that post already, right?)

Similar Threads

  1. Application to call the web service
    By ambkps in forum Symbian
    Replies: 1
    Last Post: 2009-12-05, 13:14
  2. How to call a Web Service
    By lessa.bru in forum Symbian
    Replies: 4
    Last Post: 2009-03-09, 10:28
  3. How to call a Web Service?
    By sunil_bhambani123 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-12-15, 12:50
  4. Call a web service that uses xs:any
    By fgeorges in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-09-14, 18:34
  5. Call Web service in WTK 2.2
    By jota13 in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2006-10-04, 21:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •