Show TOC Start of Content Area

Function documentation Services for the SAP System Landscape Directory and SAP Java Connector  Locate the document in its SAP Library structure

Use

SAP System Landscape Directory (SLD)

The System Landscape Directory service enables you to access the system landscape that is connected to the SAP J2EE Engine. This service allows you to navigate in the system landscape. In addition, you can configure your SAP Java Connector client connections using the service.

Accessing the System Landscape

try {

   // Get the required CIMClient object

com.sap.lcr.api.cimclient.CIMClient

cimClient = WDSystemLandscapeFactory.getClient();

  

   // Get accessor for message server objects

       SAP_BCMessageServerAccessor acc = new SAP_BCMessageServerAccessor (cimClient);

      instances = acc.enumerateInstances(false, true, null);

 

// Loop the list of instances

for (int i = 0; i < instances.length; i++) {

      SAP_BCMessageServer msgServer

= (SAP_BCMessageServer) instances[i].getJavaCIMObject();}

      System.out.println (msgServer.getCaption());

}

 

} catch (Exception e) {

         throw new WDSystemLandscapeException ("Failed to access system landscape”, e);

}

 

The returned CIMClient object can be used to access specific objects in the SLD. This CIMClient object provides a list of defined message server instances.

Note

For more details on using of the Service Landscape Directory (SLD), refer to the administration handbook under Server Infrastructure System Landscape Directory (SLD).

 

JCo Client Connections

If a Web Dynpro application uses a back-end system to provide the data and hence describes a data model using an RFC access, you must also specify a SAP Java Connector client.

Background documentation

The SAP Java Connector (JCo) is a middleware component, which enables you to develop SAP-enabled components and applications in Java. JCo supports communication with the SAP Web Application Server in both directions.

You must specify the underlying back-end system and the user settings for the connection to define this JCo client connection. You have several options for specifying the back-end system. You can use either of the following:

·        The message server, the system name, and the logon group

·        The application server and the system ID

This required information can be configured, and it does not need to be defined in the source text.

The SLD enables you to specify the JCo client connection.

The following source code example can be used for accessing a configured JCo client connection:

WDJCOClientConnection client =
   WDSystemLandscape.getJCOClientConnection(“myJCOClient”);

 

The Web Dynpro runtime services provide the IWDJCOClientConnection interface to define a JCo client connection. The following source text example can be used for generating a JCo client in the SLD.

 

   // Create JCO clients using load-balanced access

  

      IWDJCOClientConnection clientConn1 =

         WDSystemLandscape.createJCOClientConnection(

            "MyJCOClient",

            10,

            "hs001.wdf.sap-ag.de",

            "ABC",

            "PUBLIC",

            "000",

            WDUserDefinitionType.DEFINED_USER,

            "testUser",

            "demo",

            "de");

 

      IWDJCOClientConnection clientConn2 =

         WDSystemLandscape.createJCOClientConnection(

            "MyJCOClient",

            10,

            "hs001.wdf.sap-ag.de",

            "ABC",

            "PUBLIC",

            "000",

            WDUserDefinitionType.SSO,

            null,

            null,

            null);

      // Create JCO clients using application-specific access

     

      IWDJCOClientConnection clientConn3 =

         WDSystemLandscape.createJCOClientConnection(

            "MyJCOClient",

            10,

            "hs001.wdf.sap - ag.de",

            "81",

            "000",

            WDUserDefinitionType.DEFINED_USER,

            "testUser",

            "demo",

            "de");

 

 

Several values for the user type are available. They are listed in the enumeration typeWDUserDefinitionType:

Name

Short Description

MAPPED_USER

A mapped user is used to specify the JCo user. The user mapping is defined by the use of SAP User Management Engine 4.0 (UME).

SSO_USER

An SSO2 cookie is used.

X509_USER

The X509 client certificate is used.

DEFINED_USER

A specific user is used. Each user of the JCo client connection uses the same user.

Note

For defining the user type, you can also use the JCO client wizard, which is integrated into the Web Dynpro tools.

  

  

 

End of Content Area