Creating an Email Client Using Web Dynpro and Web Services

The Task

In this tutorial, you will develop a Web Dynpro application for sending an e-mail message, using an e-mail Web service provided by an external service provider.

The user interface of this Web application is to consist of a simple input form for editing the addresses of senders and recipients, the subject, and the actual e-mail message, and a button for sending the message. A message is to be displayed in the Web browser to inform users of whether or not the e-mail message was successfully sent.

Use of the e-mail Web service is enabled by an appropriate model (model, auxiliary and communication classes) generated by the Web Dynpro tools. At runtime, the data entered by the user of the application is passed to the model through the data binding between the input fields and the context elements, and through the model binding of these context elements. The model communicates with the Web service through a client stub (a Java object that acts as a proxy for the Web service.

The quick implementation of this Web Dynpro application is characterized by a completely declarative development process, in which the required implementation workload can be reduced to just a few lines of Java code.

Objectives

By the end of this tutorial, you will be able to:

!

Create a model to be used for connecting an external Web service from within the Web Dynpro project

!

Declare a context node in the component controller and create a connection to the model.

!

Perform context mapping between the view controller and the component controller.

!

Design a simple view layout for sending an e-mail message

!

Create an action and implement an event handler

!

Create the data binding from UI elements to context attributes

!

Display the message texts in the Web Browser using a UI service provided by the Web Dynpro runtime environment

!

Perform the implementation for availing of the e-mail Web service used.

Prerequisites

Systems, Installed Applications, and Authorizations

·         You have launched the SAP NetWeaver Developer Studio.

·         You have access to the SAP J2EE Engine.

·         You can connect to a database instance of the SAP DB.

·         You have an open Internet connection.

·         The service provider e-mail Web service used in the tutorial is available.

SAP AG cannot guarantee the availability of the third-party Web service used in this tutorial and does not assume any responsibility for the quality of this service. 

Knowledge

·         You have acquired some basic experience with Web Dynpro applications - for example, by working through the Welcome Quickstart Guide(Creating Your First Web Dynpro Application).

·         Basic knowledge of Java would be an advantage.

Now continue with the section…

Creating a Project Structure