on 08-25-2005 6:47 AM
Hello Everybody,
I want to check whether my SAP R/3 system is up and running or not before calling any RFC from webdynpro or any other J2EE applications.
For that whether any fuctionality like ping is available in WAS 6.40?
Also i want to know what all exceptions can occur when calling any RFC, so that i can write code in advance for all those exceptions and take proper actions against them.
I am waiting for reply.Please reply as soon as possible its very urgent.
Thanks,
Bhavik Devisha
Hello all,
I didn't get answer for this question?
I want to know whether it is possible or not.
If yes, then how can we do that.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
why don`t you like JCO.Client.ping() method? Or, you can use same approach like in Dynpro content administrator:
public void onActionTestConnection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionTestConnection(ServerEvent)
String name = wdContext.currentJCOClientsElement().getName();
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
try {
IWDJCOClientConnection connection = WDSystemLandscape.getJCOClientConnection(name, null);
// Ping ...
JCO.Client client = connection.getClient();
client.ping();
// Create a new repository
IRepository repository = JCO.createRepository("MYRepository", client);
// Check used user
JCO.Function func = repository.getFunctionTemplate("USER_NAME_GET").getFunction();
client.execute(func);
String userID = (String) func.getExportParameterList().getValue("USER_NAME");
// Release the client into the pool
connection.release();
msgMgr.reportSuccess("JCo destination '" + name + "' was sucessfully tested with user '" + userID + "'");
} catch (Exception e) {
msgMgr.reportException(e.toString(), true);
}
//@@end
}
Best regards, Maksim Rashchynski.
Hello Bhavik,
> What is JCOClients node here?
Sorry, don`t really know details. I just checked sources of component.
> What is the value under name string?
I think it is name of JCo destination (e.g. WD_RFC_METADATA_DEST, WD_MODELDATA_DEST)
> If i have two JCO destinations, modeldata and
> metadata, then how can i ping server based on this
> connections?
If you are using adaptive RFC model you can get JCo.Client from model. Or you can pass name of JCo destinations to WDSystemLandscape.getJCOClientConnection.
Best regards, Maksim Rashchynski.
Hi Maksim,
Thaks for your kind help.
I have one more question. We can check using this ping functionality that server is running or not.
But, this code will help to Modeldata connections only. But, if some error oddurs for Metadata connection, then how can we catch that exception in our webdynpro application?
It thorws error before executing our code.
Regards,
Bhavik
Hi Bhavik,
For me 2 options seems to be a workaround:
1) Try to find a place which is called before throwing exception and call check there. Try to set breakpoints in wdInit and constructor of componentController for example.
2) Create another component which has no dependecies to model and check backend availability there and after navigate to component with dependecies.
Best regards, Maksim R.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.