Wrapping Services in Controllers
Prerequisites
-
You have created a Web Dynpro DC and a WD component.
-
You have also defined a WD model for the model binding and declared it to the component.
Context
The Data Modeler provides graphical support when implementing controllers; this integrated function is known as the Service Controller. The wizard, which is started in the Data Modeler or the Web Dynpro Explorer, creates a controller that wraps a service. This service can either be a Remote Function Call or a Web service. You start the wizard for an existing controller or generically in the Custom Controller area of the Data Modeler . The wizard then creates the required contexts and an optional method for triggering the call.
The Service Controller enables the following:
-
Creation of a context node structure with model binding for the chosen controller
-
Proper code generation for the instance creation in wdDoInit method (based on the chosen nested structure and cardinality).
-
Proper code generation for the model class execution in a newly created execute method (specified in the wizard).
Procedure
-
In the work area of the Data Modeler, place the cursor on an existing custom controller, or in the Custom Controller area and choose Apply Template from the context menu.
-
Carry out the model binding as well as the attribute binding by selecting the relevant context elements.
-
Choose Next if you want to create a method. Otherwise, you can choose Finish to exit the wizard at this point and save your changes.
-
Enter a method name and exit the wizard.