on 12-01-2009 2:44 PM
Hi All,
In order to fetch jco details i am using the following code in a java class in java dc.The java dc is deployed using a j2ee server library DC and then i call the java method getPassword() in a web dynpro dc
public String getPassword()
{
String password=null,strUser=null;
try{
String myDestination = "jcotest";
IWDJCOClientConnection client =
WDSystemLandscape.getJCOClientConnection(myDestination);
strUser = client.getUser();
password = client.getPassword();
}
catch(Exception e)
{
e.toString();
password=+e.toString();
}
return password+"a"+strUser;
}
}
Iam getting a nullpointer exception in IWDJCOClientConnection client =
WDSystemLandscape.getJCOClientConnection(myDestination);
Any pointers?The same code works fine in a standalone web dynpro dc application
Regards
Shilpa
Hi Shilpa
It's easy to answer the question. Usage WebDynpro API outside WebDynpro applications is very restricted! The API will not work in standalone server library DCs. You can use the API only in WebDynpro application or at least in the places (libraries) directly invoked from WebDynpro application. Because the API requires opened WebDynpro client session. Without the session it'll not work.
In you case I'd suggest to use J2EE Destination Service API to work with JCo destinations (do not mix with WebDynpro JCo destinations).
BR, Siarhei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for the reply.
But incase if i use Destination Service it gives me class cast exception in
RFCDestination dst =
(RFCDestination) dstService.getDestination("RFC", "dst-2");
where dst-2 is a destination created in VA.
I need to fetch the details in java dc.So as to deploy it im deploying it in j2ee library server sc and calling the method in web dynpro dc to test the result.
Any poiters for the same as to the steps i should follow in order to use destination service.
Regards
Shilpa
Hi Shilpa
See the following information about Destination Service:
[Destination Service API|http://help.sap.com/saphelp_nw70/helpdata/en/8b/8e7dac1e661d44bf2a676fd3948cc6/content.htm],
[Examples for Using the Destination Service API|http://help.sap.com/saphelp_nw70/helpdata/en/17/d609b48ea5f748b47c0f32be265935/content.htm]
BR, Siarhei
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.