This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java Micro Edition and the fly likes Calling Web Service method from Java ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Calling Web Service method from Java ME" Watch "Calling Web Service method from Java ME" New topic
Author

Calling Web Service method from Java ME

Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Hi guys, I have a little problem to calling web services' method using Java ME device.

I use NetBeans to generate the Web Service client. After I generate it, now what ? How can I call the method ?



Thanks


Jeffry Kristianto Yanuar
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Is the SOAP stack you're using compatible with JME? I would imagine that you need to rewrite the client to use the classes in javax.microedition.io instead of the java.net classes (which don't exist in JME).


Ping & DNS - my free Android networking tools app
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
I already called it successfully.

The key is, by creating Web services client using NetBeans feature, and then use the class XXX_stub.class to create object, and then call the object method. The XXX will be a specific Web services name.

Using NetBeans to call a web services in J2ME is as easy as calling local method.


Thanks


Jeffry Kristianto Yanuar SCJA, SCJP, SCJD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
I already called it successfully.

So the problem is solved?
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Yes it is, calling the Web Service from MIDP is easier than calling from Java Desktop application.

Jeffry Kristianto Yanuar SCJP, SCJA, SCJD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calling Web Service method from Java ME