cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving ServerHost and ServerPort in Server with Web Dispatcher

Amey-Mogare
Contributor
0 Kudos

Hi,

I am using IWDRequest to get server host and port in my Web Dynpro DC.

This is the code which I am using for it.


IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String l_str_host = req.getServerName();
int l_int_port = req.getServerPort();

In our NW landscape, some servers have Web Dispatcher for load balancing purpose. Hence in this case, what would I get in l_str_host, l_int_port ?

I need them to prepare KM URL to a specific location.

Thanks and regards,

Amey Mogare

Accepted Solutions (0)

Answers (1)

Answers (1)

Amey-Mogare
Contributor
0 Kudos

Hi,

I finally managed to achieve it through following :-


		IURLGeneratorService ug = (IURLGeneratorService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.URLGENERATOR_SERVICE);
		l_str_kmurl = ug.getAbsoluteUri(PathKey.CONTENT_ACCESS_PATH).toExternalForm()