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);

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

Similar Messages

  • How to create a taxonomy using MDM 5.5 SP05 JAVA API?

    Hi ALL,
    I have a requirement in which i have to create a taxonomy using MDM 5.5 SP05 JAVA API.
    Can anyone tell me how that functionality can be achieved?
    Thanks in Advance.
    Rajat.

    HI, Rajat.
    For exposing hierarchy in WD view you need to use node with recursive children in the context and Tree/TreeNodeType UI elements in view layout.
    For load hierarchy records you have to use RetrieveLimitedHierTreeCommand. You can load whole hierarchy (as I know, SP05 API have a bug - only first 1000 record can be loaded) or load hierarchy nodes on demand (using OnLoadChildren action of TreeNodeType element).
    Refer to this example of loading child records:
    // Context structure:
    // Tree (model node, model class built from com.sap.mdm.data.Record interface)
    //  |-- Children (recursive child node repeating Tree node)
    //  |-- DisplayValue (string value attribute, TreeNodeType's text property bound here)
    //  |-- HasChildren (boolean value attribute, TreeNodeType's hasChildren property bound here)
    // parentElem is element of node Tree or Children for which we must load child records, null for first level of hierarchy
    private void fillNodeWithChildren(IPrivateHierarchySelectView.ITreeElement parentElem) {
         // Determining RecordId of parent record and context node to which child records belong
         RecordId parentRecordId = null;
         if (parentElem != null) parentRecordId = parentElem.modelObject().getId();
         IPrivateHierarchySelectView.ITreeNode parentNode =
              parentElem == null
                   ? wdContext.nodeTree()
                   : parentElem.nodeChildren();
         // Loading children with RetrieveLimitedHierTreeCommand
         try {
              RetrieveLimitedHierTreeCommand retTreeCmd = new RetrieveLimitedHierTreeCommand(...); // use suitable constructor
              if (parentRecordId != null) retTreeCmd.setRootNode(parentRecordId);
              retTreeCmd.setResultDefinition(...); // don't forget set ResultDefinition
              retTreeCmd.execute();
              HierNode subRoot = retTreeCmd.getTree()
              parentNode.invalidate();
              // Processing loaded child records - add elements into parentNode
              if (subRoot == null) return;
              IPrivateHierarchySelectView.ITreeElement childElem;
              HierNode childRecord;
              HierNode[] children = subRoot.getChildren();
              int count = children == null ? 0 : children.length;
              for (int i = 0; i < count; i++) {
                   childRecord = children<i>;
                   childElem = parentNode.createTreeElement(childRecord);
                   childElem.setDisplayValue(childRecord.getDisplayValue());
                   childElem.setHasChildren(!childRecord.isLeaf());
                   parentNode.addElement(childElem);
              if (parentElem != null) parentElem.setHasChildren(count > 0);
         } catch (/* Some MDM Exceptions */) {}
    Don't forget call fillNodeWithChildren(null) in wdDoInit for load first level of hierarchy.

  • Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes? Both my daughters have ipods, my wife has one

    Dear All
    Can anyone give me simple instructions on how to use more than one ipod on the same computer with itunes. My daughters have a different generation 'nano' each & my wife a 'shuffle'?
    Many thanks

    Click here for options.
    (69081)

  • How to use airport time capsule on a dell portable pc with windows 7 taking in consideration that Time machine doesn't run with Windows ?

    how to use airport time capsule on a dell portable pc with windows 7 taking in consideration that time machine doesn't run with Windows ?

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • We have a corporate iPad in our auto showroom to show guests how to use features on their vehicles. Someone locked it with their account. It was not an employee. How can I get in? I did a restore of the software already?

    We have a corporate iPad in our auto showroom to show guests how to use features on their vehicles. Someone locked it with their account. It was not an employee. How can I get in? I did a restore of the software already?

    Gather up the proof that the dealership is the original purchaser of the iPad,
    and take the iPad & that proof to a physical Apple store for possible assistance.
    It is highly suggested that you make a genius bar appointment to avoid delay
    at the store:
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
    If no Apple store close by, get the information mentioned above and contact
    Apple Contact Us for assistance.
    Once the problem is resolved, you may wish it use Guided Access to limit
    what customers can do with the iPad.
         iOS: About Guided Access - Apple Support

  • How to use .dll compiled in Delphi in Java?

    Can anyone provide me information how to use .dll compiled in Delphi in Java? The .dll Delphi program may be non-OOP program.

    Hi
    If You want to write anything in PASCAL then simply write JNI code in C++ and call functions from this DELPHI DLL, but remember about changing the order of parameters etc when You call it. I had exactly the same problem, but it is possible, and we succeed.
    You will need exact description of input parameters required by PASCAL functions and of output parameters. Then construct in C++ objects wchich looks in memory exacly the same as they will look if You will be using PASCAL. Then PASCAL function will interprete this area in memory as known structure and will run.
    Maciek

  • HOW DO use the Mikey 2.0 iPod and iPhone Microphone with my IPHONE4

    HOW DO use the Mikey 2.0 iPod and iPhone Microphone with my IPHONE4

    Did the microphone come with a user manual? You might contact support for the microphone.
    Just so you know the iPhone 4 has a built-in microphone

  • I'm looking into how apps use the cloud. Would you consider any app with social media access as uploading information to the cloud? e.g. being able to tweet through an app is the same as uploading data to the cloud

    I'm looking into how apps use the cloud. Would you consider any app with social media access as uploading information to the cloud? e.g. being able to tweet through an app is the same as uploading data to the cloud

    Most of us in this forum are users who volunteer on technical issues, and not Adobe employees although they do drop in from time to time. As users we simply have no control over activation and that's why you are not getting responses.
    If you havn't done so,you might try the Muse forums and see if you can get a staff member to look into it. Have your case numbers and phone transcripts handy.
    Last option is to keep calling customer service until you get someone who will help or ask for a supervisor.
    Hope this get resolved,
    Gene

  • MDM 7.1 SP03 Java API - setRetrieveResultCounts & taxonomy aliases = error

    We just upgraded our test MDM system to 7.1 SP03 so we could use the new methods in the Java API to get result counts. However, we've run into a problem with the result counts when taxonomy aliases are being used.
    The following code works when there are no taxonomy aliases defined in our MDM system, but as soon as we add any aliases, it fails:
            RetrieveLimitedRecordsCompoundCommand command = new RetrieveLimitedRecordsCompoundCommand(sessionContext);
            command.setPageIndex(pageIndex);
            command.setPageSize(pageSize);
            ResultDefinition resultDefinition = new ResultDefinition(PRODUCTS_TABLE);
            resultDefinition.addSelectField(CATALOG_NUMBER_FIELD);
            resultDefinition.addSelectField(LIST_PRICE);
            resultDefinition.addSelectField(PRODUCT_CATEGORY);
            resultDefinition.addSelectField(PRIMARY_IMAGE);
            command.setResultDefinitions(new ResultDefinition[] { resultDefinition });
            command.setRetrieveResultCounts(true);
            RecordId category = new RecordId(categoryId);
            // Set category search constraint
            if (categoryId > 0) {
                   search.addSearchItem(new FieldSearchDimension(PRODUCT_CATEGORY),
                                           new PickListSearchConstraint(new MdmValue[] { new LookupValue(category) }));
            command.setSearch(search);
            command.execute();
    Here is there error we get:
    com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Win32 structured exception occurred
         at com.sap.mdm.data.commands.RetrieveLimitedRecordsCompoundCommand.execute(RetrieveLimitedRecordsCompoundCommand.java:187)
         at com.baldor.mdm.Mdm.SearchProducts(Mdm.java:276)
         at com.baldor.beans.ProductSearch.search(ProductSearch.java:110)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
         at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
         at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
         at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:112)
         at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2327)
         at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
         at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:1993)
         at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:1941)
         at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:285)
         at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:243)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:114)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.sap.mdm.internal.protocol.manual.ServerException: Win32 structured exception occurred
         at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:126)
         at com.sap.mdm.data.commands.RetrieveLimitedRecordsCompoundCommand.execute(RetrieveLimitedRecordsCompoundCommand.java:183)
         ... 32 more
    Exception in thread "com.sap.mdm.internal.net.ConnectionPoolBase" java.lang.NullPointerException
         at com.sap.mdm.internal.net.ConnectionPoolBase.reserveConnection(ConnectionPoolBase.java:150)
         at com.sap.mdm.internal.net.ConnectionPoolBase.reserveConnection(ConnectionPoolBase.java:130)
         at com.sap.mdm.internal.net.ConnectionPoolBase.checkAndDiscardConnections(ConnectionPoolBase.java:494)
         at com.sap.mdm.internal.net.ConnectionPoolBase.run(ConnectionPoolBase.java:556)
         at java.lang.Thread.run(Unknown Source)
    Also, if I monitor the MDM system I can see the memory usage goes up more than 200MB and the CPU is pegged for 5-10 seconds before getting the error on the client.
    Is there something we can do to fix this?
    Thanks,
    Jonathan

    Sorry about the formatting of the above message - for some reason the forum pulled out all the line breaks and ignored the  tags...

  • How to use a VB dll file in java

    hi,
    i am working on college project,In this output of calculation is not matching with college site .So any one can tell "how to use or combine a VB 'dll' file in java?".so that i can use VB 'dll' file in java to get right Output.
    If possible write code or send it to "[email protected]"
    Thanks
    Ravi kapani

    Did you try Google? And no, there is no native support for accessing .dll files from Java. That said, take a look at JNI.

  • How to use chart engine for web dynpro java(EP) for Graphics generation.

    Hi Frndz..
    now lookiing out for different types of dynamic graphics generations according to my requirment, n i saw the followiing blog
    Testing BusinessGraphics in Web Dynpro for Java
    Itz very nice to see that we can generate planty of types, but here our server is EP 7.0(not CE 7.1) and i gone thru  these links also
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/86/243f403f0a9354e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/0b/79553b066d9414e10000000a114084/frameset.htm
    https://help.sap.com/saphelp_nw04/helpdata/en/0c/95c83956852b51e10000000a114084/frameset.htm
    here it seems to be Chart Engine n Chart Designer is mainly for BSP(R3), how best we can use this for web dyn pro java.
    Thanks in Advance
    Regards
    Rajesh

    hi
    if you want to use BusinessGraphics in WebDynpro java you have to configure IGS.
    IGS Configuration
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4846ac90-0201-0010-099d-d3b4e271849c
    Business Graphics docs.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3261cd90-0201-0010-268c-d8d72e358af6
    ChartDeigner Usage
    http://help.sap.com/saphelp_nw04/helpdata/en/18/d4d43fb9490c65e10000000a114b1d/frameset.htm
    Generating Gantt chart using web dynpro business graphics

  • How to use Crossbow Xmesh WSN LabVIEW drivers for downstream communication with motes

    Hello,
    I am trying to use LabVIEW Crossbow Xmesh WSN  driver for downstreaming commands but driver programs are not working.
    I am interested in changing node (Iris mote with MDA300 board) update rate from LabVIEW program running on host PC .
           I have  used  Set node update rate.vi  with  open stream.vi and start stream.vi  in proper sequence and developed a program to change node update rate. When program is run no error is shown but node update rate is not changed.
          Pl suggest what I should I do.
    What is the function of  WSN write VIs (WSN write Raw 1sensor1point). For what type of message this is used. 
    I  want to actuate relay on MDA300 with mote id 2. What VIs (from driver ) I have to use and how to issue command related to it.
    Incase any one can help I will be grateful
    Roop 

    Hi Arjun,
    I am sending you snap shot of VI developed to change node update rate.and also the heirarchy of drivers  VIs used in the program for  better understanding .
    In case you can figure out why the command  message send  is unable to communicate with mote .
    Also for downstream communication with motes the packet format used is described in Moteworks user manual from MiMSic.com
    I think the developer of these drivers can help you  out in solving my problem.
    Thanks
     Roop
    Attachments:
    sreenshot to arjun ni for checking downstream comm.doc ‏288 KB

  • How to use UI Element "AbstractApplet" to embedd java applet in WDA

    Hello,
    I want to embedd a java applet in a WebDynpro ABAP application and I've found the following statement on SAP online help:
    The Active Control Framework (ACF) enables the development of applets or ActiveX-based controls that can be embedded in Web Dynpro ABAP.
    Link:[AbstractApplet|http://help.sap.com/saphelp_nwpi71/helpdata/en/47/b915bc878a2d67e10000000a42189c/frameset.htm]
    Is there any further help, how to use this (abstract) UI Element to integrate a given java applet?
    Kind Regards,
    Guido

    Hi,
    As per the link you gave,
    In the View layout, You can use the UI elements like - AcfExecute and AcfUpDownload. For upload and download the things.
    Try to use these UI elements and get the reference of the Abrstact APplet class and use the methods inside it.
    Regards,
    Lekha.

  • How to use debugproxy for debugging on AS-Java?

    Dear Sirs,
    I'd like to debug java program on AS-Java without occupying AS-Java instance.
    I expect debugproxy can help it.
    I could enable it on SAP Management Console, but I don't know how to use it with NWDS.
    Could I get instraction of using debugproxy with NWDS?
    In addition, I'm afraid that my idea is feasible and debugging always occupy AS-Java instance. It means I have to have another instance specified for debugging.
    Please advise me.
    Best regards,
    Shingo Suzuki

    Hi Shingo,
    Not always
    Check [this|SAP NW CE 7.1: Start Debug Session... vs. Enable Debugging; thread.
    HTH!
    \-- Vladimir

  • How to use a GPIB card's LabView drivers to communicate with the card?

    I have an axiomtek AX4810P PCI-GPIB card and i have aquired LabView drivers from the manufacturer.
    This has put VI's for the GPIB functions on the 'user palette' but i can't work out how to use them to communicate with the card. can anyone help? please.

    LS,
    Thank you for contacting National Instruments.
    Unfortunately, since you are not using a National Instruments GPIB card, I do not have access to the drivers that were provided to you by your card's manufacturer. I would suggest contacting Axiomtek directly to obtain support using their drivers.
    However, I did write a small VI that demonstrates how to use similar National Instruments drivers with a National Instruments GPIB card. Keep in mind, this example VI is not intended to work with your particular card. The drivers you obtained from Axiomtek may have similar functions, however, and you can use my VI as a guide. My VI allows you to send a command to an instrument at address 2 on the GPIB card.
    Hope this helps!
    Matthew C
    Applications
    Engineer
    National Instruments
    Attachments:
    GPIB_Communication.vi ‏23 KB

Maybe you are looking for

  • Macbook pro 2012 does not work after update, macbook pro 2012 does not work after update

    After 6 weeks i started my macbook and installed q new update now it has a problem to start and restarts all the time again and again

  • Video from DVD imported into iMovie

    I have a DVD with a short movie on it (someone else burned the DVD for me) and I want to take the video from that DVD and import it into iMovie so that I can add music, titles, etc. How do I go about doing this? Thanks for your help and have a great

  • SSL connections blocking worker threads on DS 5.2 patch 4

    Hi, Is it normal for an idle SSL connection to consume a worker thread within the directory server? We have recently enabled SSL on a number of our directory servers (5.2 patch 4) and have run into problems with the server hanging. We have a number o

  • Problem with validation of selection screen

    I am creating session process for BDC For that i am taking the flat file at runtime.i want check whether the entered file is valid or not..that means it exists are not? how to do that..

  • Compliance Management - In Place hold checkbox

    Hello, I have a general functionality question.   for the Place content matching the search query in selected mailboxes on hold check box I noticed that it drives the Yes / No hold status in the EAC.   If this checkbox is NOT selected and the Hold st