Java Reference
In-Depth Information
Specifying
the
SOAP
Binding
Style,
Use,
and
Parameter Style
Problem
You want to customize the SOAP binding style, SOAP body use, and parameter style for your
web service operation.
Solution
Use the @SOAPBinding annotation on your web method and specify its attributes using enums
within the javax.jws.soap.SOAPBinding class, like this:
@WebMethod
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
use=SOAPBinding.Use.LITERAL,
parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public @WebResult(name="searchResults",
targetNamespace="http://ns.soacookbook.com/catalog")
SearchResults
authorSearch(
@WebParam(name="author", mode=WebParam.Mode.IN,
targetNamespace="http://ns.soacookbook.com/catalog") Author
author) {
//...
DOCUMENT and RPC are possible values for SOAPBinding.Style , LITERAL and ENCODED are
possible values for SOAPBinding.Use , and WRAPPED and BARE are possible values for
SOAPBinding.ParameterStyle . If no values are specified, that is, if no @SOAPBinding an-
notation is used on your web method, the defaults will be document/literal wrapped.
See Choosing Encoding, Use, and Parameter Styles for a discussion on how to choose among
these combinations.
Search WWH ::




Custom Search