Show TOC

Procedure documentationExposing Portal Services in Web Dynpro Locate this document in the navigation structure

 

A portal service can be accessed from a Web Dynpro application if it implements the IServiceRemoteSafe interface and registers with the service factory.

Prerequisites

  • In NetWeaver Developer Studio, you have created a portal application and portal service with the Portal Application creation wizard.

    The wizard produces a public interface (in the src.api folder) and private implementation class (in the src.core folder).

The following procedure assumes that you have created the following:

  • Portal Application: myApp

  • Portal Service:

    • Interface: ImyService

    • Implementation: myService

Procedure

  1. To the class declaration of the implementation class myService, add IServiceRemoteSafe to the interfaces the class implements.

    The following is the signature for the implementation class:

    Syntax Syntax

    1. public class myService implements ImyService, IServiceRemoteSafe {}
    End of the code.
  2. Add a <registry> section to the portalapp.xml, inside the root <application> tag. To this section, add an <entry> element with the following attributes:

    • path: /com.sap.portal.fpn.api.servicegateway/services/<full name of service>

    • name: full name of service

    • type: service

    The following is the <registry> section for the myApp application:

    Syntax Syntax

    1. <registry>
    2.   <entry path="/com.sap.portal.fpn.api.servicegateway/services/myApp.myService" name="myService" type="service" />
    3. </registry>
    End of the code.
  3. Deploy the application.

Result

The service is now accessible from a Web Dynpro application.