Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JSR 172 - J2ME[tm] Web Services
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.microedition.xml.rpc
Class Operation

    java.lang.Object
      |
      +--javax.microedition.xml.rpc.Operation

public class Operation
extends java.lang.Object

The `javax.microedition.xml.rpc.Operation` class corresponds to a wsdl:operation defined for a target service endpoint.

Field Summary
`static java.lang.String` | `SOAPACTION_URI_PROPERTY` Standard property for SOAPAction.

Constructor Summary
`protected` | `Operation()`

Method Summary
`java.lang.Object` | `invoke(java.lang.Object inParams)` Invokes the wsdl:operation defined by this `Operation` and returns the result.
`static Operation` | `newInstance(QName name, Element input, Element output)` Returns an `Operation` instance corresponding to the operation that is being performed.
`static Operation` | `newInstance(QName name, Element input, Element output, FaultDetailHandler faultDetailHandler)` Returns an `Operation` instance corresponding to the operation that is being performed.
`void` | `setProperty(java.lang.String name, java.lang.String value)` Sets the name and value of a configuration property for this `Operation` instance.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SOAPACTION_URI_PROPERTY

    public static final java.lang.String SOAPACTION_URI_PROPERTY

  Standard property for SOAPAction. Indicates the SOAPAction URI.

  Type: `java.lang.String`

  See Also:
    Constant Field Values

Constructor Detail

### Operation

    protected Operation()

Method Detail

### newInstance

    public static Operation newInstance(QName name,
                                        Element input,
                                        Element output)

  Returns an `Operation` instance corresponding to the operation that is being performed.

  This method does not check the `input` and `output` parameters for correctness. If the types that these parameters describe are invalid or inconsistent with respect to the parameter values, any errors that the runtime detects will be reported when the operation is invoked.

  See section 8.2.2 and 8.2.3 of the J2ME Web Services 1.0 Specification details and examples.

  Parameters:
    `name` - the `QName` of the operation to be invoked. Generated stubs are required to set this parameter to the `QName` of the `wsdl:operation` being invoked. `Operation` implementations may ignore the the value of this parameter.
    `input` - the Element describing the input parameter to this operation. NULL indicates that the operation with zero input message parts is to be executed.
    `output` - the Element describing the return result to this operation. NULL indicates there is no return value.
  Returns:
    a new `Operation` with the given input and output Type characteristics

### newInstance

    public static Operation newInstance(QName name,
                                        Element input,
                                        Element output,
                                        FaultDetailHandler faultDetailHandler)

  Returns an `Operation` instance corresponding to the operation that is being performed. The `faultDetailHandler` parameter is passed to the runtime and used to map custom SOAP faults.

  This method does not check the `input` and `output` parameters for correctness. If the types that these parameters describe are invalid or inconsistent with respect to the parameter values, any errors that the runtime detects will be reported when the operation is invoked.

  See section 8.2.2 of the J2ME Web Services 1.0 Specification details and examples.

  Parameters:
    `name` - the `QName` of the operation to be invoked. Generated stubs are required to set this parameter to the `QName` of the `wsdl:operation` being invoked. `Operation` implementations may ignore the the value of this parameter.
    `input` - the Element describing the input parameter to this operation. NULL indicates that the operation with zero input message parts is to be executed.
    `output` - the Element describing the return result to this operation. NULL indicates there is no return value.
    `faultDetailHandler` - the FaultDetailHandler to be called to handle custom faults thrown by this `Operation`.
  Returns:
    a new `Operation` with the given input and output Type characteristics

### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.String value)
                     throws java.lang.IllegalArgumentException

  Sets the name and value of a configuration property for this `Operation` instance. If the `Operation` instance contains a value of the same property, the old value is replaced.

  Note that the `setProperty` method may not perform validity check on a configured property value. An example is the standard property for the target service endpoint address that is not checked for validity in the `setProperty` method. In this case, `Operation` configuration errors are detected at the remote method invocation.

  See section 8.2.1 of the J2ME Web Services 1.0 Specification for details and examples.

  Parameters:
    `name` - the name of the property to be set
    `value` - the value the property is to be set
  Throws:
    `java.lang.IllegalArgumentException` -
    - If an optional standard property name is specified, however the runtime implementation class does not support the configuration of this property.
    - If an invalid or unsupported property name is specified or if a value of mismatched property type is passed.
    - If there is any error in the configuration of a valid property.

### invoke

    public java.lang.Object invoke(java.lang.Object inParams)
                            throws JAXRPCException

  Invokes the wsdl:operation defined by this `Operation` and returns the result.

  The input parameters and return value are encoded such that

  - primitive types are mapped to the equivalent object wrapper, for example, `int` is mapped to `Integer`, `byte` to `Byte`.
  - arrays are an `Object[]` containing the array elements.
  - complex types are represented by an array of objects mapped according to the above rules.

  Any additional elements, beyond those described by the description passed to `Operation.newInstance`, are ignored. The runtime processes the `inParams`, constructs the return value, and maps `FaultDetailException` detail elements based on the description of the datatypes passed to `Operation.newInstance`.

  The `invoke` method does not alter the input parameter values (`inParams`) and constructs a new instance of any output parameters (the return value) for each invocation.

  The values of the properties of this `Operation` instance are not checked by the `invoke` method. Any errors caused by mis-configured or missing properties will be reported as the cause of `JAXRPCException`.

  See Sections 8.2.4, 8.2.5 and 8.2.6 of the J2ME Web Services 1.0 Specification for details and examples.

  Parameters:
    `inParams` - an `Object` representing the input parameter value(s) to this operation.
  Returns:
    a `Object` representing the output value(s) for this operation. Can be `null` if this operation returns no value.
  Throws:
    `JAXRPCException` -
    - if the runtime detects a type mismatch in input parameters, return value, or detail elemnts of a `FaultDetailException`
    - if properties required to invoke the operation, including `Operation.SOAPACTION_URI_PROPERTY`, `Stub.ENDPOINT_ADDRESS_PROPERTY`, and `Stub.USERNAME_PROPERTY`, `Stub.PASSWORD_PROPERTY`, if required by the service endpoint, have not been set, or have been misconfigured
    - if an error occurs while excuting the operation. Any exception corresponding to the error will be attached, as the cause, to the `JAXRPCException` and can be retrieved via the method `getCause`
  See Also:
    `Operation`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JSR 172 - J2ME[tm] Web Services
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a comment or suggestion Version 1.0 of J2ME Web Services Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved. Use is subject to license terms.