Top Description Fields Methods
javax.xml.rpc

public Interface Call

Imports
java.util.Iterator, .Map, .List, java.net.URL, javax.xml.namespace.QName

The javax.xml.rpc.Call interface provides support for the dynamic invocation of a service endpoint. 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.

Author
Rahul Sharma
Version
1.0

Field Summary

Modifier and TypeField and Description
public static final String
ENCODINGSTYLE_URI_PROPERTY

Standard property for encoding Style: Encoding style specified as a namespace URI.

public static final String
OPERATION_STYLE_PROPERTY

Standard property for operation style.

public static final String
PASSWORD_PROPERTY

Standard property: Password for authentication

Type: java.lang.String

public static final String
SESSION_MAINTAIN_PROPERTY

Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint.

public static final String
SOAPACTION_URI_PROPERTY

Standard property for SOAPAction.

public static final String
SOAPACTION_USE_PROPERTY

Standard property for SOAPAction.

public static final String
USERNAME_PROPERTY

Standard property: User name for authentication

Type: java.lang.String

Method Summary

Modifier and TypeMethod and Description
public void
addParameter(String
Name of the parameter
paramName
,
QName
XML type of the parameter
xmlType
,
ParameterMode
Mode of the parameter-whether ParameterMode.IN, ParameterMode.OUT, or ParameterMode.INOUT,
parameterMode
)

Adds a parameter type and mode for a specific operation.

public void
addParameter(String
Name of the parameter
paramName
,
QName
XML type of the parameter
xmlType
,
Class<T>
Java class of the parameter
javaType
,
ParameterMode
Mode of the parameter-whether ParameterMode.IN, OUT or INOUT
parameterMode
)

Adds a parameter type and mode for a specific operation.

public QName

Returns:

Qualified name of the operation
getOperationName
()

Gets the name of the operation to be invoked using this Call instance.

public Map<K, V>

Returns:

Map Output parameters for the last Call.invoke(). Empty Map is returned if there are no output parameters.
getOutputParams
()

Returns a Map of {name, value} for the output parameters of the last invoked operation.

public List<E>

Returns:

java.util.List Values for the output parameters. An empty List is returned if there are no output values.
getOutputValues
()

Returns a List values for the output parameters of the last invoked operation.

public QName

Returns:

Returns XML type for the specified parameter
getParameterTypeByName
(String
Name of the parameter
paramName
)

Gets the XML type of a parameter by name

public QName

Returns:

Qualified name of the port type
getPortTypeName
()

Gets the qualified name of the port type.

public Object

Returns:

Value of the named property
getProperty
(String
Name of the property
name
)

Gets the value of a named property.

public Iterator<E>

Returns:

Iterator for the property names
getPropertyNames
()

Gets the names of configurable properties supported by this Call object.

public QName

Returns:

Returns the XML type for the return value
getReturnType
()

Gets the return type for a specific operation

public String

Returns:

Address of the target service endpoint as an URI
getTargetEndpointAddress
()

Gets the address of a target service endpoint.

public Object

Returns:

Returns the return value or null
invoke
(Object[]
Object[]--Parameters for this invocation. This includes only the input params
inputParams
)

Invokes a specific operation using a synchronous request-response interaction mode.

public Object

Returns:

Return value or null
invoke
(QName
QName of the operation
operationName
,
Object[]
Object[]--Parameters for this invocation. This includes only the input params.
inputParams
)

Invokes a specific operation using a synchronous request-response interaction mode.

public void
invokeOneWay(Object[]
Object[]--Parameters for this invocation. This includes only the input params.
inputParams
)

Invokes a remote method using the one-way interaction mode.

public boolean

Returns:

Returns true if the Call implementation class requires addParameter and setReturnType to be invoked in the client code for the specified operation. This method returns false otherwise.
isParameterAndReturnSpecRequired
(QName
Qualified name of the operation
operationName
)

Indicates whether addParameter and setReturnType methods are to be invoked to specify the parameter and return type specification for a specific operation.

public void
removeAllParameters()

Removes all specified parameters from this Call instance.

public void
removeProperty(String
Name of the property
name
)

Removes a named property.

public void
setOperationName(QName
QName of the operation to be invoked using the Call instance
operationName
)

Sets the name of the operation to be invoked using this Call instance.

public void
setPortTypeName(QName
Qualified name of the port type
portType
)

Sets the qualified name of the port type.

public void
setProperty(String
Name of the property
name
,
Object
Value of the property
value
)

Sets the value for a named property.

public void
setReturnType(QName
XML data type of the return value
xmlType
)

Sets the return type for a specific operation.

public void
setReturnType(QName
XML data type of the return value
xmlType
,
Class<T>
Java Class of the return value
javaType
)

Sets the return type for a specific operation.

public void
setTargetEndpointAddress(String
Address of the target service endpoint; specified as an URI
address
)

Sets the address of the target service endpoint.

Field Detail

ENCODINGSTYLE_URI_PROPERTYback to summary
public static final String ENCODINGSTYLE_URI_PROPERTY

