< prev index next >

src/java.xml.ws/share/classes/javax/xml/ws/spi/ServiceDelegate.java

Print this page


   1 /*
   2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  34 import javax.xml.bind.JAXBContext;
  35 import javax.xml.ws.EndpointReference;
  36 import javax.xml.ws.WebServiceException;
  37 
  38 
  39 /**
  40  * Service delegates are used internally by {@code Service} objects
  41  * to allow pluggability of JAX-WS implementations.
  42  * <p>
  43  * Every {@code Service} object has its own delegate, created using
  44  * the {@link javax.xml.ws.spi.Provider#createServiceDelegate} method. A {@code Service}
  45  * object delegates all of its instance methods to its delegate.
  46  *
  47  * @see javax.xml.ws.Service
  48  * @see javax.xml.ws.spi.Provider
  49  *
  50  * @since 1.6, JAX-WS 2.0
  51  */
  52 public abstract class ServiceDelegate {
  53 



  54     protected ServiceDelegate() {
  55     }
  56 
  57     /**
  58      * The {@code getPort} method returns a proxy. A service client
  59      * uses this proxy to invoke operations on the target
  60      * service endpoint. The {@code serviceEndpointInterface}
  61      * specifies the service endpoint interface that is supported by
  62      * the created dynamic proxy instance.
  63      *

  64      * @param portName  Qualified name of the service endpoint in
  65      *                  the WSDL service description
  66      * @param serviceEndpointInterface Service endpoint interface
  67      *                  supported by the dynamic proxy
  68      * @return Object Proxy instance that
  69      *                supports the specified service endpoint
  70      *                interface
  71      * @throws WebServiceException This exception is thrown in the
  72      *                  following cases:
  73      *                  <UL>
  74      *                  <LI>If there is an error in creation of
  75      *                      the proxy
  76      *                  <LI>If there is any missing WSDL metadata
  77      *                      as required by this method
  78      *                  <LI>If an illegal
  79      *                      {@code serviceEndpointInterface}
  80      *                      or {@code portName} is specified
  81      *                  </UL>
  82      * @see java.lang.reflect.Proxy
  83      * @see java.lang.reflect.InvocationHandler
  84      **/
  85     public abstract <T> T getPort(QName portName,
  86             Class<T> serviceEndpointInterface);
  87 
  88     /**
  89      * The {@code getPort} method returns a proxy. A service client
  90      * uses this proxy to invoke operations on the target
  91      * service endpoint. The {@code serviceEndpointInterface}
  92      * specifies the service endpoint interface that is supported by
  93      * the created dynamic proxy instance.
  94      *

  95      * @param portName  Qualified name of the service endpoint in
  96      *                  the WSDL service description
  97      * @param serviceEndpointInterface Service endpoint interface
  98      *                  supported by the dynamic proxy or instance
  99      * @param features  A list of WebServiceFeatures to configure on the
 100      *                proxy.  Supported features not in the {@code features
 101      *                } parameter will have their default values.
 102      * @return Object Proxy instance that
 103      *                supports the specified service endpoint
 104      *                interface
 105      * @throws WebServiceException This exception is thrown in the
 106      *                  following cases:
 107      *                  <UL>
 108      *                  <LI>If there is an error in creation of
 109      *                      the proxy
 110      *                  <LI>If there is any missing WSDL metadata
 111      *                      as required by this method
 112      *                  <LI>If an illegal
 113      *                      {@code serviceEndpointInterface}
 114      *                      or {@code portName} is specified


 147      * also has a WSDL, then the WSDL from this instance MUST be used.
 148      * If this {@code Service} instance does not have a WSDL and
 149      * the {@code endpointReference} does have a WSDL, then the
 150      * WSDL from the {@code endpointReference} MAY be used.
 151      * The returned proxy should not be reconfigured by the client.
 152      * If this {@code Service} instance has a known proxy
 153      * port that matches the information contained in
 154      * the WSDL,
 155      * then that proxy is returned, otherwise a WebServiceException
 156      * is thrown.
 157      * <p>
 158      * Calling this method has the same behavior as the following
 159      * <pre>
 160      * {@code port = service.getPort(portName, serviceEndpointInterface);}
 161      * </pre>
 162      * where the {@code portName} is retrieved from the
 163      * metadata of the {@code endpointReference} or from the
 164      * {@code serviceEndpointInterface} and the WSDL
 165      * associated with this {@code Service} instance.
 166      *

 167      * @param endpointReference  The {@code EndpointReference}
 168      * for the target service endpoint that will be invoked by the
 169      * returned proxy.
 170      * @param serviceEndpointInterface Service endpoint interface.
 171      * @param features  A list of {@code WebServiceFeatures} to configure on the
 172      *                proxy.  Supported features not in the {@code features
 173      *                } parameter will have their default values.
 174      * @return Object Proxy instance that supports the
 175      *                  specified service endpoint interface.
 176      * @throws WebServiceException
 177      *                  <UL>
 178      *                  <LI>If there is an error during creation
 179      *                      of the proxy.
 180      *                  <LI>If there is any missing WSDL metadata
 181      *                      as required by this method.
 182      *                  <LI>If the {@code endpointReference} metadata does
 183      *                      not match the {@code serviceName} of this
 184      *                      {@code Service} instance.
 185      *                  <LI>If a {@code portName} cannot be extracted
 186      *                      from the WSDL or {@code endpointReference} metadata.


 192      *                      is specified.
 193      *                  <LI>If a feature is enabled that is not compatible
 194      *                      with this port or is unsupported.
 195      *                  </UL>
 196      *
 197      * @since 1.6, JAX-WS 2.1
 198      **/
 199     public abstract <T> T getPort(EndpointReference endpointReference,
 200            Class<T> serviceEndpointInterface, WebServiceFeature... features);
 201 
 202 
 203     /**
 204      * The {@code getPort} method returns a proxy. The parameter
 205      * {@code serviceEndpointInterface} specifies the service
 206      * endpoint interface that is supported by the returned proxy.
 207      * In the implementation of this method, the JAX-WS
 208      * runtime system takes the responsibility of selecting a protocol
 209      * binding (and a port) and configuring the proxy accordingly.
 210      * The returned proxy should not be reconfigured by the client.
 211      *

 212      * @param serviceEndpointInterface Service endpoint interface
 213      * @return Object instance that supports the
 214      *                  specified service endpoint interface
 215      * @throws WebServiceException
 216      *                  <UL>
 217      *                  <LI>If there is an error during creation
 218      *                      of the proxy
 219      *                  <LI>If there is any missing WSDL metadata
 220      *                      as required by this method
 221      *                  <LI>If an illegal
 222      *                      {@code serviceEndpointInterface}
 223      *                      is specified
 224      *                  </UL>
 225      **/
 226     public abstract <T> T getPort(Class<T> serviceEndpointInterface);
 227 
 228 
 229     /**
 230      * The {@code getPort} method returns a proxy. The parameter
 231      * {@code serviceEndpointInterface} specifies the service
 232      * endpoint interface that is supported by the returned proxy.
 233      * In the implementation of this method, the JAX-WS
 234      * runtime system takes the responsibility of selecting a protocol
 235      * binding (and a port) and configuring the proxy accordingly.
 236      * The returned proxy should not be reconfigured by the client.
 237      *

 238      * @param serviceEndpointInterface Service endpoint interface
 239      * @param features  An array of {@code WebServiceFeatures} to configure on the
 240      *                proxy.  Supported features not in the {@code features
 241      *                } parameter will have their default values.
 242      * @return Object instance that supports the
 243      *                  specified service endpoint interface
 244      * @throws WebServiceException
 245      *                  <UL>
 246      *                  <LI>If there is an error during creation
 247      *                      of the proxy
 248      *                  <LI>If there is any missing WSDL metadata
 249      *                      as required by this method
 250      *                  <LI>If an illegal
 251      *                      {@code serviceEndpointInterface}
 252      *                      is specified
 253      *                  <LI>If a feature is enabled that is not compatible
 254      *                      with this port or is unsupported.
 255      *                  </UL>
 256      *
 257      * @see WebServiceFeature


 269      *
 270      * @param portName  Qualified name for the target service endpoint
 271      * @param bindingId A URI identifier of a binding.
 272      * @param endpointAddress Address of the target service endpoint as a URI
 273      * @throws WebServiceException If any error in the creation of
 274      * the port
 275      *
 276      * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
 277      * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
 278      * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
 279      **/
 280     public abstract void addPort(QName portName, String bindingId,
 281             String endpointAddress);
 282 
 283 
 284 
 285     /**
 286      * Creates a {@code Dispatch} instance for use with objects of
 287      * the user's choosing.
 288      *


 289      * @param portName  Qualified name for the target service endpoint
 290      * @param type The class of object used for messages or message
 291      * payloads. Implementations are required to support
 292      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 293      * @param mode Controls whether the created dispatch instance is message
 294      * or payload oriented, i.e. whether the user will work with complete
 295      * protocol messages or message payloads. E.g. when using the SOAP
 296      * protocol, this parameter controls whether the user will work with
 297      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 298      * when type is {@code SOAPMessage}.
 299      *
 300      * @return Dispatch instance
 301      * @throws WebServiceException If any error in the creation of
 302      *                  the {@code Dispatch} object
 303      * @see javax.xml.transform.Source
 304      * @see javax.xml.soap.SOAPMessage
 305      **/
 306     public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
 307             Service.Mode mode);
 308 
 309     /**
 310      * Creates a {@code Dispatch} instance for use with objects of
 311      * the user's choosing.
 312      *


 313      * @param portName  Qualified name for the target service endpoint
 314      * @param type The class of object used for messages or message
 315      * payloads. Implementations are required to support
 316      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 317      * @param mode Controls whether the created dispatch instance is message
 318      * or payload oriented, i.e. whether the user will work with complete
 319      * protocol messages or message payloads. E.g. when using the SOAP
 320      * protocol, this parameter controls whether the user will work with
 321      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 322      * when type is {@code SOAPMessage}.
 323      * @param features  A list of {@code WebServiceFeatures} to configure on the
 324      *                proxy.  Supported features not in the {@code features
 325      *                } parameter will have their default values.
 326      *
 327      * @return Dispatch instance
 328      * @throws WebServiceException If any error in the creation of
 329      *                  the {@code Dispatch} object or if a
 330      *                  feature is enabled that is not compatible with
 331      *                  this port or is unsupported.
 332      *


 352      * runtime system takes the responsibility of selecting a protocol
 353      * binding (and a port) and configuring the dispatch accordingly from
 354      * the WSDL associated with this {@code Service} instance or
 355      * from the metadata from the {@code endpointReference}.
 356      * If this {@code Service} instance has a WSDL and
 357      * the {@code endpointReference}
 358      * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
 359      * If this {@code Service} instance does not have a WSDL and
 360      * the {@code endpointReference} does have a WSDL, then the
 361      * WSDL from the {@code endpointReference} MAY be used.
 362      * An implementation MUST be able to retrieve the {@code portName} from the
 363      * {@code endpointReference} metadata.
 364      * <p>
 365      * This method behaves the same as calling
 366      * <pre>
 367      * {@code dispatch = service.createDispatch(portName, type, mode, features);}
 368      * </pre>
 369      * where the {@code portName} is retrieved from the
 370      * WSDL or {@code EndpointReference} metadata.
 371      *



 372      * @param endpointReference  The {@code EndpointReference}
 373      * for the target service endpoint that will be invoked by the
 374      * returned {@code Dispatch} object.
 375      * @param type The class of object used to messages or message
 376      * payloads. Implementations are required to support
 377      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 378      * @param mode Controls whether the created dispatch instance is message
 379      * or payload oriented, i.e. whether the user will work with complete
 380      * protocol messages or message payloads. E.g. when using the SOAP
 381      * protocol, this parameter controls whether the user will work with
 382      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 383      * when type is {@code SOAPMessage}.
 384      * @param features  An array of {@code WebServiceFeatures} to configure on the
 385      *                proxy.  Supported features not in the {@code features
 386      *                } parameter will have their default values.
 387      *
 388      * @return Dispatch instance
 389      * @throws WebServiceException
 390      *                  <UL>
 391      *                    <LI>If there is any missing WSDL metadata


   1 /*
   2  * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  34 import javax.xml.bind.JAXBContext;
  35 import javax.xml.ws.EndpointReference;
  36 import javax.xml.ws.WebServiceException;
  37 
  38 
  39 /**
  40  * Service delegates are used internally by {@code Service} objects
  41  * to allow pluggability of JAX-WS implementations.
  42  * <p>
  43  * Every {@code Service} object has its own delegate, created using
  44  * the {@link javax.xml.ws.spi.Provider#createServiceDelegate} method. A {@code Service}
  45  * object delegates all of its instance methods to its delegate.
  46  *
  47  * @see javax.xml.ws.Service
  48  * @see javax.xml.ws.spi.Provider
  49  *
  50  * @since 1.6, JAX-WS 2.0
  51  */
  52 public abstract class ServiceDelegate {
  53 
  54     /**
  55      * Default constructor.
  56      */
  57     protected ServiceDelegate() {
  58     }
  59 
  60     /**
  61      * The {@code getPort} method returns a proxy. A service client
  62      * uses this proxy to invoke operations on the target
  63      * service endpoint. The {@code serviceEndpointInterface}
  64      * specifies the service endpoint interface that is supported by
  65      * the created dynamic proxy instance.
  66      *
  67      * @param <T> Service endpoint interface
  68      * @param portName  Qualified name of the service endpoint in
  69      *                  the WSDL service description
  70      * @param serviceEndpointInterface Service endpoint interface
  71      *                  supported by the dynamic proxy
  72      * @return Object Proxy instance that
  73      *                supports the specified service endpoint
  74      *                interface
  75      * @throws WebServiceException This exception is thrown in the
  76      *                  following cases:
  77      *                  <UL>
  78      *                  <LI>If there is an error in creation of
  79      *                      the proxy
  80      *                  <LI>If there is any missing WSDL metadata
  81      *                      as required by this method
  82      *                  <LI>If an illegal
  83      *                      {@code serviceEndpointInterface}
  84      *                      or {@code portName} is specified
  85      *                  </UL>
  86      * @see java.lang.reflect.Proxy
  87      * @see java.lang.reflect.InvocationHandler
  88      **/
  89     public abstract <T> T getPort(QName portName,
  90             Class<T> serviceEndpointInterface);
  91 
  92     /**
  93      * The {@code getPort} method returns a proxy. A service client
  94      * uses this proxy to invoke operations on the target
  95      * service endpoint. The {@code serviceEndpointInterface}
  96      * specifies the service endpoint interface that is supported by
  97      * the created dynamic proxy instance.
  98      *
  99      * @param <T> Service endpoint interface
 100      * @param portName  Qualified name of the service endpoint in
 101      *                  the WSDL service description
 102      * @param serviceEndpointInterface Service endpoint interface
 103      *                  supported by the dynamic proxy or instance
 104      * @param features  A list of WebServiceFeatures to configure on the
 105      *                proxy.  Supported features not in the {@code features
 106      *                } parameter will have their default values.
 107      * @return Object Proxy instance that
 108      *                supports the specified service endpoint
 109      *                interface
 110      * @throws WebServiceException This exception is thrown in the
 111      *                  following cases:
 112      *                  <UL>
 113      *                  <LI>If there is an error in creation of
 114      *                      the proxy
 115      *                  <LI>If there is any missing WSDL metadata
 116      *                      as required by this method
 117      *                  <LI>If an illegal
 118      *                      {@code serviceEndpointInterface}
 119      *                      or {@code portName} is specified


 152      * also has a WSDL, then the WSDL from this instance MUST be used.
 153      * If this {@code Service} instance does not have a WSDL and
 154      * the {@code endpointReference} does have a WSDL, then the
 155      * WSDL from the {@code endpointReference} MAY be used.
 156      * The returned proxy should not be reconfigured by the client.
 157      * If this {@code Service} instance has a known proxy
 158      * port that matches the information contained in
 159      * the WSDL,
 160      * then that proxy is returned, otherwise a WebServiceException
 161      * is thrown.
 162      * <p>
 163      * Calling this method has the same behavior as the following
 164      * <pre>
 165      * {@code port = service.getPort(portName, serviceEndpointInterface);}
 166      * </pre>
 167      * where the {@code portName} is retrieved from the
 168      * metadata of the {@code endpointReference} or from the
 169      * {@code serviceEndpointInterface} and the WSDL
 170      * associated with this {@code Service} instance.
 171      *
 172      * @param <T> Service endpoint interface.
 173      * @param endpointReference  The {@code EndpointReference}
 174      * for the target service endpoint that will be invoked by the
 175      * returned proxy.
 176      * @param serviceEndpointInterface Service endpoint interface.
 177      * @param features  A list of {@code WebServiceFeatures} to configure on the
 178      *                proxy.  Supported features not in the {@code features
 179      *                } parameter will have their default values.
 180      * @return Object Proxy instance that supports the
 181      *                  specified service endpoint interface.
 182      * @throws WebServiceException
 183      *                  <UL>
 184      *                  <LI>If there is an error during creation
 185      *                      of the proxy.
 186      *                  <LI>If there is any missing WSDL metadata
 187      *                      as required by this method.
 188      *                  <LI>If the {@code endpointReference} metadata does
 189      *                      not match the {@code serviceName} of this
 190      *                      {@code Service} instance.
 191      *                  <LI>If a {@code portName} cannot be extracted
 192      *                      from the WSDL or {@code endpointReference} metadata.


 198      *                      is specified.
 199      *                  <LI>If a feature is enabled that is not compatible
 200      *                      with this port or is unsupported.
 201      *                  </UL>
 202      *
 203      * @since 1.6, JAX-WS 2.1
 204      **/
 205     public abstract <T> T getPort(EndpointReference endpointReference,
 206            Class<T> serviceEndpointInterface, WebServiceFeature... features);
 207 
 208 
 209     /**
 210      * The {@code getPort} method returns a proxy. The parameter
 211      * {@code serviceEndpointInterface} specifies the service
 212      * endpoint interface that is supported by the returned proxy.
 213      * In the implementation of this method, the JAX-WS
 214      * runtime system takes the responsibility of selecting a protocol
 215      * binding (and a port) and configuring the proxy accordingly.
 216      * The returned proxy should not be reconfigured by the client.
 217      *
 218      * @param <T> Service endpoint interface
 219      * @param serviceEndpointInterface Service endpoint interface
 220      * @return Object instance that supports the
 221      *                  specified service endpoint interface
 222      * @throws WebServiceException
 223      *                  <UL>
 224      *                  <LI>If there is an error during creation
 225      *                      of the proxy
 226      *                  <LI>If there is any missing WSDL metadata
 227      *                      as required by this method
 228      *                  <LI>If an illegal
 229      *                      {@code serviceEndpointInterface}
 230      *                      is specified
 231      *                  </UL>
 232      **/
 233     public abstract <T> T getPort(Class<T> serviceEndpointInterface);
 234 
 235 
 236     /**
 237      * The {@code getPort} method returns a proxy. The parameter
 238      * {@code serviceEndpointInterface} specifies the service
 239      * endpoint interface that is supported by the returned proxy.
 240      * In the implementation of this method, the JAX-WS
 241      * runtime system takes the responsibility of selecting a protocol
 242      * binding (and a port) and configuring the proxy accordingly.
 243      * The returned proxy should not be reconfigured by the client.
 244      *
 245      * @param <T> Service endpoint interface
 246      * @param serviceEndpointInterface Service endpoint interface
 247      * @param features  An array of {@code WebServiceFeatures} to configure on the
 248      *                proxy.  Supported features not in the {@code features
 249      *                } parameter will have their default values.
 250      * @return Object instance that supports the
 251      *                  specified service endpoint interface
 252      * @throws WebServiceException
 253      *                  <UL>
 254      *                  <LI>If there is an error during creation
 255      *                      of the proxy
 256      *                  <LI>If there is any missing WSDL metadata
 257      *                      as required by this method
 258      *                  <LI>If an illegal
 259      *                      {@code serviceEndpointInterface}
 260      *                      is specified
 261      *                  <LI>If a feature is enabled that is not compatible
 262      *                      with this port or is unsupported.
 263      *                  </UL>
 264      *
 265      * @see WebServiceFeature


 277      *
 278      * @param portName  Qualified name for the target service endpoint
 279      * @param bindingId A URI identifier of a binding.
 280      * @param endpointAddress Address of the target service endpoint as a URI
 281      * @throws WebServiceException If any error in the creation of
 282      * the port
 283      *
 284      * @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING
 285      * @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING
 286      * @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING
 287      **/
 288     public abstract void addPort(QName portName, String bindingId,
 289             String endpointAddress);
 290 
 291 
 292 
 293     /**
 294      * Creates a {@code Dispatch} instance for use with objects of
 295      * the user's choosing.
 296      *
 297      * @param <T> type used for messages or message payloads. Implementations are required to
 298      * support {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 299      * @param portName  Qualified name for the target service endpoint
 300      * @param type The class of object used for messages or message
 301      * payloads. Implementations are required to support
 302      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 303      * @param mode Controls whether the created dispatch instance is message
 304      * or payload oriented, i.e. whether the user will work with complete
 305      * protocol messages or message payloads. E.g. when using the SOAP
 306      * protocol, this parameter controls whether the user will work with
 307      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 308      * when type is {@code SOAPMessage}.
 309      *
 310      * @return Dispatch instance
 311      * @throws WebServiceException If any error in the creation of
 312      *                  the {@code Dispatch} object
 313      * @see javax.xml.transform.Source
 314      * @see javax.xml.soap.SOAPMessage
 315      **/
 316     public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
 317             Service.Mode mode);
 318 
 319     /**
 320      * Creates a {@code Dispatch} instance for use with objects of
 321      * the user's choosing.
 322      *
 323      * @param <T> type used for messages or message payloads. Implementations are required to
 324      * support {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 325      * @param portName  Qualified name for the target service endpoint
 326      * @param type The class of object used for messages or message
 327      * payloads. Implementations are required to support
 328      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 329      * @param mode Controls whether the created dispatch instance is message
 330      * or payload oriented, i.e. whether the user will work with complete
 331      * protocol messages or message payloads. E.g. when using the SOAP
 332      * protocol, this parameter controls whether the user will work with
 333      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 334      * when type is {@code SOAPMessage}.
 335      * @param features  A list of {@code WebServiceFeatures} to configure on the
 336      *                proxy.  Supported features not in the {@code features
 337      *                } parameter will have their default values.
 338      *
 339      * @return Dispatch instance
 340      * @throws WebServiceException If any error in the creation of
 341      *                  the {@code Dispatch} object or if a
 342      *                  feature is enabled that is not compatible with
 343      *                  this port or is unsupported.
 344      *


 364      * runtime system takes the responsibility of selecting a protocol
 365      * binding (and a port) and configuring the dispatch accordingly from
 366      * the WSDL associated with this {@code Service} instance or
 367      * from the metadata from the {@code endpointReference}.
 368      * If this {@code Service} instance has a WSDL and
 369      * the {@code endpointReference}
 370      * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
 371      * If this {@code Service} instance does not have a WSDL and
 372      * the {@code endpointReference} does have a WSDL, then the
 373      * WSDL from the {@code endpointReference} MAY be used.
 374      * An implementation MUST be able to retrieve the {@code portName} from the
 375      * {@code endpointReference} metadata.
 376      * <p>
 377      * This method behaves the same as calling
 378      * <pre>
 379      * {@code dispatch = service.createDispatch(portName, type, mode, features);}
 380      * </pre>
 381      * where the {@code portName} is retrieved from the
 382      * WSDL or {@code EndpointReference} metadata.
 383      *
 384      * @param <T> type of object used to messages or message
 385      * payloads. Implementations are required to support
 386      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 387      * @param endpointReference  The {@code EndpointReference}
 388      * for the target service endpoint that will be invoked by the
 389      * returned {@code Dispatch} object.
 390      * @param type The class of object used to messages or message
 391      * payloads. Implementations are required to support
 392      * {@code javax.xml.transform.Source} and {@code javax.xml.soap.SOAPMessage}.
 393      * @param mode Controls whether the created dispatch instance is message
 394      * or payload oriented, i.e. whether the user will work with complete
 395      * protocol messages or message payloads. E.g. when using the SOAP
 396      * protocol, this parameter controls whether the user will work with
 397      * SOAP messages or the contents of a SOAP body. Mode MUST be {@code MESSAGE}
 398      * when type is {@code SOAPMessage}.
 399      * @param features  An array of {@code WebServiceFeatures} to configure on the
 400      *                proxy.  Supported features not in the {@code features
 401      *                } parameter will have their default values.
 402      *
 403      * @return Dispatch instance
 404      * @throws WebServiceException
 405      *                  <UL>
 406      *                    <LI>If there is any missing WSDL metadata


< prev index next >