mr.sweetchuck 0 Light Poster

I'm writing a Java ME app that will access servlets on a tomcat server, (version 5.5) and I'm having a problem. In my client I'm trying to use a HTTP connection to the servlet, like so:

if (command == select && currentForm == login)
{
    HttpConnection connection = null;
    InputStream inputstream = null;
                
    try
    {
           int id = Integer.parseInt(loginTF[0].getString());
    }
    catch (NumberFormatException e)
    {
           System.out.println("Invalid number type" + e);
    }
    String pword = loginTF[1].getString();

    try
    {
          connection = (HttpConnection) Connector.open("http://localhost:8080/nurse/NurseServer.doPost?method=login&userID="+id+"&password="+pword);
          connection.setRequestMethod(HttpConnection.GET);
          connection.setRequestProperty("Content-Type", "//textplain");
          connection.setRequestProperty("Connection", "close");
    }
    catch (IOException e)
    {
          System.out.println("Error at client login: " + e.toString());
    }
}

I'm running it on an emulator on the machine, which is compiling the code. However it is giving me an cannot find symbol error and pointing to the URL.

Additional info:

localhost:8080/nurse is a webservice that I've deployed.
I've tried using the ip address of the machine instead, but I'm getting the same error again.
Tomcat is running.
NurseServer is the class that I want to call, (which is compiled propperly).
doPost is the method that, from what I'm understand, you have to call from the client.

Any suggestions as to what is the problem? Any addition info need, just ask.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.