on 11-30-2005 10:56 AM
Hi All,
I want to fetch BW server details(that i ve configured in the j2ee engine)from j2ee engine, from webdynpro.Can any one tell me how i can go about it.
Thanks and Regards,
Debashree.
Hio Debashree,
Where have you configured the details in the j2ee engine?And for what purpose you are doing so?
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
I ve configured the details in visual administrator>services>destination-->HTTP.There upon clicking the new button a new server detail can be entered.
For the second part of the question let me explain to you the requirement.I ve a report where the data has to be populated from BW.So, to display the data first the BW Server details will be needed at runtime in webdynpro(from where the data will be fetched).That is why i need the server details.
Best Regards,
Debashree.
Hi Deebashree,
Try out the following
Create a webdynpro project
Go to J2EE perspective
Go to Package Explorer view
Right click on the webdynpro project and choose "Set Additional Libraries"
Select security.class and tc/sec/destinations/interface.
Click OK
Give these imports
import com.sap.security.core.server.destinations.api.DestinationService;
import com.sap.security.core.server.destinations.api.Destination;
import com.sap.security.core.server.destinations.api.DestinationException;
import com.sap.security.core.server.destinations.api.HTTPDestination;
Wherever you want to get the destination do the following
try
{
InitialContext ctx = new InitialContext();
DestinationService dstSer = (DestinationService)
ctx.lookup(DestinationService.JNDI_KEY);
if (dstSer == null)
throw new NamingException("Destination Service not available");
Destination destination = dstSer.getDestination("HTTP","test");
//for HTTP destination: cast the destination to httpdestination
HTTPDestination httpDestination = (HTTPDestination) destination;
//obtain a HTTPUrlConnection from the destinationHttpURLConnection
HttpURLConnection httpConnection = httpDestination.getURLConnection();
}
catch(NamingException ne)
{
wdComponentAPI.getMessageManager().reportSuccess("Naming exc..."+ne);
}
catch(RemoteException re)
{
wdComponentAPI.getMessageManager().reportSuccess("remote exc..."+re);
}
catch(DestinationException de)
{
wdComponentAPI.getMessageManager().reportSuccess("destination exc..."+de);
}
catch(ConfigurationException ce)
{
wdComponentAPI.getMessageManager().reportSuccess("Config exc..."+ce);
}
Hope this helps you
Regards
Rohit
Message was edited by: Rohit Radhakrishnan
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.