×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    6

    Web services on Series 60 emulator problem

    This post may appear familar because its the second time i post the problem now that the circle is complete. I am trying to create a simple (ha, if only) streaming audio web service for mobile clients. Currently i can get the client to connect to the web service using the ksoap package when the client is the Series 60 MIDP Concept beta 0.3 but not the v1.2 of the emulator. However the concept version differs in that it lacks all the directory structure for installation of sis files necessary to use the Real One Player on the emulator (please correct me if i am wrong and also tell me how to install Real One player). Therefore unless i just want to forget streaming i am forced into the v1.2 emulator to run proprietary streaming products. Anyway this is just background. The problem is that i get the following problem when i try to connect to my web service:


    [Info] Series 60 MIDP SDK for Symbian OS version 1.2: java.io.IOException: Status = -21
    [Info] Series 60 MIDP SDK for Symbian OS version 1.2: at org.ksoap.transport.HttpTransport.call(+417)
    [Info] Series 60 MIDP SDK for Symbian OS version 1.2: at org.ksoap.transport.HttpTransport.call(+12)
    [Info] Series 60 MIDP SDK for Symbian OS version 1.2: at ConnectionManager.run(+49)


    I run the HTTP connection code in a separate thread, inappropriately called ConnectionManager for now. It has the over written method run. I also include the client interface and server code below - i would very much like an answer to this problem. I am new to mobile devices so please explain well.

    public void run()
    {

    HttpTransport httpTransport = null;

    try
    {
    SoapObject rpc = new SoapObject ("urn:MobileDemo", "getAudioURL");
    rpc.addProperty("in0", "demo");
    rpc.addProperty("in1", "wav");
    httpTransport = new HttpTransport("http://localhost:8080/axis/services/MobileDemo", "urn:MobileDemo#getAudioURL");
    Object returnObject = httpTransport.call(rpc);
    String url = returnObject.toString();
    play(url);
    }
    catch (IOException ioe)
    {
    ioe.printStackTrace();
    }
    finally
    {

    httpTransport.reset();
    }

    }

    My tiny client code:

    public class Welcome extends MIDlet implements CommandListener
    {

    Form mainForm = new Form ("MobileService");
    StringItem resultItem = new StringItem ("","");

    Command getCommand = new Command ("Get", Command.SCREEN, 1);


    public Welcome()
    {

    mainForm.append(new StringItem(null, "Streaming Demo"));
    mainForm.append (resultItem);

    mainForm.addCommand (getCommand);
    mainForm.setCommandListener (this);


    }
    protected void startApp( ) throws MIDletStateChangeException
    {

    Display.getDisplay (this).setCurrent (mainForm);
    }

    protected void pauseApp( )
    {

    }

    protected void destroyApp( boolean p1 ) throws MIDletStateChangeException
    {
    }

    public void commandAction( Command p1, Displayable p2 )
    {

    ConnectionManager connectionManager = new ConnectionManager();
    connectionManager.start();

    }
    }

    And my even simpler web service code:

    public java.lang.String getAudioURL(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException {

    return "http://localhost:8080/examples/" + in0 + "." + in1;
    }

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    Change "localhost" to the real ip number. (Not 127.0.0.1).

    You can check it with ipconfig, or something.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    6
    Thanks for the suggestion BUT it makes no difference at all. Replacing localhost with the ip address (obtained with ipconfig) to form the following 2 arguments to the HttpTransport constructor: ("http://xxx.x.xxx.xxx:80/axis/services/MobileDemo", "urn:MobileDemo#getAudioURL") still gives me:

    java.io.IOException: Status = -21
    at org.ksoap.transport.HttpTransport.call(+417)
    at org.ksoap.transport.HttpTransport.call(+12)
    at ConnectionManager.run(+49)

    N.B i also changed to port 80 as that was one suggestion gleamed off the forums, but that also makes no difference either. The code still works works on the series 60 concept SDK, so i know my code is solid enough for the demo.

Posting Permissions

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