This is a feature of the Borland Web Services Kit for Java.
The Export Class As A Web Service wizard is used to publish a class as a web service, exposing the public
methods you choose to consumers of the web service. You can use this wizard to publish any Java class as a web service; for example, a JavaBean or EJB. The wizard generates Java files which implement the web service and call the exposed methods, as well as a WSDL which defines and describes the web service. The Export Class As A Web Service wizard also generates a deploy.wsdd
file which provides deployment information to the SOAP server.
The Export Class As A Web Service wizard generates the following files:
Files generated by the Export Class As A Web Service wizard
File name | Description |
---|---|
<class name>PortType.java |
An interface for each portType in the WSDL. You will use the implementation of this interface to call the remote methods. |
<class name>Service.java |
A service interface which defines a get method for each port listed in the service element of the WSDL. This service interface defines a factory class to get a stub instance. |
<class name>ServiceLocator.java |
A locator class which is the implementation of the service interface. |
<class name>ServiceTestCase.java |
An optional JUnit test case for testing the web service. |
<class name>ServicePortSoapBindingStub.java |
A stub class which acts as a proxy for a remote web service. This allows you to call the web service as if it were a local object. This class implements the <class name>_Port.java interface. |
<class name>.wsdl |
The WSDL file which describes the web service. |
deploy.wsdd |
An XML file that provides deployment information to the SOAP server. |
The wizard generates a package name based on the package name of the class with _generated
appended to it.
To open the Export Class As A Web Service wizard, choose File|New, click the Web Services tab in the object gallery, and double-click the Export Class As A Web Service icon or right-click a .java
file in the project pane and select Export Class As A Web Service from the context menu.
Choose the interface or class to be exported to a WSDL document by browsing to it with the ellipsis button. If you specify an interface here, you also must specify an Implementation Class.
If an interface is selected in the Interface or Class field, this is where you specify the class that implements the interface. This field is only enabled if you've selected an interface in the Interface or Class field.
Indicates what service name to assign to the <service>
element in the generated WSDL file.
Indicates the URL of the service. This will be assigned to the location
attribute of the <soap:address>
element in the WSDL file.
When generating WSDL, you can choose to put it all in one document or you can split it into an interface section and an implementation section. If it is split, then the implementation section needs to point to (import) the interface section. The import URL field defines the URL pointer. You can generate all of the WSDL, either in one file or two, or only one part of the WSDL - interface or implementation.
Choose between the following modes:
Indicates the name of the WSDL file to generate if you are either generating all the WSDL in one file or generating only one part of the WSDL file (interface or implementation). Indicates the name of the WSDL interface file if you are generating both the interface and implementation and splitting it into two files.
This field will only be enabled if you are generating both the interface and implementation and splitting it into two files. In that case, use this field to indicate the name of the file for the WSDL implementation.
Defines the URL pointer for the implementation WSDL file to point to the interface WSDL file. This field is only enabled if you are generating split files or implementation only.
Generates a client stub for the web service. The client is generated from a WSDL file and is automatically generated in a new package. The package name is <original package name>_generated
. If Generate Client Stub is selected, two additional steps are added to the wizard. These additional steps provide the same functionality as the Import WSDL wizard.
Select the methods to be exposed in both the current class and the inheritance hierarchy. You can specify inherited packages and classes to be excluded from the web service.
Choose between the following selection modes:
Displays all the methods available in the class and its parent classes. The tree is active when the selection mode is Allow Selected Methods or Disallow Selected Methods. Select methods in the tree to either expose them in the WSDL or exclude them from exposure, depending on which selection mode you're using.
If checked, inherited methods may be exposed in the generated WSDL file.
Use the controls in this section to exclude inherited packages or classes from exposure. For instance, if you choose all methods and inheritance is enabled, all methods in the hierarchy will be exposed except the classes in the packages listed here.
Use this button to add a package or class to the list of excluded packages and classes.
Use this button to remove a package or class from the list of excluded packages and classes.
In this step, you can customize the namespace mapping that is used for packages. This step contains a grid that maps package names to namespaces.
This step is only available if Generate Client Stub is selected in the first step of the wizard. In this step and the following step, you specify the settings for client stub generation from a WSDL file. These two steps provide the same functionality as the Import WSDL wizard.
Enter a package name or select an available package from the drop-down list.
Choose the WSDL to import and use for generating the Java source files. Enter a URL or browse to it by selecting the ellipsis button the the right of the text field.
Deploy scope defines how instances of the service are created.
If Session is selected, there is one instance per authenticated session. Session is the default setting.
If Request is selected, there is one instance per request.
If Application is selected, one instance is shared among all requests.
Choose between SOAP 1.2 and SOAP 1.1 style type mappings. For instance, primitive schema types such as int
and boolean
are treated as
java primitives (int
, boolean
) in SOAP 1.1. The same primitive schema types are treated as Integer
and Boolean
classes in SOAP 1.2. Note that JAX-RPC is only available in SOAP 1.2.
Generates classes for elements in the WSDL even if they are not referenced by the currently specified set of bindings in the WSDL.
Indicates whether or not to generate the optional skeleton classes for server side implementation (<WSDL file name>SoapBindingImpl.java
and <WSDL file name>SoapBindingSkeleton.java
) and the deploy.wsdd
file.
Automatically generates a JUnit test case for the generated Java classes.
When this is selected, the import statements in the WSDL and the schema associated with the WSDL are ignored.
In this step, you can customize the namespace mapping that is used for packages. This step contains a grid that maps namespaces to package names.