Java Reference
In-Depth Information
Therefore, the RPC is more tightly coupled because if you make any changes in
the message structure, you'll need to change all the clients and servers process-
ing that kind of message.
A document-style web service, on the other hand, contains no restrictions for
how the SOAP body must be constructed. It allows you to include whatever XML
data you want and also to include a schema for this XML. Therefore, the Docu-
ment style is probably more flexible, but the effort for implementing the web ser-
vice and clients may be slightly larger.
In the end, the likeliness of change is a factor that one has to consider when
choosing whether to use either RPC- or Document-style web services.
Attaching the @WebMethod attribute to a public method indicates that you want the
method exposed as part of the web service.
The @WebParam annotation is used to specify the parameter's name that needs to
be exhibited in the WSDL. You should always consider using a WebParam annota-
tion, especially when using multiple parameters, else the WSDL will use the default
argument parameter (in this case arg0 ), which is meaningless for web service con-
sumers.
The @WebResult annotation is quite similar to @WebParam in the sense that it can
be used to specify the name of the value returned by the WSDL.
Your web service is now complete. In order to deploy your web service, run the fol-
lowing Maven goal that will package and deploy your web service to your running
JBoss AS 7 instance.
mvn install jboss-as:deploy
JBoss AS will provide a minimal output on the console; this will inform you that the
web service project has been deployed and the WSDL file has been generated:
Search WWH ::




Custom Search