cancel
Showing results for 
Search instead for 
Did you mean: 

How to get full URL of webdynpro application

Former Member
0 Kudos

Hi All

I am using WDURLGenerator to get the URL of application. But i get the relative URL

../../test.com/test/TestApp

How can i get full URL

http://<hostname>:<portname>/webdynpro/dispatcher/test.com/test/TestApp

basically i want to know how can we get the hostname and portname where the application is deployed.

Regards

Sonal.

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi,

You need to use the getAbsoluteWebResourceURL(deployableObjectPart) API of the WDURLGenerator for the complete path.

Kind Regards,

Nitin

Former Member
0 Kudos

Hi,

try this

String hostName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();

int port = TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort();

Thanks,

Ramani.P

Former Member
0 Kudos

Hi have already mentioned that i used WDURLGenerator API

String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

try {

WDDeployableObjectPart deployableObjectPart =

WDDeployableObject.getDeployableObjectPart( deployableObjectName, "PostApp",

WDDeployableObjectPartType.APPLICATION);

String urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart, new HashMap());

} catch (WDURLException e) {

wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);

} catch (WDDeploymentException ex) {

wdComponentAPI.getMessageManager().reportException(ex.getLocalizedMessage(), false);

}

But the problem is i am unable to get the full URL including hostname and port name.

Former Member
0 Kudos

Hi,

Use this code,

String url = WDURLGenerator.getApplicationURL(deployableObjectpart,urlparameters);

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi,

Try this one.

String temp = WDURLGenerator.getApplicationURL(wdComponentAPI.getApplication().getDeployableObjectPart());

Use try,catch blocks to capture the WDUrlException Exception.

regards,

Srikanth Reddy.T

nikhil_bose
Active Contributor
0 Kudos

[WDURLGenerator|http://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/services/sal/url/api/WDURLGenerator.html#getApplicationURL(com.sap.tc.webdynpro.services.sal.deployment.api.WDDeployableObjectPart)].getApplicationURL( WDDeployableObjectPart deployableObjectPart);


	try{
		  String temp = WDURLGenerator.getApplicationURL(wdComponentAPI
		  	                .getApplication().getDeployableObjectPart());
		 
		}catch( WDURLException e){ }

Nikhil

former_member192434
Active Contributor
0 Kudos

Hi

try to use

String getApplicationURL(WDDeployableObjectPart deployableObjectPart, Map urlParameters)

Thanks

Former Member
0 Kudos

Sonal,

check this

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress()

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName()

Thanks

Bala Duvvuri

Former Member
0 Kudos

Hi Bala

The i am unable to get the hostname as per your stated method. I got some IP address which even did not match my host file entry

Regards

Sonal

Former Member
0 Kudos

Hi,

check the following thread may be some use

[]

Regards

Raghu

Edited by: Raghunandan Madarikuruva on Jan 5, 2009 1:04 PM