Adding Exposed Methods to Modeled Web Services
There are two ways in which you can add an exposed method to a modeled
web service:
-
Add a new exposed method to the modeled web service
-
Add a new method to the Java class and regenerate the web service
To add an exposed method to a modeled web
service:
-
Click on the modeled web service to select it, and then click in the
Exposed Methods Compartment (below the Name Compartment).
-
Create a new method by typing in the method, for example,
getDate () : java.lang.String
.
The web service
implementation files are automatically updated, and the WSDL document
is overwritten with a new version. If you have created the Java class
associated with this modeled web service, it is also updated, and the
method in the Java class is preceded by the @webmethod
Javadoc comment.
To add a method to a Java class and regenerate
the modeled web service:
-
In the code editor, edit the Java class on which the web service is
based and add a new public method. You can use the
@webmethod
Javadoc comment before the method to ensure that it is selected for
implementation as a web service
OR
when you open the wizard, you
can go the Exposed Methods page and select the method for generation
to a web service.
Note: If you add a new
public method that cannot be published as a web service (for example,
if it is not serializable) and use the @webmethod comment, the
modelled web service ignores the new method without displaying any
warnings or errors.
-
Double-click the modeled web service on the diagram, or right-click
the modeled web service and choose P
roperties. This opens the reentrant Create Web Service wizard.
-
Click OK to regenerate the WSDL document.
The new method is now included in the WSDL document, and the modeled
web service is updated with the new exposed method.
Related topics
@webmethod Javadoc Comment
Copyright © 1997, 2004, Oracle.
All rights reserved.