Previous section   Next section
ServiceFactory javax.xml.rpc

JAX-RPC 1.0; JWSDP 1.0, J2EE 1.4
public abstract class ServiceFactory {
// Protected Constructors
    protected ServiceFactory(  ); 
// Public Constants
    public static final String SERVICEFACTORY_PROPERTY;
               // ="javax.xml.rpc.ServiceFactory"
// Public Class Methods
    public static ServiceFactory newInstance(  ) throws ServiceException;
// Public Instance Methods
    public abstract javax.xml.rpc.Service createService(javax.xml.namespace.QName serviceName) 
throws ServiceException;
    public abstract javax.xml.rpc.Service createService(java.net.URL wsdlDocumentLocation, 
    javax.xml.namespace.QName serviceName) throws ServiceException; 
}

ServiceFactory is a factory object used to create Service objects. To obtain an instance of this abstract class, use the static newInstance( ) method, which attempts to locate a suitable concrete implementation as follows:

The two createService( ) methods return Service objects that are intended to be used in different ways. The two-argument variant requires the location of a WSDL document and the fully qualified name of a service defined within that document. The Service object that it returns has access to all of the service information in the WSDL document and can be used to make calls on the remote methods of the service using either dynamic proxies or the DII, both of which are covered in Chapter 6. The single-argument variant accepts only a service name and therefore has no information at all about the service (including whether it exists). A Service object created using this latter method can only be used to construct a service endpoint interface call using the DII and is not able to validate the correctness of these calls before they are made. Refer to the description of the Call interface earlier in this chapter for further information.

ServiceFactory is intended to be used by J2SE clients that have no container support. Container-resident JAX-RPC clients, such as servlets or JSP pages, are not expected to use ServiceFactory. Instead, they typically obtain a reference to a Service object that has been configured into their JNDI environment.

Returned By

ServiceFactory.newInstance( )


  Previous section   Next section