Starting with the J2EE 1.3 specification,
application components (application clients, Web modules, EJB modules)
can define references to external Web services by using "logical"
names called Web service references. In J2EE 1.3, the references are
added to a webservicesclient.xml in a module. Beginning with J2EE
1.4, the reference is included in the deployment descriptor. You can
use the deployment descriptor editor todefine a web service reference.
About this task
At deployment, the Web service
references are bound to the Web service interfaces in the target operational
environment.
For each Web service reference that you define,
a service-ref element is added to that application
component. Web service references are scoped to the application component
or enterprise bean where they are defined, so they are not accessible
to other application components or beans during run time. Other components
can define Web service references with the same name without causing
a name conflict.
Note: For project levels previous
to the J2EE 1.4 specification level, the workbench allows you to define
Web service references, but the service-ref elements
are not added to the deployment descriptors (the application-client.xml,
web.xml, or ejb-jar.xml). Rather, the Web service references are declared
in a webservicesclient.xml file in the WEB-INF folder of the module.
For example, if you add a Web service reference to a J2EE 1.3 application
client, the reference is added to webservicesclient.xml. If you add
a Web service reference to a J2EE 1.4 application client, the reference
is added to application-client.xml.
Tip: The EJB
specification recommends that you organize all Web service references
in the service sub-context of the bean's environment, the java:comp/env/service JNDI
context.