WebParam (Java EE 5)

Java EE API


javax.jws Annotation Type WebParam


@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public @interface WebParam

Implements: Annotation
Inner classes: WebParam.Mode
@Retention(value=RUNTIME)
@Target(value=PARAMETER)

定制单个参数到 Web Service 消息部分和 XML 元素的映射关系。
英文文档:

Customizes the mapping of an individual parameter to a Web Service message part and XML element.

Author:
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.

Optional Element Summary
 boolean
 WebParam.Mode
 String
 String
 String
 

abstract public String name()
参数名称。

如果该操作是 rpc 样式的,并且尚未指定 @WebParam.partName,则此名称是表示参数的 wsdl:part 的名称。
如果该操作是文档样式的,或者参数映射到某一个头,则此名称是表示参数的 XML 元素的本地名称。

如果操作是文档样式的,参数样式为 BARE 并且模式为 OUT 或 INOUT,则必须指定一个名称。

specdefault 如果操作是文档样式的并且参数样式为 BARE,则默认名称为 @WebMethod.operationName
否则为 argN,其中的 N 表示方法签名中参数的索引(从 arg0 开始)。

英文文档:

name

public abstract String name
Name of the parameter.

If the operation is rpc style and @WebParam.partName has not been specified, this is name of the wsdl:part representing the parameter.
If the operation is document style or the parameter maps to a header, this is the local name of the XML element representing the parameter.

A name MUST be specified if the operation is document style, the parameter style is BARE, and the mode is OUT or INOUT.

Default:
""

abstract public String partName()
表示此参数的 wsdl:part 的名称。

此名称仅在操作是 rpc 样式,或者操作是文档样式且参数样式为 BARE 时使用。

specdefault
@WebParam.name
since2.0

英文文档:

partName

public abstract String partName
The name of the wsdl:part representing this parameter.

This is only used if the operation is rpc style or if the operation is document style and the parameter style is BARE.

Since:
2.0
Default:
""

abstract public String targetNamespace()
参数的 XML 名称空间。

仅在操作是文档样式或者参数映射到某一个头时使用。如果目标名称空间被设置为 ??,则此名称空间表示空名称空间。

specdefault 如果操作是文档样式,参数样式是 WRAPPED,并且参数没有映射到某一个头,则默认名称空间为空名称空间;
否则,为 Web Service 的 targetNamespace。

英文文档:

targetNamespace

public abstract String targetNamespace
The XML namespace for the parameter.

Only used if the operation is document style or the paramater maps to a header. If the target namespace is set to ??, this represents the empty namespace.

Default:
""

abstract public WebParam.Mode mode()
参数的流向(IN、OUT 或 INOUT 之一)。

OUT 和 INOUT 模式只是为那些符合 Holder 类型定义(JAX-WS 2.0 [5] 的第 2.3.3 节)的参数类型所指定的。Holder 类型的参数必须为 OUT 或 INOUT。

specdefault 如果是一个 Holder 类型,则默认模式为 INOUT。
如果不是一个 Holder 类型,则为 IN。

英文文档:

mode

public abstract WebParam.Mode mode
The direction in which the parameter is flowing (One of IN, OUT, or INOUT).

The OUT and INOUT modes may only be specified for parameter types that conform to the definition of Holder types (JAX-WS 2.0 [5], section 2.3.3). Parameters that are Holder Types MUST be OUT or INOUT.

Default:
IN

abstract public boolean header()
如果为 true,则参数是从消息头而不是消息正文获取的。
英文文档:

header

public abstract boolean header
If true, the parameter is pulled from a message header rather then the message body.

Default:
false


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!