cancel
Showing results for 
Search instead for 
Did you mean: 

Need to write a login method which logs to MDM Repository using Web Dynpro

Former Member
0 Kudos

Hi,

I need to login to SAP MDM Repository by a Java Project made using Java Web Dynpro.

I wrote the Login method and called it in main() method.

package searching;
import a2i.common.A2iField;
import a2i.common.A2iResultSet;
//import a2i.common.CatalogData;
import a2i.common.ResultSetDefinition;
import a2i.core.StringException;
import a2i.core.Value;
import a2i.search.Search;
import a2i.generated.RepositoryInfo;
import com.sun.corba.se.ActivationIDL.Repository;
/**
 * @author kaushikb
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class TestSearch {
public static void main(String[] args) {
		Repository rep;
		CatalogData.Login("http://10.114.20.9", //ServerAddress
		2399,//port
		"Admin", //UserName String
		"", //Password
		"English[US]", //LanguageTag
		"log.txt"); //LogFileName
}
class CatalogData {
// Login Method. 
//Opens a Connection to the MDM Server.
Repository rep;

	public static Repository Login(String serverName, int port,String userName,
	String passWord, String regionTag, String logfile) {
		Repository MyRep = null;
		Login(serverName, port, userName, passWord,regionTag,logfile);
		return MyRep;
	
	}
}

But this code is logically wrong and will run into StackOverFlow Exception due to Recursion in Login method.

Second Login method does not properly define what to do with the parameters passed and Repository instance MyRep returns a null value.

Need some valuable suggestion on writting the Login method.

Regards

Kaushik Banerjee

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kaushik,

FYI

Now we can delete the thread if posted mistakenly or if you dont want the replies. But it is possible if no one has replied to the thread else you can mark the thread status so that no one should reply it further.

Regards,

Jitesh Talreja

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Ignore the previous post. As the method is irrevelant with basics of Java Fundamentals violated.

As object MyRep seems to be calling static method Login() which is not possible.

I just took the code from article.

It is better to use provided Login() methods A2i to login to MDM Repository.

I need to know, do a2i.*; have any method which can be used as Login() method to login to

MDM Repository.

Regards

Kaushik Banerjee

Edited by: Kaushik Banerjee on Dec 17, 2008 5:47 AM