Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem on getting detination

Hi all,

I'm tring to get destination from detination service (I inserted the address manually using Visual administrator).

Here the code I used, it seems to be very strange, but it doesn't works fine.

public String connectToHTTPDestination()


String res = "";


InitialContext ctx = new InitialContext();


DestinationService dstService = (DestinationService) ctx.lookup(DestinationService.JNDI_KEY);

if (dstService == null)

throw new NamingException("Destination Service not available");

Destination destination = dstService.getDestination("HTTP","dst-1");

// for HTTP destination: cast

HTTPDestination httpDestination = (HTTPDestination) destination;

// obtain a HTTPUrlConnection from the destinationHttpURLConnection

try { httpConnection = httpDestination.getURLConnection();


} catch (ConfigurationException e) {res = e.getMessage();

return res;};

}catch (DestinationException e) {res = e.getMessage();

return res;}

catch (RemoteException e) {res = e.getMessage();

return res;};

} catch (NamingException e) {res = e.getMessage();

return res;};

return res;


Thanks a lot,


Former Member
Not what you were looking for? View more on this topic or Ask a question