Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/ws/Service.java
38890 views
/*1* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.ws;2627import javax.xml.namespace.QName;28import java.util.Iterator;29import javax.xml.ws.handler.HandlerResolver;30import javax.xml.bind.JAXBContext;31import javax.xml.ws.spi.ServiceDelegate;32import javax.xml.ws.spi.Provider;3334/**35* <code>Service</code> objects provide the client view of a Web service.36* <p><code>Service</code> acts as a factory of the following:37* <ul>38* <li>Proxies for a target service endpoint.</li>39* <li>Instances of {@link javax.xml.ws.Dispatch} for40* dynamic message-oriented invocation of a remote41* operation.42* </li>43* </ul>44*45* <p>The ports available on a service can be enumerated using the46* <code>getPorts</code> method. Alternatively, you can pass a47* service endpoint interface to the unary <code>getPort</code> method48* and let the runtime select a compatible port.49*50* <p>Handler chains for all the objects created by a <code>Service</code>51* can be set by means of a <code>HandlerResolver</code>.52*53* <p>An <code>Executor</code> may be set on the service in order54* to gain better control over the threads used to dispatch asynchronous55* callbacks. For instance, thread pooling with certain parameters56* can be enabled by creating a <code>ThreadPoolExecutor</code> and57* registering it with the service.58*59* @since JAX-WS 2.060*61* @see javax.xml.ws.spi.Provider62* @see javax.xml.ws.handler.HandlerResolver63* @see java.util.concurrent.Executor64**/65public class Service {6667private ServiceDelegate delegate;68/**69* The orientation of a dynamic client or service. <code>MESSAGE</code> provides70* access to entire protocol message, <code>PAYLOAD</code> to protocol message71* payload only.72**/73public enum Mode { MESSAGE, PAYLOAD }7475protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {76delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,77serviceName,78this.getClass());79}8081protected Service(java.net.URL wsdlDocumentLocation, QName serviceName, WebServiceFeature ... features) {82delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,83serviceName,84this.getClass(), features);85}868788/**89* The <code>getPort</code> method returns a proxy. A service client90* uses this proxy to invoke operations on the target91* service endpoint. The <code>serviceEndpointInterface</code>92* specifies the service endpoint interface that is supported by93* the created dynamic proxy instance.94*95* @param portName Qualified name of the service endpoint in96* the WSDL service description.97* @param serviceEndpointInterface Service endpoint interface98* supported by the dynamic proxy instance.99* @return Object Proxy instance that100* supports the specified service endpoint101* interface.102* @throws WebServiceException This exception is thrown in the103* following cases:104* <UL>105* <LI>If there is an error in creation of106* the proxy.107* <LI>If there is any missing WSDL metadata108* as required by this method.109* <LI>If an illegal110* <code>serviceEndpointInterface</code>111* or <code>portName</code> is specified.112* </UL>113* @see java.lang.reflect.Proxy114* @see java.lang.reflect.InvocationHandler115**/116public <T> T getPort(QName portName,117Class<T> serviceEndpointInterface) {118return delegate.getPort(portName, serviceEndpointInterface);119}120121/**122* The <code>getPort</code> method returns a proxy. A service client123* uses this proxy to invoke operations on the target124* service endpoint. The <code>serviceEndpointInterface</code>125* specifies the service endpoint interface that is supported by126* the created dynamic proxy instance.127*128* @param portName Qualified name of the service endpoint in129* the WSDL service description.130* @param serviceEndpointInterface Service endpoint interface131* supported by the dynamic proxy instance.132* @param features A list of WebServiceFeatures to configure on the133* proxy. Supported features not in the <code>features134* </code> parameter will have their default values.135* @return Object Proxy instance that136* supports the specified service endpoint137* interface.138* @throws WebServiceException This exception is thrown in the139* following cases:140* <UL>141* <LI>If there is an error in creation of142* the proxy.143* <LI>If there is any missing WSDL metadata144* as required by this method.145* <LI>If an illegal146* <code>serviceEndpointInterface</code>147* or <code>portName</code> is specified.148* <LI>If a feature is enabled that is not compatible149* with this port or is unsupported.150* </UL>151* @see java.lang.reflect.Proxy152* @see java.lang.reflect.InvocationHandler153* @see WebServiceFeature154*155* @since JAX-WS 2.1156**/157public <T> T getPort(QName portName,158Class<T> serviceEndpointInterface, WebServiceFeature... features) {159return delegate.getPort(portName, serviceEndpointInterface, features);160}161162163/**164* The <code>getPort</code> method returns a proxy. The parameter165* <code>serviceEndpointInterface</code> specifies the service166* endpoint interface that is supported by the returned proxy.167* In the implementation of this method, the JAX-WS168* runtime system takes the responsibility of selecting a protocol169* binding (and a port) and configuring the proxy accordingly.170* The returned proxy should not be reconfigured by the client.171*172* @param serviceEndpointInterface Service endpoint interface.173* @return Object instance that supports the174* specified service endpoint interface.175* @throws WebServiceException176* <UL>177* <LI>If there is an error during creation178* of the proxy.179* <LI>If there is any missing WSDL metadata180* as required by this method.181* <LI>If an illegal182* <code>serviceEndpointInterface</code>183* is specified.184* </UL>185**/186public <T> T getPort(Class<T> serviceEndpointInterface) {187return delegate.getPort(serviceEndpointInterface);188}189190191/**192* The <code>getPort</code> method returns a proxy. The parameter193* <code>serviceEndpointInterface</code> specifies the service194* endpoint interface that is supported by the returned proxy.195* In the implementation of this method, the JAX-WS196* runtime system takes the responsibility of selecting a protocol197* binding (and a port) and configuring the proxy accordingly.198* The returned proxy should not be reconfigured by the client.199*200* @param serviceEndpointInterface Service endpoint interface.201* @param features A list of WebServiceFeatures to configure on the202* proxy. Supported features not in the <code>features203* </code> parameter will have their default values.204* @return Object instance that supports the205* specified service endpoint interface.206* @throws WebServiceException207* <UL>208* <LI>If there is an error during creation209* of the proxy.210* <LI>If there is any missing WSDL metadata211* as required by this method.212* <LI>If an illegal213* <code>serviceEndpointInterface</code>214* is specified.215* <LI>If a feature is enabled that is not compatible216* with this port or is unsupported.217* </UL>218*219* @see WebServiceFeature220*221* @since JAX-WS 2.1222**/223public <T> T getPort(Class<T> serviceEndpointInterface,224WebServiceFeature... features) {225return delegate.getPort(serviceEndpointInterface, features);226}227228229/**230* The <code>getPort</code> method returns a proxy.231* The parameter <code>endpointReference</code> specifies the232* endpoint that will be invoked by the returned proxy. If there233* are any reference parameters in the234* <code>endpointReference</code>, then those reference235* parameters MUST appear as SOAP headers, indicating them to be236* reference parameters, on all messages sent to the endpoint.237* The <code>endpointReference's</code> address MUST be used238* for invocations on the endpoint.239* The parameter <code>serviceEndpointInterface</code> specifies240* the service endpoint interface that is supported by the241* returned proxy.242* In the implementation of this method, the JAX-WS243* runtime system takes the responsibility of selecting a protocol244* binding (and a port) and configuring the proxy accordingly from245* the WSDL associated with this <code>Service</code> instance or246* from the metadata from the <code>endpointReference</code>.247* If this <code>Service</code> instance has a WSDL and248* the <code>endpointReference</code> metadata249* also has a WSDL, then the WSDL from this instance MUST be used.250* If this <code>Service</code> instance does not have a WSDL and251* the <code>endpointReference</code> does have a WSDL, then the252* WSDL from the <code>endpointReference</code> MAY be used.253* The returned proxy should not be reconfigured by the client.254* If this <code>Service</code> instance has a known proxy255* port that matches the information contained in256* the WSDL,257* then that proxy is returned, otherwise a WebServiceException258* is thrown.259* <p>260* Calling this method has the same behavior as the following261* <pre>262* <code>port = service.getPort(portName, serviceEndpointInterface);</code>263* </pre>264* where the <code>portName</code> is retrieved from the265* metadata of the <code>endpointReference</code> or from the266* <code>serviceEndpointInterface</code> and the WSDL267* associated with this <code>Service</code> instance.268*269* @param endpointReference The <code>EndpointReference</code>270* for the target service endpoint that will be invoked by the271* returned proxy.272* @param serviceEndpointInterface Service endpoint interface.273* @param features A list of <code>WebServiceFeatures</code> to configure on the274* proxy. Supported features not in the <code>features275* </code> parameter will have their default values.276* @return Object Proxy instance that supports the277* specified service endpoint interface.278* @throws WebServiceException279* <UL>280* <LI>If there is an error during creation281* of the proxy.282* <LI>If there is any missing WSDL metadata283* as required by this method.284* <LI>If the <code>endpointReference</code> metadata does285* not match the <code>serviceName</code> of this286* <code>Service</code> instance.287* <LI>If a <code>portName</code> cannot be extracted288* from the WSDL or <code>endpointReference</code> metadata.289* <LI>If an invalid290* <code>endpointReference</code>291* is specified.292* <LI>If an invalid293* <code>serviceEndpointInterface</code>294* is specified.295* <LI>If a feature is enabled that is not compatible296* with this port or is unsupported.297* </UL>298*299* @since JAX-WS 2.1300**/301public <T> T getPort(EndpointReference endpointReference,302Class<T> serviceEndpointInterface, WebServiceFeature... features) {303return delegate.getPort(endpointReference, serviceEndpointInterface, features);304}305306/**307* Creates a new port for the service. Ports created in this way contain308* no WSDL port type information and can only be used for creating309* <code>Dispatch</code>instances.310*311* @param portName Qualified name for the target service endpoint.312* @param bindingId A String identifier of a binding.313* @param endpointAddress Address of the target service endpoint as a URI.314* @throws WebServiceException If any error in the creation of315* the port.316*317* @see javax.xml.ws.soap.SOAPBinding#SOAP11HTTP_BINDING318* @see javax.xml.ws.soap.SOAPBinding#SOAP12HTTP_BINDING319* @see javax.xml.ws.http.HTTPBinding#HTTP_BINDING320**/321public void addPort(QName portName, String bindingId, String endpointAddress) {322delegate.addPort(portName, bindingId, endpointAddress);323}324325326/**327* Creates a <code>Dispatch</code> instance for use with objects of328* the client's choosing.329*330* @param portName Qualified name for the target service endpoint331* @param type The class of object used for messages or message332* payloads. Implementations are required to support333* <code>javax.xml.transform.Source</code>, <code>javax.xml.soap.SOAPMessage</code>334* and <code>javax.activation.DataSource</code>, depending on335* the binding in use.336* @param mode Controls whether the created dispatch instance is message337* or payload oriented, i.e. whether the client will work with complete338* protocol messages or message payloads. E.g. when using the SOAP339* protocol, this parameter controls whether the client will work with340* SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE341* when type is SOAPMessage.342*343* @return Dispatch instance.344* @throws WebServiceException If any error in the creation of345* the <code>Dispatch</code> object.346*347* @see javax.xml.transform.Source348* @see javax.xml.soap.SOAPMessage349**/350public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode) {351return delegate.createDispatch(portName, type, mode);352}353354355/**356* Creates a <code>Dispatch</code> instance for use with objects of357* the client's choosing.358*359* @param portName Qualified name for the target service endpoint360* @param type The class of object used for messages or message361* payloads. Implementations are required to support362* <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.363* @param mode Controls whether the created dispatch instance is message364* or payload oriented, i.e. whether the client will work with complete365* protocol messages or message payloads. E.g. when using the SOAP366* protocol, this parameter controls whether the client will work with367* SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>368* when type is <code>SOAPMessage</code>.369* @param features A list of <code>WebServiceFeatures</code> to configure on the370* proxy. Supported features not in the <code>features371* </code> parameter will have their default values.372*373* @return Dispatch instance.374* @throws WebServiceException If any error in the creation of375* the <code>Dispatch</code> object or if a376* feature is enabled that is not compatible with377* this port or is unsupported.378*379* @see javax.xml.transform.Source380* @see javax.xml.soap.SOAPMessage381* @see WebServiceFeature382*383* @since JAX-WS 2.1384**/385public <T> Dispatch<T> createDispatch(QName portName, Class<T> type,386Service.Mode mode, WebServiceFeature... features) {387return delegate.createDispatch(portName, type, mode, features);388}389390391/**392* Creates a <code>Dispatch</code> instance for use with objects of393* the client's choosing. If there394* are any reference parameters in the395* <code>endpointReference</code>, then those reference396* parameters MUST appear as SOAP headers, indicating them to be397* reference parameters, on all messages sent to the endpoint.398* The <code>endpointReference's</code> address MUST be used399* for invocations on the endpoint.400* In the implementation of this method, the JAX-WS401* runtime system takes the responsibility of selecting a protocol402* binding (and a port) and configuring the dispatch accordingly from403* the WSDL associated with this <code>Service</code> instance or404* from the metadata from the <code>endpointReference</code>.405* If this <code>Service</code> instance has a WSDL and406* the <code>endpointReference</code>407* also has a WSDL in its metadata, then the WSDL from this instance MUST be used.408* If this <code>Service</code> instance does not have a WSDL and409* the <code>endpointReference</code> does have a WSDL, then the410* WSDL from the <code>endpointReference</code> MAY be used.411* An implementation MUST be able to retrieve the <code>portName</code> from the412* <code>endpointReference</code> metadata.413* <p>414* This method behaves the same as calling415* <pre>416* <code>dispatch = service.createDispatch(portName, type, mode, features);</code>417* </pre>418* where the <code>portName</code> is retrieved from the419* WSDL or <code>EndpointReference</code> metadata.420*421* @param endpointReference The <code>EndpointReference</code>422* for the target service endpoint that will be invoked by the423* returned <code>Dispatch</code> object.424* @param type The class of object used to messages or message425* payloads. Implementations are required to support426* <code>javax.xml.transform.Source</code> and <code>javax.xml.soap.SOAPMessage</code>.427* @param mode Controls whether the created dispatch instance is message428* or payload oriented, i.e. whether the client will work with complete429* protocol messages or message payloads. E.g. when using the SOAP430* protocol, this parameter controls whether the client will work with431* SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>432* when type is <code>SOAPMessage</code>.433* @param features An array of <code>WebServiceFeatures</code> to configure on the434* proxy. Supported features not in the <code>features435* </code> parameter will have their default values.436*437* @return Dispatch instance438* @throws WebServiceException439* <UL>440* <LI>If there is any missing WSDL metadata441* as required by this method.442* <li>If the <code>endpointReference</code> metadata does443* not match the <code>serviceName</code> or <code>portName</code>444* of a WSDL associated445* with this <code>Service</code> instance.446* <li>If the <code>portName</code> cannot be determined447* from the <code>EndpointReference</code> metadata.448* <li>If any error in the creation of449* the <code>Dispatch</code> object.450* <li>If a feature is enabled that is not451* compatible with this port or is unsupported.452* </UL>453*454* @see javax.xml.transform.Source455* @see javax.xml.soap.SOAPMessage456* @see WebServiceFeature457*458* @since JAX-WS 2.1459**/460public <T> Dispatch<T> createDispatch(EndpointReference endpointReference,461Class<T> type, Service.Mode mode,462WebServiceFeature... features) {463return delegate.createDispatch(endpointReference, type, mode, features);464}465466/**467* Creates a <code>Dispatch</code> instance for use with JAXB468* generated objects.469*470* @param portName Qualified name for the target service endpoint471* @param context The JAXB context used to marshall and unmarshall472* messages or message payloads.473* @param mode Controls whether the created dispatch instance is message474* or payload oriented, i.e. whether the client will work with complete475* protocol messages or message payloads. E.g. when using the SOAP476* protocol, this parameter controls whether the client will work with477* SOAP messages or the contents of a SOAP body.478*479* @return Dispatch instance.480* @throws WebServiceException If any error in the creation of481* the <code>Dispatch</code> object.482*483* @see javax.xml.bind.JAXBContext484**/485public Dispatch<Object> createDispatch(QName portName, JAXBContext context,486Mode mode) {487return delegate.createDispatch(portName, context, mode);488}489490491/**492* Creates a <code>Dispatch</code> instance for use with JAXB493* generated objects.494*495* @param portName Qualified name for the target service endpoint496* @param context The JAXB context used to marshall and unmarshall497* messages or message payloads.498* @param mode Controls whether the created dispatch instance is message499* or payload oriented, i.e. whether the client will work with complete500* protocol messages or message payloads. E.g. when using the SOAP501* protocol, this parameter controls whether the client will work with502* SOAP messages or the contents of a SOAP body.503* @param features A list of <code>WebServiceFeatures</code> to configure on the504* proxy. Supported features not in the <code>features505* </code> parameter will have their default values.506*507* @return Dispatch instance.508* @throws WebServiceException If any error in the creation of509* the <code>Dispatch</code> object or if a510* feature is enabled that is not compatible with511* this port or is unsupported.512*513* @see javax.xml.bind.JAXBContext514* @see WebServiceFeature515*516* @since JAX-WS 2.1517**/518public Dispatch<Object> createDispatch(QName portName,519JAXBContext context, Service.Mode mode, WebServiceFeature... features) {520return delegate.createDispatch(portName, context, mode, features);521}522523524/**525* Creates a <code>Dispatch</code> instance for use with JAXB526* generated objects. If there527* are any reference parameters in the528* <code>endpointReference</code>, then those reference529* parameters MUST appear as SOAP headers, indicating them to be530* reference parameters, on all messages sent to the endpoint.531* The <code>endpointReference's</code> address MUST be used532* for invocations on the endpoint.533* In the implementation of this method, the JAX-WS534* runtime system takes the responsibility of selecting a protocol535* binding (and a port) and configuring the dispatch accordingly from536* the WSDL associated with this <code>Service</code> instance or537* from the metadata from the <code>endpointReference</code>.538* If this <code>Service</code> instance has a WSDL and539* the <code>endpointReference</code>540* also has a WSDL in its metadata, then the WSDL from this instance541* MUST be used.542* If this <code>Service</code> instance does not have a WSDL and543* the <code>endpointReference</code> does have a WSDL, then the544* WSDL from the <code>endpointReference</code> MAY be used.545* An implementation MUST be able to retrieve the <code>portName</code> from the546* <code>endpointReference</code> metadata.547* <p>548* This method behavies the same as calling549* <pre>550* <code>dispatch = service.createDispatch(portName, context, mode, features);</code>551* </pre>552* where the <code>portName</code> is retrieved from the553* WSDL or <code>endpointReference</code> metadata.554*555* @param endpointReference The <code>EndpointReference</code>556* for the target service endpoint that will be invoked by the557* returned <code>Dispatch</code> object.558* @param context The JAXB context used to marshall and unmarshall559* messages or message payloads.560* @param mode Controls whether the created dispatch instance is message561* or payload oriented, i.e. whether the client will work with complete562* protocol messages or message payloads. E.g. when using the SOAP563* protocol, this parameter controls whether the client will work with564* SOAP messages or the contents of a SOAP body.565* @param features An array of <code>WebServiceFeatures</code> to configure on the566* proxy. Supported features not in the <code>features567* </code> parameter will have their default values.568*569* @return Dispatch instance570* @throws WebServiceException571* <UL>572* <li>If there is any missing WSDL metadata573* as required by this method.574* <li>If the <code>endpointReference</code> metadata does575* not match the <code>serviceName</code> or <code>portName</code>576* of a WSDL associated577* with this <code>Service</code> instance.578* <li>If the <code>portName</code> cannot be determined579* from the <code>EndpointReference</code> metadata.580* <li>If any error in the creation of581* the <code>Dispatch</code> object.582* <li>if a feature is enabled that is not583* compatible with this port or is unsupported.584* </UL>585*586* @see javax.xml.bind.JAXBContext587* @see WebServiceFeature588*589* @since JAX-WS 2.1590**/591public Dispatch<Object> createDispatch(EndpointReference endpointReference,592JAXBContext context, Service.Mode mode,593WebServiceFeature... features) {594return delegate.createDispatch(endpointReference, context, mode, features);595}596597/**598* Gets the name of this service.599* @return Qualified name of this service600**/601public QName getServiceName() {602return delegate.getServiceName();603}604605/**606* Returns an <code>Iterator</code> for the list of607* <code>QName</code>s of service endpoints grouped by this608* service609*610* @return Returns <code>java.util.Iterator</code> with elements611* of type <code>javax.xml.namespace.QName</code>.612* @throws WebServiceException If this Service class does not613* have access to the required WSDL metadata.614**/615public Iterator<javax.xml.namespace.QName> getPorts() {616return delegate.getPorts();617}618619/**620* Gets the location of the WSDL document for this Service.621*622* @return URL for the location of the WSDL document for623* this service.624**/625public java.net.URL getWSDLDocumentLocation() {626return delegate.getWSDLDocumentLocation();627}628629/**630* Returns the configured handler resolver.631*632* @return HandlerResolver The <code>HandlerResolver</code> being633* used by this <code>Service</code> instance, or <code>null</code>634* if there isn't one.635**/636public HandlerResolver getHandlerResolver() {637return delegate.getHandlerResolver();638}639640/**641* Sets the <code>HandlerResolver</code> for this <code>Service</code>642* instance.643* <p>644* The handler resolver, if present, will be called once for each645* proxy or dispatch instance that is created, and the handler chain646* returned by the resolver will be set on the instance.647*648* @param handlerResolver The <code>HandlerResolver</code> to use649* for all subsequently created proxy/dispatch objects.650*651* @see javax.xml.ws.handler.HandlerResolver652**/653public void setHandlerResolver(HandlerResolver handlerResolver) {654delegate.setHandlerResolver(handlerResolver);655}656657/**658* Returns the executor for this <code>Service</code>instance.659*660* The executor is used for all asynchronous invocations that661* require callbacks.662*663* @return The <code>java.util.concurrent.Executor</code> to be664* used to invoke a callback.665*666* @see java.util.concurrent.Executor667**/668public java.util.concurrent.Executor getExecutor() {669return delegate.getExecutor();670}671672/**673* Sets the executor for this <code>Service</code> instance.674*675* The executor is used for all asynchronous invocations that676* require callbacks.677*678* @param executor The <code>java.util.concurrent.Executor</code>679* to be used to invoke a callback.680*681* @throws SecurityException If the instance does not support682* setting an executor for security reasons (e.g. the683* necessary permissions are missing).684*685* @see java.util.concurrent.Executor686**/687public void setExecutor(java.util.concurrent.Executor executor) {688delegate.setExecutor(executor);689}690691/**692* Creates a <code>Service</code> instance.693*694* The specified WSDL document location and service qualified name MUST695* uniquely identify a <code>wsdl:service</code> element.696*697* @param wsdlDocumentLocation <code>URL</code> for the WSDL document location698* for the service699* @param serviceName <code>QName</code> for the service700* @throws WebServiceException If any error in creation of the701* specified service.702**/703public static Service create(704java.net.URL wsdlDocumentLocation,705QName serviceName) {706return new Service(wsdlDocumentLocation, serviceName);707}708709/**710* Creates a <code>Service</code> instance. The created instance is711* configured with the web service features.712*713* The specified WSDL document location and service qualified name MUST714* uniquely identify a <code>wsdl:service</code> element.715*716* @param wsdlDocumentLocation <code>URL</code> for the WSDL document location717* for the service718* @param serviceName <code>QName</code> for the service719* @param features Web Service features that must be configured on720* the service. If the provider doesn't understand a feature,721* it must throw a WebServiceException.722* @throws WebServiceException If any error in creation of the723* specified service.724* @since JAX-WS 2.2725**/726public static Service create(727java.net.URL wsdlDocumentLocation,728QName serviceName, WebServiceFeature ... features) {729return new Service(wsdlDocumentLocation, serviceName, features);730}731732/**733* Creates a <code>Service</code> instance.734*735* @param serviceName <code>QName</code> for the service736* @throws WebServiceException If any error in creation of the737* specified service738*/739public static Service create(QName serviceName) {740return new Service(null, serviceName);741}742743/**744* Creates a <code>Service</code> instance. The created instance is745* configured with the web service features.746*747* @param serviceName <code>QName</code> for the service748* @param features Web Service features that must be configured on749* the service. If the provider doesn't understand a feature,750* it must throw a WebServiceException.751* @throws WebServiceException If any error in creation of the752* specified service753*754* @since JAX-WS 2.2755*/756public static Service create(QName serviceName, WebServiceFeature ... features) {757return new Service(null, serviceName, features);758}759}760761762