Each Web Dynpro component is supplied with a corresponding Component Controller. This controller is responsible for retrieving the data required by the Email Web service to send the e-mail. Accordingly, it must be able to map the corresponding input and output structures of the e-mail model. To do this, you need to bind the context of the component controller with the created Web service model. You can declare this model binding between the controller context and the model with the Data Modeler, available as one of the Web Dynpro tools.
The structure of your project WebDynpro_EmailWS is currently displayed in the Web Dynpro Explorer.
a. The structure of the Web Dynpro component EmailWSComponent looks like this in the Data Modeler:
In the Data Modeler, you can easily declare the connection between the context of the component controller and the Web service model you have created.
a. Open the Data Modeler.
b. In the left toolbar, choose the icon Create a data link.
c. Begin above the rectangle Component Controller and left-click. Do this without releasing the mouse button.
d. Draw a line to the EmailModel rectangle and release the primary mouse button. The Model Binding Wizard starts automatically.
e. Drag the node of the model class Request_SendEmailPortType_sendEmailin the EmailModel to the root node of the component controller context, and drop it.
f. In the subsequent dialog, select the context elements Response, fromAddress, msgBody, subject and toAddress.
g. On the left side, mark the model node Request_SendEmailPortType_sendEmail:
h. Enter the name WebServiceEmailfor the new model node Request_SendEmailPortType_sendEmail, which is bound to the model class of the same name, by editing the appropriate entry in the Name column, and then choosing Ok.
i. In the dialog box that appears, the declared model binding between the model node WebServiceEmail and the corresponding model class Request_SendEmailPortType_sendEmail is shown graphically:
j. Close the Model Binding Wizard by choosing Finish.
After completion of the model binding, the context structure of the component controller looks as follows:
Starting with the model definition, you have now defined a structure of context model elements (model nodes and model attributes) in the component controller EmailWSComponent, and then linked it to the corresponding model class.