Show TOC Start of Content Area

Procedure documentation Mapping Service Operations  Locate the document in its SAP Library structure

Use

Once you have imported an external service in your composite application, you need to map the external service operations to application service operations. This way you use external services without implementing code. When the external service you have imported has a huge number of operations and attributes you can create automatic identical mappings to an application service.

The CAF application uses an application service operation to send an input message. The input message attributes are mapped to the remote service operation input attributes (input mapping). The remote service processes the input attributes and generates output attributes.The output message attributes are mapped to the application service operation output attributes (output mapping).

The application service operation returns the output attributes back to the caller. This process is described in the figure below.

 

This graphic is explained in the accompanying text

Prerequisites

·        You have imported an external service in your application.

More information: Importing Web Services

...

·        You must be familiar with the mapping rules.

More information: Rules for Service Mapping

·        You must have disabled the Implemented checkbox.

More information: Modeling Service Operations

·        For business objects, you also need to complete the following:

¡        You have created at least one operation custom key attribute.

¡        You have set remote persistency.

More information: Defining Business Object Persistency

Procedure

Mapping External Service to an Application Service

       1.      Map the external service operation to the application service operation:

                            a.      Open the Datasource tab page.

                            b.      Select the application service operation you want to map and choose Create mapping.

                            c.      For a source operation, choose an external service operation you have imported.

                            d.      Use drag-and-drop to map the input and output parameters of the source and target  operations.

Arrows appear indicating the direction and type of attribute mapping:

§         Green arrow indicates mapping of collections.

§         Black arrow indicates mapping if single attributes.

Note

Select the proper external operations regarding semantics.

For example, the operation getUserInfo is more likely to be mapped to a read operation than to a create operation.

       2.      Save all metadata, generate project code, build and deploy.

Creating Automatic Mappings for Application Services

...

       1.      Click one of the external services you have imported with the secondary mouse button and choose Default mappings.

       2.      Select attributes of the external services to be automatically mapped.

       3.      Choose the target application service for your mapping. You have the following options:

¡        Create methods in new Application Service

¡        Create methods in existing Application Service

Mapping External Service to a Business Objects Operation

...

       1.      Open the Datasource tab page of the business object attribute, following the instructions for application service operations mapping.

       2.      Select the source operation attribute you want to map to the relevant CRUD or query operation.

       3.      Use drag-and-drop to map the input and output parameters of the source and target operations.

       4.      Arrows appear indicating the direction and type of attribute mapping:

¡        Green arrow indicates mapping of collections.

¡        Black arrow indicates mapping if single attributes.

...

Result

The application service or business object node operations are now mapped, and if called on runtime they execute the mapped external service operation according to the attribute mappings.

To remove the operation mapping you created, choose Delete Mapping.

End of Content Area