cancel
Showing results for 
Search instead for 
Did you mean: 

SLD - retrieve the SLD System Data via JAVA

Former Member
0 Kudos

Hi,

I try to access the SLD and retrieve the SLD System Data via Java Program(using Servlet).

But i always get an empty jco Destinations array.

Please see the java code below:


ClientFactory factory = ClientFactory.newInstance();
	try {
		
final URL url = new URL("http", host, port, "/sld/cimom");
HttpRequestSender requestSender = 
new HttpRequestSender(url, user, password);
		
CIMOMClient cimomClient = new CIMOMClient(requestSender);
		
CIMClient cimClient = new CIMClient(cimomClient);
		
SAP_JCODestinationAccessor jcoAccessor = new SAP_JCODestinationAccessor(cimClient);
		
SAP_JCODestination[] jcoDestinations      = jcoAccessor.enumerateSAP_JCODestinationInstances();

the varible - "jcoDestinations" return rempty

Am I on the right track?

Can someone provide me a code snippet, link, document,... where i can find more information how to access the SLD

Thanks

Boris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This is very similar, but I'm using the App Server Jco Destination. It is different from the Jco Destination.

CIMInstancenameList ciminst = null;
			
SAP_AppServJCODestinationAccessor jdsa = null;
SAP_AppServJCODestination jds[] = null;

// connect to the given sld url with the given usernamd and pwd
URL url = new URL(sldUrl);
			
ClientFactory factory = ClientFactory.newInstance();

CIMOMClient client = factory.createClient (url, sldUsername, sldPassword);
CIMClient cc = new CIMClient(client);
CIMClientHandle cch = (CIMClientHandle) cc;
// access the app serv jco destinations and enum them
jdsa = new SAP_AppServJCODestinationAccessor(cch);
jds = jdsa.enumerateSAP_AppServJCODestinationInstances();

Thanks,

Ray

If helpful, please award points.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Does any one have the Java doc API for "com.sap.lcr.api"

Thanks an advance

Boris

Former Member
0 Kudos

Use JAD, Luke

Former Member
0 Kudos

Thanks a lot Ray and Maksim.

Its working fine now, I managed to retrieve JCO definitions.

But I have another question:

How can I retrieve J2EE/R3 System Landscape data from the SLD (for example- J2ee servers names and ports, patch versions, etc).

Thanks

Adam.

Former Member
0 Kudos

I haven't done this yet, but in NWDS, go to Package Explorer, find your project, and open up the SAP_SYSTEM_ADD_LIBS ... com.sap.lcr.api.cimclient and then open com.sap.lcr.api.sapmodel; you will see the literally hundreds (if not thousands) of classes in this jar. One that looks like it might apply is SAP_ApplicationSystemInstance.class. Open that up and you see the methods listed; such as getHostName, getSAPSystemName, getInstanceNumber, ...

There are many others that may apply as well, so you might have to write some test code and review the data coming back.

Ray

former_member182372
Active Contributor
0 Kudos

Hi Boris,

Check whether you really have JCo destinations on your SLD. Code looks OK and in case it runs without exceptions it seems like you don`t have JCo destinations.

Best regards, Maksim Rashchynski.