cancel
Showing results for 
Search instead for 
Did you mean: 

WDURLGenerator.getApplicationURL problem

Former Member
0 Kudos

Hello experts,

We have recently upgraded our WAS from SP12 to SP16 and I noticed that the url generated in my application is no longer working. please see below for example.

<u><b>Before upgrade</b></u>

Click on link to process request : http://<hostname>:51800/webdynpro/dispatcher/sap.com/wd_approver/ApproverInbox?requestID=0000000454

<u><b>After upgrade</b></u>

Click on link to process request : ../../sap.com/wd_approver/ApproverInbox?requestID=0000000472

Can somone kindly advise what may have gone wrong and what can I do to rectify the problem ? Thank you very much.

from

Kwok Wei

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Kwok Wei,

Can you explain how new behavior breaks your code. The generated URL is applicable for Link2Url, opening external window etc... What is your use case, i.e. how generated URL is used?

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Kwok wei,

Please go through the following doc.

https://wwwn.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/webdynpro/int...

Try this

try{

WDDeployableObjectPart appPart =

WDDeployableObject.getDeployableObjectPart(

wdComponentAPI.getDeployableObjectPart().getDeployableObjectName(),

"<<AppName>>",

WDDeployableObjectPartType.APPLICATION);

String applicationURL2 = WDURLGenerator.getApplicationURL(appPart);

}

catch(Exception e)

{

}

Regards, Anilkumar

Former Member
0 Kudos

Hi Anilkumar,

Here is my code for generating the URL. It was working in SP12 but ever since we upgraded to SP16, it breaks.

// Generate URL string with parameter requestID to be send over the url.

try {

urlToApprover = WDURLGenerator.getApplicationURL("sap.com/wd_approver", "ApproverInbox");

String parameters = "?requestID=" + requestID;

urlToApprover = urlToApprover.concat(parameters);

} catch (WDURLException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

wdComponentAPI.getMessageManager().reportWarning("Problem generating URL (SendEmail2Approver): " + e1);

}

from

Kwok Wei

Former Member
0 Kudos

Hi,

I think the way getApplicationURL() works has been changed after the upgrade. But you can always go for a work-around Here it is:

...

Regards,

Satyajit.

Message was edited by:

Deleted coding fragment as it invokes unsupported internal FPI.

Regards, Bertram, Web Dynpro Java Forum moderator

Former Member
0 Kudos

Satyajit,

Besides the fact that you are using non-API WD classes, your code in general looks wrong for me:

WDProtocolAdapter.getProtocolAdapter().getRequestObject().<b>getClientHostName</b>()

Are you sure client host name is name of WebAS server?

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hello Valery,

I tried the suggestion by Satyajit and it does not seems to work. Btw, is WDProtocolAdapter only available in NWDS04s ?

from

Kwok Wei

Former Member
0 Kudos

Kwok Wei,

<i>Btw, is WDProtocolAdapter only available in NWDS04s ?</i>

Yes, in NW04 it is WDWebContextAdapter.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

In that case, do you know of a work around that I can use ? My url that is generated is no longer working after the upgrade to SP16.

from

Kwok Wei

Former Member
0 Kudos

Valery,

Looking at the help document,

<i>public java.lang.String getClientHostName()

Returns: the client host name, from which the request originates</i>.

So looks like it returns the name of the WebAS server.

And as for using TaskBinder, yeah, I know it's forbidden. But couldn't help it, sorry. I'll revert my suggestion.

Regards,

Satyajit.

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo all,

Read SAP <a href="https://websmp130.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=864842&nlang=E&smpsrv=https%3a%2f%2fwebsmp107%2esap-ag%2ede">Note 864842 - InvalidUrlRuntimeException (Web Dynpro) Note 864842 - InvalidUrlRuntimeException (Web Dynpro)</a> which covers this topic.

Regards, Bertram

Former Member
0 Kudos

Satyajit,

<i>Looking at the help document,

public java.lang.String getClientHostName()

Returns: the client host name, from which the request originates.

So looks like it returns the name of the WebAS server.</i>

By cite you provided, it looks rather like name of user's computer where client-side part of WD application running.

VS