javax.xml.rpc
Interface Call

All Known Implementing Classes:
Call

public interface Call

The javax.xml.rpc.Call interface provides support for dynamic invocation of a service port. The javax.xml.rpc.Service interface acts as a factory for the creation of Call instances. Once a Call instance is created, various setter and getter methods may be used to configure this Call instance. The properties configured on a Call instance include the following:

Version:
0.1

Method Summary
 void addParameter(java.lang.String paramName, QName paramType, ParameterMode parameterMode)
          Adds a parameter type and mode for a specific operation.
 QName getOperationName()
          Gets the name of the operation to be invoked using this Call instance.
 java.util.Map getOutputParams()
          This method returns a java.util.Map of {name, value} for the PARAM_MODE_OUT and PARAM_MODE_INOUT parameters for the last invoked operation.
 QName getParameterTypeByName(java.lang.String paramName)
          Given a parameter name, return the QName of its type.
 QName getPortTypeName()
          Gets the qualified name of the port type.
 java.lang.Object getProperty(java.lang.String name)
          Gets the value of a named property.
 QName getReturnType()
          Get the QName of the return type.
 java.net.URL getTargetEndpointAddress()
          Gets the endpoint address of a target service port.
 java.lang.Object invoke(java.lang.Object[] params)
          Invokes a specific operation using a synchronous request-response interaction mode.
 java.lang.Object invoke(QName operationName, java.lang.Object[] params)
          Invokes a specific operation using a synchronous request-response interaction mode.
 void invokeOneWay(java.lang.Object[] params)
          Invokes a remote method using the one-way interaction mode.
 boolean isParameterAndReturnSpecRequired()
          Is the caller required to provide the parameter and return type specification? If true, then addParameter and setReturnType MUST be called to provide the meta data.
 void removeAllParameters()
          Removes all specified parameters from this Call instance.
 void removeProperty(java.lang.String name)
          Removes a named property.
 void setOperationName(QName operationName)
          Sets the name of the operation to be invoked using this Call instance.
 void setPortTypeName(QName portType)
          Sets the qualified name of the port type.
 void setProperty(java.lang.String name, java.lang.Object value)
          Sets the value for a named property.
 void setReturnType(QName xmlType)
          Sets the return type for a specific operation.
 void setTargetEndpointAddress(java.net.URL address)
          Sets the endpoint address of the target service port.
 

Method Detail

isParameterAndReturnSpecRequired

public boolean isParameterAndReturnSpecRequired()
Is the caller required to provide the parameter and return type specification? If true, then addParameter and setReturnType MUST be called to provide the meta data. If false, then addParameter and setReturnType CANNOT be called because the Call object already has the metadata and the user is not allowed to mess with it. These methods throw JAXRPCException if this method returns false.

addParameter

public void addParameter(java.lang.String paramName,
                         QName paramType,
                         ParameterMode parameterMode)
Adds a parameter type and mode for a specific operation. Note that the client code is not required to call any addParameter and setReturnType methods before calling the invoke method. A Call implementation class can determine the parameter types by using the Java reflection and configured type mapping registry.
Parameters:
paramName - - Name of the parameter
paramType - - XML datatype of the parameter
parameterMode - - Mode of the parameter-whether PARAM_MODE_IN, PARAM_MODE_OUT or PARAM_MODE_INOUT
Throws:
JAXRPCException - - if isParameterAndReturnSpecRequired returns false, then addParameter will throw JAXRPCException.

getParameterTypeByName

public QName getParameterTypeByName(java.lang.String paramName)
Given a parameter name, return the QName of its type. If the parameter doesn't exist, this method returns null.
Parameters:
paramName - - Name of the parameter.

setReturnType

public void setReturnType(QName xmlType)
Sets the return type for a specific operation.
Parameters:
xmlType - - QName of the data type of the return value
Throws:
JAXRPCException - - if isParameterAndReturnSpecRequired returns false, then setReturnType will throw JAXRPCException.

getReturnType

