Skip to Content
avatar image
Former Member

How to use SessionManager (MDM 5.5 SP06 JAVA API 2) with TrustedConnection

Hello MDM 5.5 SP06 JAVA API Experts,

Is it possible to Use the SessionManager in conjunction with TrustedConnections ? The trusted connection is setup properly (adding the client IP to the allow.ip file on MDM-Server).

I tried a lot but I didn't succeed with the new JAVA API 2 SessionManager functionality.

I'm initializing a UserSessionContext object and set the field for trusted connections to true.

Later I request an instance of SessionManager and call the createSession() method.

Although I've set the trustedConnection (=true) field of UserSessionContext, I get an exception, if the password is not set correctly. Due to my understanding, the password should be ignored if the UserSessionContext --> trustedConnection field is set to true. Is this a bug or am I missing any important step ?

I have also used several constructors of UserSessionContext but no chance.

Could anyone use the SessionManager with trusted Connections ?

Any help would be greatly appriciated.

Best regards.

      public static void main(String[] args)
      {
        
        Settings settings = new Settings();

        RepositoryIdentifier repId = new RepositoryIdentifier(settings.repository,
                                                              settings.dbServer, 
                                                              settings.dbmsType);

        //Create a UserSessionContext
        //UserSessionContext sessionContext = new UserSessionContext("<servername>", "<repositoryName>", "<userName>");
        UserSessionContext sessionContext = new UserSessionContext( "<servername>", repId, "English [US]", "<userName>"); 
        sessionContext.setConnectionType(ConnectionTypes.LOCAL_POOL_CONNECTION);
        sessionContext.setRegionLocale(Locale.US);
        sessionContext.setTrustedConnection(true);

        //Get an instance of SessionManager
        SessionManager sessionManager = SessionManager.getInstance();
        
        //Create user session
        String userSession = 
        sessionManager.createSession(sessionContext, SessionTypes.USER_SESSION_TYPE, "<any pwd !!!>");
        
        System.out.println("Created user SessionID: " + userSession);

      }

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    May 14, 2008 at 03:18 PM

    Hi,

    Please go through the link below.You need to do some settings for Trusted Connection to work

    [http://help.sap.com/saphelp_mdm550/helpdata/en/8e/9f9c427055c66ae10000000a155106/frameset.htm]

    Go to Appendices -> Trusted Connections

    Regards,

    Jitesh Talreja

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 14, 2008 at 05:26 PM

    Hello Jitesh Talreja,

    thanks for your reply and hint. The trusted connection configuration on MDM server is already setup correctly.

    My concrete problem is to establish a trusted connection using the SessionManager.

    If I use the TrustedUserSessionCommand, everything works.

            CreateUserSessionCommand createUserSessionCommand = new CreateUserSessionCommand(connection);
            createUserSessionCommand.setRepositoryIdentifier(repId);
            createUserSessionCommand.setDataRegion(dataRegion);
            createUserSessionCommand.execute();
            session = createUserSessionCommand.getUserSession();
            state = STATE_SESSION_ESTABLISHED;
            try
            {
                TrustedUserSessionCommand tuscTrustedUser = new TrustedUserSessionCommand(connection);
                tuscTrustedUser.setUserName(userName);
     
                tuscTrustedUser.setSession(createUserSessionCommand.getUserSession());
                tuscTrustedUser.execute();
                session = tuscTrustedUser.getSession();
             }
             catch (com.sap.mdm.commands.CommandException e) 
             {
                /* In Case the Connection is not Trusted */
                System.out.println("Could not established trusted connection!!!");
                e.printStackTrace();
            }
    
    

    But I want to make use of the SessionManager advantages see [MDM Java API Guide|http://help.sap.com/saphelp_mdm550/helpdata/en/47/9f23e5cf9e3c5ce10000000a421937/frameset.htm] -> API Structure and Basic Concepts

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      the usage of SessionManager with TrustedConnection had a bug and is fixed since Hotfix 2!

      I've tested the functionality in following version successfully:

      MDMJ55006P2HF_8-10003460.ZIP / MDM 5.5 SP06 Java API Patch 2 Hotfix 8 (Build 5.5.62.56)

  • avatar image
    Former Member
    Jun 25, 2008 at 10:14 AM

    Ahmet Macar

    Please help me...if you any have documents post in this massages

    We need to apply MDM 5.5 SP06 patch02 with all hotfix.s

    Thanks

    Rama K Junnuru

    Add comment
    10|10000 characters needed characters exceeded