# Class WebServiceProxyCall

java.lang.Object
com.codename1.io.WebServiceProxyCall

public abstract class WebServiceProxyCall extends Object
Utility class used by the webservice proxy code to invoke server code

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `WebServiceProxyCall.WSDefinition`
  Webservice definition type, allows defining the argument values for a specific WS call

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `TYPE_BOOLEAN`
  Web protocol argument/return type
  `static final int`
  `TYPE_BOOLEAN_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_BOOLEAN_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_BYTE`
  Web protocol argument/return type
  `static final int`
  `TYPE_BYTE_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_BYTE_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_CHAR`
  Web protocol argument/return type
  `static final int`
  `TYPE_CHAR_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_CHARACTER_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_DOUBLE`
  Web protocol argument/return type
  `static final int`
  `TYPE_DOUBLE_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_DOUBLE_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_EXTERNALIABLE`
  Web protocol argument/return type
  `static final int`
  `TYPE_FLOAT`
  Web protocol argument/return type
  `static final int`
  `TYPE_FLOAT_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_FLOAT_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_INT`
  Web protocol argument/return type
  `static final int`
  `TYPE_INT_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_INTEGER_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_LONG`
  Web protocol argument/return type
  `static final int`
  `TYPE_LONG_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_LONG_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_SHORT`
  Web protocol argument/return type
  `static final int`
  `TYPE_SHORT_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_SHORT_OBJECT`
  Web protocol argument/return type
  `static final int`
  `TYPE_STRING`
  Web protocol argument/return type
  `static final int`
  `TYPE_STRING_ARRAY`
  Web protocol argument/return type
  `static final int`
  `TYPE_VOID`
  Web protocol argument/return type

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebServiceProxyCall()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static WebServiceProxyCall.WSDefinition`
  `defineWebService(String url, String serviceName, int returnType, int... argumentTypes)`
  Creates a webservice definition object which can be used to invoke the webservice.
  `static void`
  `invokeWebserviceASync(WebServiceProxyCall.WSDefinition def, Callback call, Object... arguments)`
  Invokes a web asynchronously and calls the callback on completion
  `static void`
  `invokeWebserviceASync(WebServiceProxyCall.WSDefinition def, SuccessCallback scall, FailureCallback fcall, Object... arguments)`
  Invokes a web asynchronously and calls the callback on completion
  `static Object`
  `invokeWebserviceSync(WebServiceProxyCall.WSDefinition def, Object... arguments)`
  Invokes a webservice synchronously and returns result

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Field Details

  - ### TYPE_VOID

    public static final int TYPE_VOID
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BYTE

    public static final int TYPE_BYTE
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_CHAR

    public static final int TYPE_CHAR
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_SHORT

    public static final int TYPE_SHORT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_INT

    public static final int TYPE_INT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_LONG

    public static final int TYPE_LONG
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_DOUBLE

    public static final int TYPE_DOUBLE
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_FLOAT

    public static final int TYPE_FLOAT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BOOLEAN

    public static final int TYPE_BOOLEAN
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BYTE_OBJECT

    public static final int TYPE_BYTE_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_CHARACTER_OBJECT

    public static final int TYPE_CHARACTER_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_SHORT_OBJECT

    public static final int TYPE_SHORT_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_INTEGER_OBJECT

    public static final int TYPE_INTEGER_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_LONG_OBJECT

    public static final int TYPE_LONG_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_DOUBLE_OBJECT

    public static final int TYPE_DOUBLE_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_FLOAT_OBJECT

    public static final int TYPE_FLOAT_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BOOLEAN_OBJECT

    public static final int TYPE_BOOLEAN_OBJECT
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_STRING

    public static final int TYPE_STRING
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BYTE_ARRAY

    public static final int TYPE_BYTE_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_CHAR_ARRAY

    public static final int TYPE_CHAR_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_SHORT_ARRAY

    public static final int TYPE_SHORT_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_INT_ARRAY

    public static final int TYPE_INT_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_LONG_ARRAY

    public static final int TYPE_LONG_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_DOUBLE_ARRAY

    public static final int TYPE_DOUBLE_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_FLOAT_ARRAY

    public static final int TYPE_FLOAT_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_BOOLEAN_ARRAY

    public static final int TYPE_BOOLEAN_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_STRING_ARRAY

    public static final int TYPE_STRING_ARRAY
    Web protocol argument/return type
    See Also:
      - Constant Field Values

  - ### TYPE_EXTERNALIABLE

    public static final int TYPE_EXTERNALIABLE
    Web protocol argument/return type
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### WebServiceProxyCall

    public WebServiceProxyCall()

- ## Method Details

  - ### invokeWebserviceSync

    public static Object invokeWebserviceSync(WebServiceProxyCall.WSDefinition def, Object... arguments) throws IOException

    Invokes a webservice synchronously and returns result

    ###### Parameters

    - `def`: definition of the webservice request

    - `arguments`: the arguments to the service

    ###### Returns

    the value of the sync call

    ###### Throws

    - `IOException`: an exception in case of a webservice fail
    Throws:
      `IOException`

  - ### invokeWebserviceASync

    public static void invokeWebserviceASync(WebServiceProxyCall.WSDefinition def, SuccessCallback scall, FailureCallback fcall, Object... arguments)

    Invokes a web asynchronously and calls the callback on completion

    ###### Parameters

    - `def`: definition of the webservice request

    - `scall`: the return value callback

    - `fcall`: the error callback

    - `arguments`: the arguments to the webservice

  - ### invokeWebserviceASync

    public static void invokeWebserviceASync(WebServiceProxyCall.WSDefinition def, Callback call, Object... arguments)

    Invokes a web asynchronously and calls the callback on completion

    ###### Parameters

    - `def`: definition of the webservice request

    - `call`: the return value containing an error callback or value

    - `arguments`: the arguments to the webservice

  - ### defineWebService

    public static WebServiceProxyCall.WSDefinition defineWebService(String url, String serviceName, int returnType, int... argumentTypes)

    Creates a webservice definition object which can be used to invoke the webservice.

    ###### Parameters

    - `url`: the url of the webservice

    - `serviceName`: the name of the service method

    - `returnType`: the return type for the webservice one of the TYPE_* constants

    - `argumentTypes`: the arguments for the webservice using the TYPE_* constants

    ###### Returns

    a WSDefinition object