Java Reference
In-Depth Information
@WebServiceRef
private CatalogServiceSN catalogServiceIT;
If this annotated field is included in a servlet called “InjectionServlet,” at deploy time,
something like the following is automatically generated into web.xmlfor you:
<service-ref>
<display-name>com.soacookbook.ch03.InjectionServlet/catalogServiceIT
</display-name>
<service-ref-name>com.soacookbook.ch03.InjectionServlet/catalogServiceIT
</service-ref-name>
<service-interface>com.soacookbook.ch03.CatalogServiceSN
</service-interface>
<wsdl-file>http://localhost:8080/soaCookbookWS/CatalogServiceSN?wsdl
</wsdl-file>
<service-qname xmlns:service-qname_ns__="http://ns.soacookbook.com">
service-qname_ns__:CatalogServiceSN</service-qname>
<injection-target>
<injection-target-class>com.soacookbook.ch03.InjectionServlet
</injection-target-class>
<injection-target-name>catalogServiceIT</injection-target-name>
</injection-target>
</service-ref>
The injection-target-name element here is based on the variable name you give your ser-
vice. In your invoking code, we've defined a variable named catalogServiceIT in a class
called com.soacookbook.ch03.InjectionServlet . So the injection target gets populated
appropriately in the generated web.xml. Beyond the <service-ref> element, this is not par-
ticular to web services, but is simply how Java EE 5 injection works with servlets. While you
can do web services for a very long time and not need to know that this is being generated in
this manner for you, such knowledge may be helpful in a debugging effort.
Search WWH ::




Custom Search