J2ME Samples
============

TestStubMidlet.java is a sample MIDlet which allows users to quickly
test J2ME stubs generated from Web Services registered with the J2ME
Proxy Server.

HelloWorld.java is a simple MIDlet that calls the OTN Hello World Web
Service through a generated stub.  This web service can be registered
with the hello.wsdl document.

PushDemoMIDlet.java is a more complex sample that calls the PushServer
web service through a generated stub.  The PushServer service can be
registered with the PushLite.wsdl document.

Sample1.java to Sample5.java test different features or paremeter
types supported by the Oracle J2ME Web Services Client Library and the
J2ME Proxy Server.


Usage of TestStubMidlet 
-----------------------
Suppose you want to build a stock quote application using the Delayed
Stock Quote Web Service provided by XMethods.  You can register this
service using the WSDL document:
http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl .
After registration is completed, you can generate a J2ME client stub
for this service and save it to your local disk.  You then modify the
TestStubMidlet.java file as follows: add the stub class to the import
list and modify the callStub method to instantiate the stub class and
call the getQuote method.  Finally, package the stub class, the
modified TestStubMidlet, and the j2me_sdk.jar JAR file, and build a
MIDlet suite.  You are now ready to test the web service from your
J2ME MIDlet.

Build Samples
-------------
You can use Sun's J2ME Wireless Toolkit to compile and run the
samples.  Get the toolkit at:
http://java.sun.com/products/j2mewtoolkit/ .  Follow the toolkit's
user guide to create a new project.  Add the sample MIDllets to the
src directory of the project.  Put the Oracle J2ME Web Service Client
Library, j2me_sdk.jar, in the lib directory of the project.  Build and
run the project.

Web Service Registration
------------------------
Use WSDL Registration at the J2ME Proxy Server to register the OTN
Hello World web service and the PushServer web service used by the
HelloWorld and PushDemoMIDlet samples.  Use hello.wsdl (also found at:
http://otn.oracle.com/tech/webservices/htdocs/live/hello.wsdl ) and
PushLite.wsdl to register these services.

For the Sample1 to Sample5 samples, use Class Registration to register
oracle.wireless.me.server.TestWebService and
oracle.wireless.me.server.TestWebService2, which are in the
testservices.jar JAR file (in the webservice/lib directory of the J2ME
proxy server home.)

Web Service Client Stubs
------------------------
Once the web services are registered, generate J2ME client stubs for
those services.  The generated client stubs for the OTN hello world
service and the PushServer service will have the names:
IOTNHelloWorldJ2MEStub.java and PushServerJ2MEStub.java .
HelloWorld.java and PushDemoMIDlet.java require these two client stubs
to compile.


Sample Execution
----------------
HelloWorld: Once you launch this MIDlet, select "Menu", and then
select "hello" to execute the hello world web service registered
above.  You should see the text: "Hello World" appear on the screen
when the call to the web service returns.

PushDemoMIDlet: This MIDlet allows you to send email, voice, fax, and
SMS messages.  Fill out all the fields and press "Send" when done.
For the "To" field, use a valid email address for email messages, and
use a valid phone number as you would dial it on a phone for voice,
fax, or sms messages (for example: 1-800-555-1212).

