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;
}

Reply With Quote

