You have an EJB, servlet, or other container-managed resource that you want to act as the client for your web service.
@WebServiceRef annotation to inject a
reference to the service you want to invoke. Note that this does not
have to be only a servlet or EJB. You might also want to invoke a web
service from other container-managed resources, such as a
ServletContextListener, or a
TagHandler depending on your use case.
@WebServiceRef, you can get a
reference to a web service and an injection target for it. Items
@WebServiceRef follow the standard
rules for resource injection within Java EE 5. It defines five
attributes or properties, as are described in Table 6-1.
Table 6-1. @WebServiceRef properties
|A name that identifies the reference to the component using the resource, as a JNDI name. If annotating a field, the default is the name of the field. If annotating a method, the default is the name of the Java Bean property the method defines. If annotating a class, there is no default.|
|The URL pointing to the WSDL for the referenced web service. This is necessary if you define your own WSDL in a physical file and include it with your WAR or EAR.|
|The resource class type. If annotating a field, the default value is the type of the field. If annotating a method, the default is the same as the Java Bean property. If annotating a ...|