The Wireless Connection Tool is a utility that greatly simplifies the process of developing Java ME applications that connect to third-party web services or other kinds of back-end systems. The tool can generate two kinds of clients that connect to external services over HTTP. If the device for which you are developing is JSR-172 compliant, you can easily generate a client application from a WSDL file or a URL. If the device does not support JSR-172, the wizard will create a web service proxy in the container, which can then be accessed via a generated servlet over a simple HTTP connection. In addition, you can write your own database proxy and the wizard will also generate a servlet in the container that you can use to access the database via the proxy. For all the scenarios the wizard will generate a client application that is ready to run on the device and can be edited using the Visual Designer. However, it is a good idea to modify this client application to suite your needs before deploying. Creating Applications that Consume WS-I Compliant Web ServicesIf the device you are developing for is JSR-172 compliant, you can easily create a client application that will consume the web service provided that it is WS-I compliant. To generate a client application:
Creating Applications Using the Web Service ProxyAt the time of this writing, there are very few available devices that implement JSR-172. Because of this, the tool supports an alternate method of connecting to web services via a web service proxy, which sits in the container and talks to the web service for the device. The device talks to a proxy servlet that acts as a liaison between the web service and the device over a simple HTTP protocol. To create an application that connects to a web service via a web service proxy:
Again, a Visual MIDlet that you can use as a basis for your application will be generated and opened in the Visual Designer. Also, by double-clicking a node with an extension named wsclient in your Mobile Application project, you can change or review the options you have selected previously and regenerate the client. Using a very similar procedure you can easily connect to any application you might have running in the web container. For example, if you have an application that requires massive processing power to compute a complex mathematical formula, it would be better to perform the calculation on the back end rather than on the device. To do so, you just need to select the Methods in Web Application radio button on the Servlet and Client Type page of the New Mobile Client in Web Application wizard. The wizard will then generate a servlet that will take parameters from the device, pass them to the method, and then send back the result when it becomes available. |