Show TOC

Implementing Web Services in CAFLocate this document in the navigation structure

Use

This procedure shows you how to implement Web services using the Composite Application Framework. Based on a WSDL definition you generate the service's implementation skeleton. This skeleton is a CAF application service containing service's operations with their input/output parameters.

You have the following options to import a WSDL file to generate the service from:

  • By connecting directly to the Enterprise Service Repository for SAP NetWeaver Composition Environment (ESR for SAP NetWeaver CE)
  • By searching for services definitions in the Services Registry
  • By importing a WSDL file from a local file system

After you generate the service's implementation skeleton, you provide its business logic by implementing the corresponding operations of the associated CAF application service.

Prerequisites
  • NWDS is properly configured to connect to the ESR for SAP NetWeaver CE and you have the necessary authorizations for browsing

    More information: Browsing Enterprise Services from the SAP NetWeaver Developer Studio

  • NWDS is properly configured to connect to the Service Registry

    More information: Connecting the SAP NetWeaver Developer Studio to the Services Registry

Procedure
  1. To create a composite application project, navigate to File → New → Project.
  2. Create new composite application development component.

    More information: Creating Composite Application Development Components

  3. In the context menu of the external package choose Import → Create Web Service Provider.
  4. Select Enterprise Service Repository from the Available WSDL sources list.
    Note
    Note In case you cannot use online connection to the ESR for SAP NetWeaver CE or Service Registry, but have the Web service's WSDL downloaded locally,  you can import the WSDL file using the Remote Location/File System option. You need to navigate to the correct file location in your local file system.
  5. Log on to the ESR for SAP NetWeaver CE with the appropriate credentials.
  6. Browse the repository to locate the service you want to import, select it, and choose Finish.

    You can see the generated package (application service and the corresponding Web service) under the external package node of your composite application development component.

  7. From the context menu of your application, located in the Composite Application Explorer view, choose Save application.
  8. From context menu of your application choose Generate Application.
  9. Open the Implementation tab of the generated application service and add your custom business logic.

At this implementation step you are free to extend the business logic of the generated  service by, for example, creating dependencies to business objects and CAF application services, stored in the same composite application project, or by referring to ones located in separate projects. You can extend the implementation by using new CAF application service operations (located within the same CAF application service), which can be mapped to any operations of an External service.

  1. From the context menu of your application, choose Build application.
  2. From the same menu, choose Deploy application.
Result

You have completed the implementation of a Web Service that can be later consumed directly. Additionally, you can publish this Web service in a Service Registry.

More information: Publishing Web Services in Service Registry with CAF