WebMethod (Java EE 5)

Java EE API


javax.jws Annotation Type WebMethod


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface WebMethod

Implements: Annotation
@Retention(value=RUNTIME)
@Target(value=METHOD)

定制一个公开为 Web Service 操作的方法。关联方法必须是公共方法且其参数可以返回值,并且异常必须遵循 JAX-RPC 1.1 的第 5 节中定义的规则。 该方法不需要抛出 java.rmi.RemoteException。
英文文档:

Customizes a method that is exposed as a Web Service operation. The associated method must be public and its parameters return value, and exceptions must follow the rules defined in JAX-RPC 1.1, section 5. The method is not required to throw java.rmi.RemoteException.

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

Optional Element Summary
 String
 boolean
 String
 

abstract public String operationName()
与此方法匹配的 wsdl:operation 的名称。
specdefault Java 方法的名称。
英文文档:

operationName

public abstract String operationName
Name of the wsdl:operation matching this method.

Default:
""

abstract public String action()
此操作的动作。

对于 SOAP 绑定,此方法可确定 soap 动作的值。

英文文档:

action

public abstract String action
The action for this operation.

For SOAP bindings, this determines the value of the soap action.

Default:
""

abstract public boolean exclude()
将某一方法标记为不作为一个 web 方法公开。

此方法用于阻止将某一继承方法公开为此 web 服务的一部分。如果指定此元素,则不得为

since2.0

英文文档:

exclude

public abstract boolean exclude
Marks a method to NOT be exposed as a web method.

Used to stop an inherited method from being exposed as part of this web service. If this element is specified, other elements MUST NOT be specified for the @WebMethod.

This member-value is not allowed on endpoint interfaces.

Since:
2.0
Default:
false


Submit a bug or feature

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

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

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