Standard property for encoding Style: Encoding style specified as a namespace URI. The default value is the SOAP 1.1 encoding http://schemas.xmlsoap.org/soap/encoding/

Type: java.lang.String

OPERATION_STYLE_PROPERTYback to summary
public static final String OPERATION_STYLE_PROPERTY

Standard property for operation style. This property is set to "rpc" if the operation style is rpc; "document" if the operation style is document.

Type: java.lang.String

PASSWORD_PROPERTYback to summary
public static final String PASSWORD_PROPERTY

Standard property: Password for authentication

Type: java.lang.String

SESSION_MAINTAIN_PROPERTYback to summary
public static final String SESSION_MAINTAIN_PROPERTY

Standard property: This boolean property is used by a service client to indicate whether or not it wants to participate in a session with a service endpoint. If this property is set to true, the service client indicates that it wants the session to be maintained. If set to false, the session is not maintained. The default value for this property is false.

Type: java.lang.Boolean

SOAPACTION_URI_PROPERTYback to summary
public static final String SOAPACTION_URI_PROPERTY

Standard property for SOAPAction. Indicates the SOAPAction URI if the javax.xml.rpc.soap.http.soapaction.use property is set to true.

Type: java.lang.String

SOAPACTION_USE_PROPERTYback to summary
public static final String SOAPACTION_USE_PROPERTY

Standard property for SOAPAction. This boolean property indicates whether or not SOAPAction is to be used. The default value of this property is false indicating that the SOAPAction is not used.

Type: java.lang.Boolean

USERNAME_PROPERTYback to summary
public static final String USERNAME_PROPERTY

Standard property: User name for authentication

Type: java.lang.String

Method Detail

addParameterback to summary
public void addParameter(String paramName, QName xmlType, ParameterMode parameterMode)

Adds a parameter type and mode for a specific operation. Note that the client code may not call any addParameter and setReturnType methods before calling the invoke method. In this case, the Call implementation class determines the parameter types by using reflection on parameters, using the WSDL description and configured type mapping registry.

Parameters
paramName:String

Name of the parameter

xmlType:QName

XML type of the parameter

parameterMode:ParameterMode

Mode of the parameter-whether ParameterMode.IN, ParameterMode.OUT, or ParameterMode.INOUT,

Exceptions
JAXRPCException:
This exception may be thrown if the method isParameterAndReturnSpecRequired returns false for this operation.
IllegalArgumentException:
If any illegal parameter name or XML type is specified
See Also
javax.xml.rpc.Call#isParameterAndReturnSpecRequired
addParameterback to summary
public void addParameter(String paramName, QName xmlType, Class<T> javaType, ParameterMode parameterMode)

Adds a parameter type and mode for a specific operation. This method is used to specify the Java type for either OUT or INOUT parameters.

Parameters
paramName:String

Name of the parameter

xmlType:QName

XML type of the parameter

javaType:Class<T>

Java class of the parameter

parameterMode:ParameterMode

Mode of the parameter-whether ParameterMode.IN, OUT or INOUT

Exceptions
JAXRPCException:
  • This exception may be thrown if this method is invoked when the method isParameterAndReturnSpecRequired returns false.
  • If specified XML type and Java type mapping is not valid. For example, TypeMappingRegistry has no serializers for this mapping.
IllegalArgumentException:
If any illegal parameter name or XML type is specified
UnsupportedOperationException:
If this method is not supported
See Also
javax.xml.rpc.Call#isParameterAndReturnSpecRequired
getOperationNameback to summary
public QName getOperationName()

Gets the name of the operation to be invoked using this Call instance.

Returns:QName

Qualified name of the operation

getOutputParamsback to summary
public Map<K, V> getOutputParams()

Returns a Map of {name, value} for the output parameters of the last invoked operation. The parameter names in the returned Map are of type java.lang.String.

Returns:Map<K, V>

Map Output parameters for the last Call.invoke(). Empty Map is returned if there are no output parameters.

Exceptions
JAXRPCException:
If this method is invoked for a one-way operation or is invoked before any invoke method has been called.
getOutputValuesback to summary
public List<E> getOutputValues()

Returns a List values for the output parameters of the last invoked operation.

Returns:List<E>

java.util.List Values for the output parameters. An empty List is returned if there are no output values.

Exceptions
JAXRPCException:
If this method is invoked for a one-way operation or is invoked before any invoke method has been called.
getParameterTypeByNameback to summary
public QName getParameterTypeByName(String paramName)

Gets the XML type of a parameter by name

Parameters
paramName:String

Name of the parameter

Returns:QName

Returns XML type for the specified parameter

getPortTypeNameback to summary
public QName getPortTypeName()

Gets the qualified name of the port type.

Returns:QName

Qualified name of the port type

getPropertyback to summary
public Object getProperty(String name)

Gets the value of a named property.

Parameters
name:String

Name of the property

Returns:Object

Value of the named property

Exceptions
JAXRPCException:
if an invalid or unsupported property name is passed.
getPropertyNamesback to summary
public Iterator<E> getPropertyNames()

Gets the names of configurable properties supported by this Call object.

Returns:Iterator<E>

