WebServiceRef (Java Platform SE 7 ) (original) (raw)

@Target(value={TYPE,METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface WebServiceRef
The WebServiceRef annotation is used to define a reference to a web service and (optionally) an injection target for it. It can be used to inject both service and proxy instances. These injected references are not thread safe. If the references are accessed by multiple threads, usual synchronization techinques can be used to support multiple threads.
Web service references are resources in the Java EE 5 sense. The annotations (for example, Addressing) annotated with meta-annotation WebServiceFeatureAnnotation can be used in conjunction with WebServiceRef. The created reference MUST be configured with annotation's web service feature.
For example, in the code below, the injectedStockQuoteProvider proxy MUST have WS-Addressing enabled as specifed by theAddressing annotation.

    public class MyClient {  
       @Addressing  
       @WebServiceRef(StockQuoteService.class)  
       private StockQuoteProvider stockQuoteProvider;  
       ...  
    }  
   

If a JAX-WS implementation encounters an unsupported or unrecognized annotation annotated with the WebServiceFeatureAnnotation that is specified with WebServiceRef, an ERROR MUST be given.
Since:
JAX-WS 2.0
See Also:
Resource, WebServiceFeatureAnnotation

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.