Skip to Content

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

Get HTTP destination

Hi all,

I inserted an HTTP destination in the Destination Service (Visual administrator) and I need to get it in my Java Web Dympro. I found this code:

	DestinationService dstService = (DestinationService)
	ctx.lookup(DestinationService.JNDI_KEY);
	if (dstService == null)
	throw new NamingException("Destination Service not available");
	Destination destination = dstService.getDestination("HTTP","sso_givaudan_OpportunityLink");
//	  for HTTP destination: cast
	HTTPDestination httpDestination = (HTTPDestination) destination;
//	  obtain a HTTPUrlConnection from the destinationHttpURLConnection
	httpConnection = httpDestination.getURLConnection();

I imported all the libraries, but NetWeaver underline in red the follow:

ctx : cannot be resolved

Why?? Thanks for your help.

Vito

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