public QName getReturnType()
Get the QName of the return type.

removeAllParameters

public void removeAllParameters()
Removes all specified parameters from this Call instance.
Throws:
JAXRPCException - - if isParameterAndReturnSpecRequired returns false, then removeAllParameters will throw JAXRPCException.

getOperationName

public QName getOperationName()
Gets the name of the operation to be invoked using this Call instance.
Returns:
QName of the operation

setOperationName

public void setOperationName(QName operationName)
Sets the name of the operation to be invoked using this Call instance.
Parameters:
operationName - - QName of the operation to be invoked using the Call instance

getPortTypeName

public QName getPortTypeName()
Gets the qualified name of the port type.
Returns:
Qualified name of the port type

setPortTypeName

public void setPortTypeName(QName portType)
Sets the qualified name of the port type.
Parameters:
portType - - Qualified name of the port type

setTargetEndpointAddress

public void setTargetEndpointAddress(java.net.URL address)
Sets the endpoint address of the target service port. This address must correspond to the transport specified in the binding for this Call instance.
Parameters:
address - - Endpoint address of the target service port; specified as URI

getTargetEndpointAddress

public java.net.URL getTargetEndpointAddress()
Gets the endpoint address of a target service port.
Returns:
Endpoint address of the target service port as an URI

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Sets the value for a named property. JAX-RPC 1.0 specification specifies a standard set of properties that may be passed to the Call.setProperty method. The properties include:
Parameters:
name - - Name of the property
value - - Value of the property

getProperty

public java.lang.Object getProperty(java.lang.String name)
Gets the value of a named property.
Parameters:
name - - Name of the property
Returns:
Value of the named property

removeProperty

public void removeProperty(java.lang.String name)
Removes a named property.
Parameters:
name - - Name of the property

invoke

public java.lang.Object invoke(QName operationName,
                               java.lang.Object[] params)
                        throws java.rmi.RemoteException
Invokes a specific operation using a synchronous request-response interaction mode. The invoke method takes as parameters the object values corresponding to these defined parameter types. Implementation of the invoke method must check whether the passed parameter values correspond to the number, order and types of parameters specified in the corresponding operation specification.
Parameters:
operationName - - Name of the operation to invoke
params - - Parameters for this invocation
Returns:
the value returned from the other end.
Throws:
java.rmi.RemoteException - - if there is any error in the remote method invocation or if the Call object is not configured properly.

invoke

public java.lang.Object invoke(java.lang.Object[] params)
                        throws java.rmi.RemoteException
Invokes a specific operation using a synchronous request-response interaction mode. The invoke method takes as parameters the object values corresponding to these defined parameter types. Implementation of the invoke method must check whether the passed parameter values correspond to the number, order and types of parameters specified in the corresponding operation specification.
Parameters:
params - - Parameters for this invocation
Returns:
the value returned from the other end.
Throws:
java.rmi.RemoteException - - if there is any error in the remote method invocation or if the Call object is not configured properly.

invokeOneWay

public void invokeOneWay(java.lang.Object[] params)
Invokes a remote method using the one-way interaction mode. The client thread does not block waiting for the completion of the server processing for this remote method invocation. This method must not throw any remote exceptions. This method may throw a JAXRPCException during the processing of the one-way remote call.
Parameters:
params - - Parameters for this invocation
Throws:
JAXRPCException - - if there is an error in the configuration of the Call object (example: a non-void return type has been incorrectly specified for the one-way call) or if there is any error during the invocation of the one-way remote call

getOutputParams

public java.util.Map getOutputParams()
This method returns a java.util.Map of {name, value} for the PARAM_MODE_OUT and PARAM_MODE_INOUT parameters for the last invoked operation. If there are no output parameters, this method returns an empty map. The parameter names in the returned Map are of type String. The type of a value depends on the mapping between the Java and XML types.
Throws:
JAXRPCException - - if this method is invoked on a one-way operation or if it is invoked before any invoke method has been called.


Copyright © 2001 Apache XML Project. All Rights Reserved.