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.
ENCODINGSTYLE_URI_PROPERTY
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_PROPERTY
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_PROPERTY
public static final String PASSWORD_PROPERTY
Standard property: Password for authentication
Type:
java.lang.String
SESSION_MAINTAIN_PROPERTY
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_PROPERTY
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_PROPERTY
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_PROPERTY
public static final String USERNAME_PROPERTY
Standard property: User name for authentication
Type:
java.lang.String
addParameter
public void addParameter(String paramName,
QName xmlType,
Class 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.
paramName
- Name of the parameterxmlType
- XML datatype of the parameterjavaType
- The Java class of the parameterparameterMode
- Mode of the parameter-whether
ParameterMode.IN, OUT or INOUT
addParameter
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.
paramName
- Name of the parameterxmlType
- XML datatype of the parameterparameterMode
- Mode of the parameter-whether
ParameterMode.IN
,
ParameterMode.OUT
,
or ParameterMode.INOUT
getOperationName
public QName getOperationName()
Gets the name of the operation to be invoked using this Call instance.
- Qualified name of the operation
getOutputParams
public Map 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
.
- Map Output parameters for the last
Call.invoke()
.
Empty Map
is returned if there are no output
parameters.
getOutputValues
public List getOutputValues()
Returns a List
values for the output parameters
of the last invoked operation.
- java.util.List Values for the output parameters. An
empty
List
is returned if there are
no output values.
getParameterTypeByName
public QName getParameterTypeByName(String paramName)
Gets the XML type of a parameter by name.
paramName
- name of the parameter
- Returns XML type for the specified parameter
getPortTypeName
public QName getPortTypeName()
Gets the qualified name of the port type.
- Qualified name of the port type
getProperty
public Object getProperty(String name)
Gets the value of a named property.
name
- Name of the property
- Value of the named property
getPropertyNames
public Iterator getPropertyNames()
Gets the names of configurable properties supported by
this Call
object.
- Iterator for the property names
getReturnType
public QName getReturnType()
Gets the return type for a specific operation.
- the XML type for the return value
getTargetEndpointAddress
public String getTargetEndpointAddress()
Gets the address of a target service endpoint.
- Endpoint address of the target service port as an URI
invoke
public Object invoke(Object[] inputParams)
throws java.rmi.RemoteException
Invokes a specific operation using a synchronous request-response
interaction mode.
inputParams
- Object[]--Parameters for this invocation. This
includes only the input params
- Returns the return value or
null
invoke
public Object invoke(QName operationName,
Object[] inputParams)
throws java.rmi.RemoteException
Invokes a specific operation using a synchronous request-response
interaction mode.
operationName
- QName of the operationinputParams
- Object[]--Parameters for this invocation. This
includes only the input params.
invokeOneWay
public void invokeOneWay(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.
params
- Object[]--Parameters for this invocation. This
includes only the input params.
isParameterAndReturnSpecRequired
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.
operationName
- Qualified name of the operation
- 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.
removeAllParameters
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.
removeProperty
public void removeProperty(String name)
Removes a named property.
name
- Name of the property
setOperationName
public void setOperationName(QName operationName)
Sets the name of the operation to be invoked using this
Call
instance.
operationName
- QName of the operation to be
invoked using the Call instance
setPortTypeName
public void setPortTypeName(QName portType)
Sets the qualified name of the port type.
portType
- Qualified name of the port type
setProperty
public void setProperty(String name,
Object value)
Sets the value for a named property. JAX-RPC specification
specifies a standard set of properties that may be passed
to the Call.setProperty
method.
name
- Name of the propertyvalue
- Value of the property
setReturnType
public void setReturnType(QName xmlType)
Sets the return type for a specific operation. Invoking
setReturnType(null)
removes the return
type for this Call object.
xmlType
- XML data type of the return value
setReturnType
public void setReturnType(QName xmlType,
Class javaType)
Sets the return type for a specific operation.
xmlType
- XML data type of the return valuejavaType
- Java class of the return value
setTargetEndpointAddress
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.
address
- Address of the target service endpoint;
specified as an URI