Iterator for the property names

getReturnTypeback to summary
public QName getReturnType()

Gets the return type for a specific operation

Returns:QName

Returns the XML type for the return value

getTargetEndpointAddressback to summary
public String getTargetEndpointAddress()

Gets the address of a target service endpoint.

Returns:String

Address of the target service endpoint as an URI

invokeback to summary
public Object invoke(Object[] inputParams) throws RemoteException

Invokes a specific operation using a synchronous request-response interaction mode.

Parameters
inputParams:Object[]

Object[]--Parameters for this invocation. This includes only the input params

Returns:Object

Returns the return value or null

Exceptions
RemoteException:
if there is any error in the remote method invocation
SOAPFaultException:
Indicates a SOAP fault
JAXRPCException:
  • If there is an error in the configuration of the Call object
  • If inputParams do not match the required parameter set (as specified through the addParameter invocations or in the corresponding WSDL)
  • If parameters and return type are incorrectly specified
invokeback to summary
public Object invoke(QName operationName, Object[] inputParams) throws RemoteException

Invokes a specific operation using a synchronous request-response interaction mode.

Parameters
operationName:QName

QName of the operation

inputParams:Object[]

Object[]--Parameters for this invocation. This includes only the input params.

Returns:Object

Return value or null

Exceptions
RemoteException:
if there is any error in the remote method invocation.
SOAPFaultException:
Indicates a SOAP fault
JAXRPCException:
  • If there is an error in the configuration of the Call object
  • If inputParams do not match the required parameter set (as specified through the addParameter invocations or in the corresponding WSDL)
  • If parameters and return type are incorrectly specified
invokeOneWayback to summary
public void invokeOneWay(Object[] inputParams)

Invokes a remote method using the one-way interaction mode. The client thread does not normally block waiting for the completion of the server processing for this remote method invocation. When the protocol in use is SOAP/HTTP, this method should block until an HTTP response code has been received or an error occurs. This method must not throw any remote exceptions. This method may throw a JAXRPCException during the processing of the one-way remote call.

Parameters
inputParams:Object[]

Object[]--Parameters for this invocation. This includes only the input params.

Exceptions
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
isParameterAndReturnSpecRequiredback to summary
public boolean isParameterAndReturnSpecRequired(QName operationName)

Indicates whether addParameter and setReturnType methods are to be invoked to specify the parameter and return type specification for a specific operation.

Parameters
operationName:QName

Qualified name of the operation

Returns:boolean

Returns true if the Call implementation class requires addParameter and setReturnType to be invoked in the client code for the specified operation. This method returns false otherwise.

Exceptions
IllegalArgumentException:
If invalid operation name is specified
removeAllParametersback to summary
public void removeAllParameters()

Removes all specified parameters from this Call instance. Note that this method removes only the parameters and not the return type. The setReturnType(null) is used to remove the return type.

Exceptions
JAXRPCException:
This exception may be thrown If this method is called when the method isParameterAndReturnSpecRequired returns false for this Call's operation.
removePropertyback to summary
public void removeProperty(String name)

Removes a named property.

Parameters
name:String

Name of the property

Exceptions
JAXRPCException:
if an invalid or unsupported property name is passed.
setOperationNameback to summary
public void setOperationName(QName operationName)

Sets the name of the operation to be invoked using this Call instance.

Parameters
operationName:QName

QName of the operation to be invoked using the Call instance

setPortTypeNameback to summary
public void setPortTypeName(QName portType)

Sets the qualified name of the port type.

Parameters
portType:QName

Qualified name of the port type

setPropertyback to summary
public void setProperty(String name, Object value)

Sets the value for a named property. Jakarta XML RPC specification specifies a standard set of properties that may be passed to the Call.setProperty method.

Parameters
name:String

Name of the property

value:Object

Value of the property

Exceptions
JAXRPCException:
  • If an optional standard property name is specified, however this Call 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.
setReturnTypeback to summary
public void setReturnType(QName xmlType)

Sets the return type for a specific operation. Invoking setReturnType(null) removes the return type for this Call object.

Parameters
xmlType:QName

XML data type of the return value

Exceptions
JAXRPCException:
This exception may be thrown when the method isParameterAndReturnSpecRequired returns false.
IllegalArgumentException:
If an illegal XML type is specified
setReturnTypeback to summary
public void setReturnType(QName xmlType, Class<T> javaType)

Sets the return type for a specific operation.

Parameters
xmlType:QName

XML data type of the return value

javaType:Class<T>

Java Class of the return value

Exceptions
JAXRPCException:
  • This exception may be thrown if this method is invoked when the method isParameterAndReturnSpecRequired returns false.
  • If XML type and Java type cannot be mapped using the standard type mapping or TypeMapping registry
UnsupportedOperationException:
If this method is not supported
IllegalArgumentException:
If an illegal XML type is specified
setTargetEndpointAddressback to summary
public void setTargetEndpointAddress(String address)

Sets the address of the target service endpoint. This address must correspond to the transport specified in the binding for this Call instance.

Parameters
address:String

Address of the target service endpoint; specified as an URI