Java Reference
In-Depth Information
Specifying a Web Service Message Part
Problem
You want to specify the mapping from your method's parameter name to a wsdl:part name
instead of using the defaults.
Solution
Use the @WebParam annotation. It features ways to specify the target namespace in which this
part is defined, whether this parameter should be pulled from the header, what its name will
be in the WSDL, and the direction of the parameter flow (in, out, or in/out).
Discussion
The simplest and most visible change to make is to the WebParam.name property. Setting this
parameter is requiredif all three of the following are true of your service:
▪ The operation style is document.
▪ The parameter style is bare.
▪ The mode is either OUT or INOUT.
You can also specify a value for the WebParam.partName property, as shown here:
@WebMethod(operationName = "add")
public int add(@WebParam(name = "i", partName="iPart")
NOTE
Setting @WebParam.partName only has an effect if the operation style is RPC or if the operation
style is document and the parameter style is bare.
Search WWH ::




Custom Search