Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0, Mac OS

Get PDF Book Print View

Document Information

Getting Started


Using Sample Projects

Creating and Editing Projects

Viewing and Editing Project Properties

Running Projects in the Emulator

Searching the WURFL Device Database

Finding Files in the Multiple User Environment

Profiling Applications

Network Monitoring

Lightweight UI Toolkit

Security and MIDlet Signing

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)

On-device Debugging

Command Line Reference


JSR Support

JSR 75: PDA Optional Packages

JSR 82: Bluetooth and OBEX Support

JSR 135: Mobile Media API Support

JSR 172: Web Services Support

Generating Stub Files from WSDL Descriptors

Creating a New Mobile Web Service Client

Run JSR172Demo

JSR 177: Smart Card Security (SATSA)

JSR 179: Location API Support

JSR 180: SIP Communications

JSR 184: Mobile 3D Graphics

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 226: Scalable 2D Vector Graphics

JSR 229: Payment API Support

JSR 238: Mobile Internationalization API (MIA)

JSR 256: Mobile Sensor API Support


Creating a New Mobile Web Service Client

This sample procedure creates a new project and adds a web service client. However, you can add a web service client to any MIDP project, it does not have to be new.

  1. Select File > New Project, choose MIDP application, and click Next. Name your project and ensure Create Hello MIDlet is checked. Click Finish.
  2. Right-click on the new project’s Source Packages node and select New > Other.
  3. In the Categories pane select Other, and in the File Types area choose Mobile Webservice Client.
  4. In the Generate J2ME Webservice Stub page:

    Click Finish. The new package appears in Source Packages and includes Shakespeare.java and Shakespeare_Stub.java.

  5. Edit HelloMIDlet.java as follows:
    • At the beginning, add the following import declaration:

      import testws.*

    • Locate the startApp() method and replace its contents with the following code:

      String text;
      Shakespeare s = new Shakespeare_Stub();
          text = s.GetSpeech("Romeo");
      }catch(java.rmi.RemoteException rex)
           text = "error";
      TextBox t = new TextBox("Hello", text, 2048, 0);
  6. Build and run the project. You see a quote from Shakespeare’s Romeo and Juliet on the device screen.

    You can vary the above procedure to use a local WSDL file. Open the following web page in a browser:


    Save it to a local file. For example, c:\ws\WSShakespeare.wsdl. Follow the procedure above, except at Step 4, specify the local file name.