on 06-22-2004 6:19 AM
Hi,
Is there any way to get SAP system connection from SLD . I don't want to manually code JCO client code mentioning the user/password.
Thanks
Naresh
Hi Naresh,
you can access JCO connections in the SLD using the Web Dynpro runtime service WDSystemLandscape. Please have a look at the following documentation: http://help.sap.com/saphelp_nw04/helpdata/en/25/19e7752be1c8459258a072d87e3a34/content.htm
Note: Connections created/managed by the WD content admin will have no password assigned, these are stored in the secure storage.
Hope that helps.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
i did this sometime ago, but i'm not sure, if this is the recommended and only possible way to do this:
There's an SLD application service available (JNDI name "applsld") which returns a reference to an instance of "SldApplicationServiceInterface".
To get the class at design time you have to add: SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/tc/sld/dp/j2ee/_comp/gen/default/public/default/lib/java/sldserv.jar to your build path.
To get the class at runtime add a Service reference to service "sld", provider "sap.com".
Lookup:
try {
InitialContext ctx = new InitialContext();
sldAppService = (SldApplicationServiceInterface) ctx.lookup("applsld");
} catch (NamingException e) {
...
}
From this point you can create a CIMOMClient and use this for SLD "browsing". Hope this hasn't changed in the meantime. Maybe somebody knows a better/easier way.
Best regards
Stefan
Hi Stefan,
Thanks for the Information, but still some Queries .
In our project we are planning to use sso logon tickets to connect to External R/3 System. In web Dynpro Content Admin we can use this option , But in SLD I was unable to find the same. Can u please tell me If there is some option like that in SLD. Pointer to releavant document will really help .
Thanks
Naresh
Hi Naresh,
the option "useSSO" should be available in a combobox at the bottom of the JCO connection definition page in SLD (default is "useDefinedUser"). The properties are rather well documented in the SLD itself using the corresponding help buttons. Additionally there's configuration/usage documentation available here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sso overview.pdf
Hope that helps.
Best regards
Stefan
Hi Stefan,
hm... it seems you know what you're talking about. I read the whole thread, but I'm still not able to get anything useful out of the sld. Basically, I'd want to call the SLD and get information about a named JCO connection (much like what WDSystemLandscpae.getJCOClientConnection("xyz") is probably doing internally).
OK, here's what I got to work so far:
ClientFactory factory = ClientFactory.newInstance();
URL url = new URL("http://localhost:50000");
CIMOMClient client = factory.createClient(url, "admin", "password");
CIMInstancenameList instList = client.enumerateInstanceNames(CIMNames.C_SAP_JCODestination);
for (int i = 0; i < instList.size(); i++)
{
CIMItem item = instList.get(i);
System.out.println(item.toString());
}
But, I have no clue how to get the JCo connection parameters out of this. The API does not really help at all.
Any suggestions would be appreciated.
Regards,
Matthias
Hi Matthias,
(probably for internal use) there's a client library available which provides access to the SAP CIM model:
SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/com.sap.lcr.api.cimclient/_comp/gen/default/public/default/lib/java/lcrclient.jar
After adding the reference to your project you may use something like this (client is the CIMOMClient you already have):
CIMInstancenameJavacimobject cimObjects[] = null;
try {
SAP_JCODestinationAccessor accessor = new SAP_JCODestinationAccessor(client);
cimObjects = accessor.enumerateInstances(false, true, null);
} catch (LcrException e) {
...
}
if (cimObjects != null) {
SAP_JCODestination dest = null;
for (int ix = 0; ix < cimObjects.length; ix++) {
dest = (SAP_JCODestination) cimObjects[ix].getJavaCIMObject();
System.out.println(dest.getSystemName());
/* More properties available */
}
}
Hope that helps.
Best regards
Stefan
PS: I nearly always no, what i'm talking about, when i'm at all talking about something
Hi all,
thanks Stefan , even though you replied quickly to my email i was able to figure it out by myself in the meantime. So just to post the complete code:
ClientFactory factory = ClientFactory.newInstance();
URL url = new URL("http://localhost:50000");
HttpRequestSender requestSender = new HttpRequestSender(url, "admin", "password");
CIMOMClient cimomClient = new CIMOMClient(requestSender);
CIMClient cimClient = new CIMClient(cimomClient);
SAP_JCODestinationAccessor jcoAcc = new SAP_JCODestinationAccessor(cimClient);
SAP_JCODestination[] jcos = jcoAcc.enumerateSAP_JCODestinationInstances();
for (int i = 0; i < jcos.length; i++)
{
SAP_JCODestination jco = jcos<i>;
System.out.println(jco.getName());
}
Regards,
Matthias
Hi Matthias,
well done. But as a final tip it would be better if you get a reference to the current J2EE engine cluster and use the associated instances of type "hosted JCO connection" for the list retrieval. This will only return the connection instances which are relevant for the current system. Otherwise you might get lots of connection definitions (especially in "real world" production systems) which you aren't really interested in
Best regards
Stefan
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.