|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.rpc Interface Call
public interface Call
javax.xml.rpc.Call
接口提供对服务端点动态调用的支持。javax.xml.rpc.Service
接口充当创建 Call
实例的工厂。
创建了 Call
实例后,就可以使用各种设置方法和获取方法配置此 Call
实例。
version | 1.0 |
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.
- Version:
- 1.0
- Author:
- Rahul Sharma
Field Summary | |
---|---|
static String |
ENCODINGSTYLE_URI_PROPERTY
Standard property for encoding Style: Encoding style specified as a namespace URI. |
static String |
OPERATION_STYLE_PROPERTY
Standard property for operation style. |
static String |
PASSWORD_PROPERTY
Standard property: Password for authentication Type: java.lang.String |
static 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. |
static String |
SOAPACTION_URI_PROPERTY
Standard property for SOAPAction. |
static String |
SOAPACTION_USE_PROPERTY
Standard property for SOAPAction. |
static String |
USERNAME_PROPERTY
Standard property: User name for authentication Type: java.lang.String |
Method Summary | |
---|---|
void |
addParameter(String paramName,
QName xmlType,
Class javaType,
ParameterMode parameterMode)
Adds a parameter type and mode for a specific operation. |
void |
addParameter(String paramName,
QName xmlType,
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. |
Map |
getOutputParams()
Returns a Map of {name, value} for the output parameters of
the last invoked operation. |
List |
getOutputValues()
Returns a List values for the output parameters
of the last invoked operation. |
QName |
getParameterTypeByName(String paramName)
Gets the XML type of a parameter by name |
QName |
getPortTypeName()
Gets the qualified name of the port type. |
Object |
getProperty(String name)
Gets the value of a named property. |
Iterator |
getPropertyNames()
Gets the names of configurable properties supported by this Call object. |
QName |
getReturnType()
Gets the return type for a specific operation |
String |
getTargetEndpointAddress()
Gets the address of a target service endpoint. |
Object |
invoke(Object[] inputParams)
Invokes a specific operation using a synchronous request-response interaction mode. |
Object |
invoke(QName operationName,
Object[] inputParams)
Invokes a specific operation using a synchronous request-response interaction mode. |
void |
invokeOneWay(Object[] inputParams)
Invokes a remote method using the one-way interaction mode. |
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. |
void |
removeAllParameters()
Removes all specified parameters from this Call instance. |
void |
removeProperty(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(String name,
Object value)
Sets the value for a named property. |
void |
setReturnType(QName xmlType)
Sets the return type for a specific operation. |
void |
setReturnType(QName xmlType,
Class javaType)
Sets the return type for a specific operation. |
void |
setTargetEndpointAddress(String address)
Sets the address of the target service endpoint. |
Field Detail |
---|
英文文档:
USERNAME_PROPERTY
static final String USERNAME_PROPERTY
- Standard property: User name for authentication
Type:
java.lang.String
- See Also:
- Constant Field Values
英文文档:
PASSWORD_PROPERTY
static final String PASSWORD_PROPERTY
- Standard property: Password for authentication
Type:
java.lang.String
- See Also:
- Constant Field Values
英文文档:
OPERATION_STYLE_PROPERTY
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
- See Also:
- Constant Field Values
英文文档:
SOAPACTION_USE_PROPERTY
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
- See Also:
- Constant Field Values
英文文档:
SOAPACTION_URI_PROPERTY
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 totrue
.Type:
java.lang.String
- See Also:
- Constant Field Values
英文文档:
ENCODINGSTYLE_URI_PROPERTY
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
- See Also:
- Constant Field Values
英文文档:
SESSION_MAINTAIN_PROPERTY
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
- See Also:
- Constant Field Values
Method Detail |
---|
public boolean
isParameterAndReturnSpecRequired(javax.xml.namespace.QName operationName)
指示是否调用 addParameter
和 setReturnType
方法指定参数,并为特定操作返回类型规范。
operationName | 操作的限定名称 |
return | 如果 Call 实现类要求为指定的操作在客户端代码中调用 addParameter 和 setReturnType,则返回 true。否则此方法返回 false。 |
Throws | IllegalArgumentException: 如果指定了无效的操作名称 |
isParameterAndReturnSpecRequired
boolean isParameterAndReturnSpecRequired(QName operationName)
- Indicates whether
addParameter
andsetReturnType
methods are to be invoked to specify the parameter and return type specification for a specific operation. - Parameters:
operationName
- Qualified name of the operation- 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.
- Throws:
IllegalArgumentException
- If invalid operation name is specified
public void
addParameter(String paramName, javax.xml.namespace.QName xmlType, ParameterMode parameterMode)
为特定操作添加参数类型和模式。注意,在调用 invoke
方法之前,客户端代码不能调用任何 addParameter
和 setReturnType
方法。在这种情况下,Call 实现类通过对参数进行反射(使用 WSDL 描述和配置的类型映射注册表)来确定参数类型。
paramName | 参数的名称 |
xmlType | 参数的 XML 类型 |
parameterMode |
参数的模式,ParameterMode.IN 、ParameterMode.OUT 或者 ParameterMode.INOUT |
Throws | javax.xml.rpc.JAXRPCException::
如果方法 isParameterAndReturnSpecRequired 对此操作返回 false ,则可能抛出此异常。 |
Throws | IllegalArgumentException: 如果指定了任何非法参数名称或 XML 类型 |
See also | isParameterAndReturnSpecRequired |
addParameter
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
andsetReturnType
methods before calling theinvoke
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
- Name of the parameterxmlType
- XML type of the parameterparameterMode
- Mode of the parameter-whetherParameterMode.IN
,ParameterMode.OUT
, orParameterMode.INOUT
,- Throws:
javax.xml.rpc.JAXRPCException:
- This exception may be thrown if the methodisParameterAndReturnSpecRequired
returnsfalse
for this operation.IllegalArgumentException
- If any illegal parameter name or XML type is specified- See Also:
isParameterAndReturnSpecRequired(javax.xml.namespace.QName)
public void
addParameter(String paramName, javax.xml.namespace.QName xmlType, Class<T> javaType, ParameterMode parameterMode)
为特定操作添加参数类型和模式。此方法用于指定 OUT 或 INOUT 参数的 Java 类型。
paramName | 参数的名称 |
xmlType | 参数的 XML 类型 |
javaType | 参数的 Java 类 |
parameterMode | 参数的模式,ParameterMode.IN、OUT 或者 INOUT |
Throws | JAXRPCException:
|
Throws | IllegalArgumentException: 如果指定了任何非法参数名称或 XML 类型 |
Throws | UnsupportedOperationException: 如果此方法不受支持 |
See also | isParameterAndReturnSpecRequired |
addParameter
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.
- Parameters:
paramName
- Name of the parameterxmlType
- XML type of the parameterjavaType
- Java class of the parameterparameterMode
- Mode of the parameter-whether ParameterMode.IN, OUT or INOUT- Throws:
JAXRPCException
-- This exception may be thrown if this method is
invoked when the method
isParameterAndReturnSpecRequired
returnsfalse
. - If specified XML type and Java type mapping
is not valid. For example,
TypeMappingRegistry
has no serializers for this mapping.
- This exception may be thrown if this method is
invoked when the method
IllegalArgumentException
- If any illegal parameter name or XML type is specifiedUnsupportedOperationException
- If this method is not supported- See Also:
isParameterAndReturnSpecRequired(javax.xml.namespace.QName)
public javax.xml.namespace.QName
getParameterTypeByName(String paramName)
根据名称获取参数的 XML 类型。
paramName | 参数的名称 |
return | 返回指定参数的 XML 类型 |
getParameterTypeByName
QName getParameterTypeByName(String paramName)
- Gets the XML type of a parameter by name
- Parameters:
paramName
- Name of the parameter- Returns:
- Returns XML type for the specified parameter
public void
setReturnType(javax.xml.namespace.QName xmlType)
设置特定操作的返回类型。调用 setReturnType(null)
移除此 Call 对象的返回类型。
xmlType | 返回值的 XML 数据类型 |
Throws | JAXRPCException:
在方法 isParameterAndReturnSpecRequired 返回 false 时抛出此异常。 |
Throws | IllegalArgumentException: 如果指定了非法的 XML 类型 |
setReturnType
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
- XML data type of the return value- Throws:
JAXRPCException
- This exception may be thrown when the methodisParameterAndReturnSpecRequired
returnsfalse
.IllegalArgumentException
- If an illegal XML type is specified
public void
setReturnType(javax.xml.namespace.QName xmlType, Class<T> javaType)
设置特定操作的返回类型。
type | 返回值的 XML 数据类型 |
javaType | 返回值的 Java 类 |
Throws | JAXRPCException:
|
Throws | UnsupportedOperationException: 如果此方法不受支持 |
Throws | IllegalArgumentException: 如果指定了非法的 XML 类型 |
setReturnType
void setReturnType(QName xmlType, Class javaType)
- Sets the return type for a specific operation.
- Parameters:
type
- XML data type of the return valuejavaType
- Java Class of the return value- Throws:
JAXRPCException
-- This exception may be thrown if this method is
invoked when the method
isParameterAndReturnSpecRequired
returnsfalse
. - If XML type and Java type cannot be mapped using the standard type mapping or TypeMapping registry
- This exception may be thrown if this method is
invoked when the method
UnsupportedOperationException
- If this method is not supportedIllegalArgumentException
- If an illegal XML type is specified
public javax.xml.namespace.QName
getReturnType()
获取特定操作的返回类型。
return | 返回返回值的 XML 类型 |
getReturnType
QName getReturnType()
- Gets the return type for a specific operation
- Returns:
- Returns the XML type for the return value
public void
removeAllParameters()
从此 Call
实例中移除所有指定参数。注意,此方法只移除参数,不移除返回类型。setReturnType(null)
用于移除返回类型。
Throws | JAXRPCException:
如果在方法 isParameterAndReturnSpecRequired 为此 Call 操作返回 false 时调用此方法,则抛出此异常。 |
removeAllParameters
void removeAllParameters()
- Removes all specified parameters from this
Call
instance. Note that this method removes only the parameters and not the return type. ThesetReturnType(null)
is used to remove the return type. - Throws:
JAXRPCException
- This exception may be thrown If this method is called when the methodisParameterAndReturnSpecRequired
returnsfalse
for this Call's operation.
public javax.xml.namespace.QName
getOperationName()
获取将使用此 Call
实例调用的操作的名称。
return | 操作的限定名称 |
getOperationName
QName getOperationName()
- Gets the name of the operation to be invoked using this
Call
instance. - Returns:
- Qualified name of the operation
public void
setOperationName(javax.xml.namespace.QName operationName)
设置将使用此 Call
实例调用的操作的名称。
operationName | 将使用 Call 实例调用的操作的 QName |
setOperationName
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
public javax.xml.namespace.QName
getPortTypeName()
获取端口类型的限定名称。
return | 端口类型的限定名称 |
getPortTypeName
QName getPortTypeName()
- Gets the qualified name of the port type.
- Returns:
- Qualified name of the port type
public void
setPortTypeName(javax.xml.namespace.QName portType)
设置端口类型的限定名称。
portType | 端口类型的限定名称 |
setPortTypeName
void setPortTypeName(QName portType)
- Sets the qualified name of the port type.
- Parameters:
portType
- Qualified name of the port type
public void
setTargetEndpointAddress(String address)
设置目标服务端点的地址。此地址必须对应于绑定中为此 Call
实例指定的传输。
address | 目标服务端点的地址,以 URI 的形式指定 |
setTargetEndpointAddress
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
- Address of the target service endpoint; specified as an URI
public String
getTargetEndpointAddress()
获取目标服务端点的地址。
return | 返回 URI 形式的目标服务端点地址 |
getTargetEndpointAddress
String getTargetEndpointAddress()
- Gets the address of a target service endpoint.
- Returns:
- Address of the target service endpoint as an URI
public void
setProperty(String name, Object value)
设置指定属性的值。JAX-RPC 规范指定了一个标准属性集,可以将它传递给 Call.setProperty
方法。
name | 属性的名称 |
value | 属性的值 |
Throws | JAXRPCException:
|
setProperty
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. - Parameters:
name
- Name of the propertyvalue
- Value of the property- Throws:
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.
- If an optional standard property name is
specified, however this
public Object
getProperty(String name)
获取指定属性的值。
name | 属性的名称 |
return | 指定属性的值 |
Throws | JAXRPCException: 如果传递无效或不受支持的属性名称。 |
getProperty
Object getProperty(String name)
- Gets the value of a named property.
- Parameters:
name
- Name of the property- Returns:
- Value of the named property
- Throws:
JAXRPCException
- if an invalid or unsupported property name is passed.
public void
removeProperty(String name)
移除指定属性。
name | 属性的名称 |
return |
boolean 如果移除指定属性,则返回 true ;否则返回 false |
Throws | JAXRPCException: 如果传递无效或不受支持的属性名称。 |
removeProperty
void removeProperty(String name)
- Removes a named property.
- Parameters:
name
- Name of the property- Throws:
JAXRPCException
- if an invalid or unsupported property name is passed.
public java.util.Iterator<E>
getPropertyNames()
获取此 Call
对象支持的可配置属性的名称。
return | 属性名称的 Iterator |
getPropertyNames
Iterator getPropertyNames()
- Gets the names of configurable properties supported by
this
Call
object. - Returns:
- Iterator for the property names
public Object
invoke(Object[] inputParams) throws java.rmi.RemoteException
使用同步请求-响应交互模式调用特定操作。
inputParams | Object[] -- 此调用的参数。这只包括输入参数 |
return |
返回返回值或 null |
Throws | java.rmi.RemoteException: 如果远程方法调用中存在任何错误 |
Throws | SOAPFaultException: 指示 SOAP 错误 |
Throws | JAXRPCException:
|
invoke
Object invoke(Object[] inputParams) throws RemoteException
- Invokes a specific operation using a synchronous request-response
interaction mode.
- Parameters:
inputParams
- Object[]--Parameters for this invocation. This includes only the input params- Returns:
- Returns the return value or
null
- Throws:
RemoteException
- if there is any error in the remote method invocationSOAPFaultException
- Indicates a SOAP faultJAXRPCException
-- If there is an error in the configuration of the
Call
object - If
inputParams
do not match the required parameter set (as specified through theaddParameter
invocations or in the corresponding WSDL) - If parameters and return type are incorrectly specified
- If there is an error in the configuration of the
public Object
invoke(javax.xml.namespace.QName operationName, Object[] inputParams) throws java.rmi.RemoteException
使用同步请求-响应交互模式调用特定操作。
operationName | 操作的 QName |
inputParams | Object[] -- 此调用的参数。这仅包括输入参数。 |
return | 返回返回值或 null |
Throws | java.rmi.RemoteException: 如果远程方法调用中存在任何错误。 |
Throws | SOAPFaultException: 指示 SOAP 错误 |
Throws | JAXRPCException:
|
invoke
Object invoke(QName operationName, Object[] inputParams) throws RemoteException
- Invokes a specific operation using a synchronous request-response
interaction mode.
- Parameters:
operationName
- QName of the operationinputParams
- Object[]--Parameters for this invocation. This includes only the input params.- Returns:
- Return value or null
- Throws:
RemoteException
- if there is any error in the remote method invocation.SOAPFaultException
- Indicates a SOAP faultJAXRPCException
-- If there is an error in the configuration of the
Cal
l object - If
inputParam
s do not match the required parameter set (as specified through theaddParameter
invocations or in the corresponding WSDL) - If parameters and return type are incorrectly specified
- If there is an error in the configuration of the
public void
invokeOneWay(Object[] inputParams)
使用单向交互模式调用远程方法。等待此远程方法调用的服务器处理完成时,客户端线程通常不会阻塞。当使用的协议为 SOAP/HTTP 时,在收到 HTTP 响应代码或发生错误前,此方法应该阻塞。
此方法不得抛出任何远程异常。此方法在处理单向远程调用期间可能抛出 JAXRPCException
。
inputParams | Object[] -- 此调用的参数。这仅包括输入参数。 |
Throws | JAXRPCException:
如果在 Call 对象的配置中存在错误(例如:以不正确方式为单向调用指定非 void 返回类型),或者在执行单向远程调用期间存在错误 |
invokeOneWay
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[]--Parameters for this invocation. This includes only the input params.- Throws:
JAXRPCException
- if there is an error in the configuration of theCall
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
public java.util.Map<K, V>
getOutputParams()
返回上一次调用操作的输出参数的 Map
{name, value}。所返回 Map 中的参数名称的类型为 java.lang.String
。
return |
Map 上一次 Call.invoke() 的输出参数。如果没有输出参数,则返回空 Map 。 |
Throws | JAXRPCException:
如果对单向操作调用此方法,或者在调用 invoke 方法之前调用此方法。 |
getOutputParams
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 typejava.lang.String
. - Returns:
- Map Output parameters for the last
Call.invoke()
. EmptyMap
is returned if there are no output parameters. - Throws:
JAXRPCException
- If this method is invoked for a one-way operation or is invoked before anyinvoke
method has been called.
public java.util.List<E>
getOutputValues()
返回上一次调用操作的输出参数的 List
值。
return |
输出参数的 java.util.List 值。如果没有输出值,则返回空 List 。 |
Throws | JAXRPCException:
如果对单向操作调用此方法,或者在调用 invoke 方法之前调用此方法。 |
getOutputValues
List getOutputValues()
- Returns a
List
values for the output parameters of the last invoked operation. - Returns:
- java.util.List Values for the output parameters. An
empty
List
is returned if there are no output values. - Throws:
JAXRPCException
- If this method is invoked for a one-way operation or is invoked before anyinvoke
method has been called.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!