Skip to main content

The @WebParam annotation

The @WebParam annotation is defined by the javax.jws.WebParam interface. It is placed on the parameters on the methods defined in the SEI. The @WebParam annotation allows you to specify the direction of the parameter, if the parameter will be placed in the SOAP header, and other properties of the generated wsdl:part .

The following table describes the properties of the @WebParam annotation.

Property

Description

name

Specifies the name of the parameter as it appears in the WSDL. For RPC bindings, this is name of the wsdl:part representing the parameter. For document bindings, this is the local name of the XML element representing the parameter. Per the JAX-WS specification, the default is argN , where N is replaced with the zero-based argument index (i.e., arg0 , arg1 , etc.)

targetNamespace

Specifies the namespace for the parameter. It is only used with document bindings where the parameter maps to an XML element. The defaults is to use the service's namespace.

mode

Specifies the direction of the parameter: Mode.IN (default), Mode.OUT, Mode.INOUT

header

Specifies if the parameter is passed as part of the SOAP header. Values of true or false (default).

partName

Specifies the value of the name attribute of the wsdl:part element for the parameter when the binding is document.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!