Hello ,
I want to send sms using 6600(wma api).
it gives ; java.io.exception:SymbianOs error = -2 .

I am working on it for 7 hours.I searched forum.nokia ,forum.sun and all the web.I try wma api examples but I can't run them.
If you have a simple working code (jar ). Could you send please?? Thanks for your help..
Here is the source code ;

//-------------------------------
import java.io.*;
import javax.microedition.io.*;
import javax.wireless.messaging.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;

public class SMS extends MIDlet implements CommandListener,Runnable /*, MessageListener */{

private Command exitCommand;
private Command sendCommand;
private Display display;

private Form form;

private ChoiceGroup cg;
private TextField MessageAddressField;
private TextField TextMessageBodyField;
private MessageConnection con;


private Alert alert;
private Image thumbUp;

private String MessageAddress;
private String MessageServerPort;
private String TextMessageBody;

String destAddress;
String messageBody;
private void log (String logMessage) {
System.out.println (logMessage);
if (form != null) {
form.append(logMessage);
}
}

private void init () {
MessageServerPort ="7500";

TextMessageBody ="deneme mesaji";

}

/** Constructor */
public SMS() {
}


public void startApp() {

// Initialize MIDlet parameters from the JAD file
init ();

// Listen for incomming messages
// listen (MessageServerPort);

exitCommand = new Command("Exit", Command.EXIT, 2);
sendCommand = new Command("Send", Command.OK, 1);

form = new Form("Sms deneme");
// Create a field for the destination address
MessageAddressField = new TextField("Address:", "sms://+9012345678:7500", 40, TextField.ANY);
form.append(MessageAddressField);

// Create a field for the message body
TextMessageBodyField = new TextField("Message:", TextMessageBody, 435, TextField.ANY);
form.append(TextMessageBodyField);

// Add commands to the form
form.addCommand(exitCommand);
form.addCommand(sendCommand);
form.setCommandListener(this);

// Set display
display = Display.getDisplay(this);
display.setCurrent(form);
}

/** Handle pausing the MIDlet */
public void pauseApp() {
try
{
con.close();
}
catch (Exception ex)
{
}
}

/** Handle destroying the MIDlet */
public void destroyApp(boolean unconditional) {
try
{
con.close();
}
catch (Exception ex)
{
}
}

public void commandAction(Command c, Displayable d) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}

// Send a text message
if (c == sendCommand ) {
if (TextMessageBody != null) {
destAddress = MessageAddressField.getString().trim();
messageBody = TextMessageBodyField.getString();
Thread thread = new Thread(this);
thread.start();


}
}
}



public void run() {

try
{
// con = (MessageConnection) Connector.open("sms://:" + MessageServerPort);
con = (MessageConnection) Connector.open(destAddress);
}
catch(Exception ex)
{
log("Exception during listen: con yaratirken" + ex);
}

// Construct the message
// TextMessage Message = (TextMessage)connection.newMessage(MessageConnection.TEXT_MESSAGE, destAddress);
TextMessage Message = (TextMessage)con.newMessage(MessageConnection.TEXT_MESSAGE);

// Set the payload
Message.setPayloadText("hellooooo");

try
{
// Send the message
con.send(Message);
/*
alert = new Alert("Message Sent");
alert.setTimeout(3000); //3 seconds
display.setCurrent(alert, form);
*/
//log ("Text Message sent: " + Body);
}
catch (IOException ioex)
{
log("IOException_send: " + ioex);
}
catch(SecurityException syex)
{
log("SecurityException_send: " + syex.toString());
}
catch (Exception ex)
{
log("Exception_send: " + ex.toString());
}


}




}

//----------------