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.
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.
To define a Web service reference: