The next example shows the typical outline a generated service class,
ServiceName
, which extends the javax.xml.ws.Service
base
class.
Outline of a Generated Service Class
public class ServiceName extends javax.xml.ws.Service {
...
public ServiceName(URL wsdlLocation, QName serviceName) { }
public ServiceName() { }
public Greeter getPortName() { }
...
}
The ServiceName
class above defines the following methods:
-
Constructor methods - the following forms of constructor are defined:
-
ServiceName(URL wsdlLocation, QName serviceName)
constructs a service object based on the data in the serviceName service in the WSDL contract that is obtainable from wsdlLocation . -
ServiceName()
is the default constructor, which constructs a service object based on the service name and WSDL contract that were provided at the time the stub code was generated (for example, when running the CXF wsdl2java command). Using this constructor presupposes that the WSDL contract remains available at its original location.
-
-
get_PortName_()
methods - for every PortName port defined on the ServiceName service, CXF generates a correspondingget_PortName_()
method in Java. Therefore, awsdl:service
element that defines multiple ports will generate a service class with multipleget_PortName_()
methods.