cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to MDM 7.1 using Webdynpro Java

Former Member
0 Kudos

Hello,

I want to connect to MDM 7.1 using Webdynpro Java . Please somebody can share the code for the same.

Any help would be highly appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please refer the SAP MDM Portal Content Development Guide - http://help.sap.com/saphelp_mdm550/helpdata/en/45/c87d0243e56f75e10000000a1553f6/frameset.htm

You can check the section - Connecting with the repository using System Object.

Thanks,

Shambhu.

Former Member
0 Kudos

Thanks for the reply. But I am connecting to the MDM Repository using Webdynpro Java code as below:

Connect to MDM 7.1 using Webdynpro Java

// Setting a connection

ConnectionPool connections = null;

connections = ConnectionPoolFactory.getInstance("server");

// Getting the repository Id

RepositoryIdentifier reposId =new RepositoryIdentifier("repository","DBMS", DBMSType.MS_SQL);

RegionProperties dataRegion = new RegionProperties();

dataRegion.setRegionCode("engUSA");

// Set the locale on data region

dataRegion.setLocale(new Locale("en", "US"));

// Set the name of data region

dataRegion.setName("US");

CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);

sessionCommand.setRepositoryIdentifier(reposId);

sessionCommand.setDataRegion(dataRegion);

try

{

sessionCommand.execute();

}

catch (CommandException e)

{

e.printStackTrace();

}

// Fetch the session Id

String sessionId = sessionCommand.getUserSession();

}

catch(Exception e)

{

}

But when I execute it it gives me a Null value for the Session Id.

Please help.

Former Member
0 Kudos

Check this thread might be helpful -

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b06a6806-773c-2c10-c284-aa0c4035b...

context =

new UserSessionContext(server_name, repository_name,

username_name);

SessionManager.getInstance().createSession(

context,SessionTypes.USER_SESSION_TYPE, password);

Thanks,

Shambhu.

Former Member
0 Kudos

Hello Shambhu,

Thanks for the reply. I wrote those 2 lines of code but still getting Null value for Session Id , I printed the Exception I am getting which is as below:

com.sap.mdm.internal.protocol.manual.ServerException: The specified MDM repository was not found on the server

Please help

Former Member
0 Kudos

Please refer the SAP MDM Portal Content Development Guide - http://help.sap.com/saphelp_mdm550/helpdata/en/45/c87d0243e56f75e10000000a1553f6/frameset.htm

You can check the section - Connecting with the repository using System Object.

Try this and if it connects then your MDM Server is reachable from portal server. Use the repository user id and password for this connection. This setup does not take more than 5 minutes, so give it a try.

IF this doesn't work then there is some other issue in your connection to MDM server from portal.

Thanks,

Shambhu.

Former Member
0 Kudos

Please paste your action for resolution of this issue, so others can also follow the same.

Thanks,

Shambhu.

Former Member
0 Kudos

Database name provided in the following statement of code was wrong:

RepositoryIdentifier reposId =new RepositoryIdentifier("repository","DBMS", DBMSType.MS_SQL);

Thanks

Answers (0)