Direct Mobile Web Service Access

Mobile applications can directly access Web services without an intermediary proxy server. MobileDirectTestServiceInvoke.java is a simple Java program that uses the InvokeService class we discussed earlier in the chapter and directly calls the ChessMaster Web service without using a proxy server for the invocation.

The Java source code in its entirety for the MobileDirectTestServiceInvoke.java class follows:

/*
 * MobileDirectTestServiceInvoke.java
 */

import java.util.StringTokenizer;

public class MobileDirectTestServiceInvoke
{
   public static void main ( String args[] )
   {

Each of the hard-coded values for the Web service endpoint, method name, and method arguments can be easily changed to build a dynamic mobile ...

Get Developing Enterprise Web Services: An Architect's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.