Show TOC Start of Content Area

Procedure documentation Using P4 Protocol Over a Secure Connection  Locate the document in its SAP Library structure

Use

You can set up a secure connection for P4 communication. You can lay the P4 messages over both SSL and HTTPS protocols.

Prerequisites

Procedure

In your client code, obtain the InitialContext to connect to the remote object using the following properties:

...

       1.      Specify the port for the secure connection with the provider URL property.

       2.      Specify the underlying transport layer you want to use. You use the TransportLayerQueue property with value SSL for P4 over an SSL connection, or HTTPS for P4 over an HTTPS connection.

Example

Below is an example of client code that obtains InitialContext using a specific transport layer. This transport layer (SSL or HTTPS) is specified by the transportType parameter provided in the command line when the following client code is executed:

public void init(String host, String port, String user, String pass, String transportType)

   {

      try

      {

         Properties p = new Properties();

         p.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl");

         p.put("java.naming.provider.url", host + ":" + port);

         p.put("java.naming.security.principal", user);

         p.put("java.naming.security.credentials", pass);

         // The transportType parameter has value ssl or https.

         // It is provided on the command line.

         p.put("TransportLayerQueue", transportType);

         ctx = new InitialContext(p);

         System.out.println("NamingClient.run1 ctx : " + ctx);

      }

      catch(NamingException e)

      {

         System.out.println(">> Exception : " + e.getMessage());

         e.printStackTrace();

      }

   }

 

 

 

End of Content Area