Skip to Content
avatar image
Former Member

To find out the string "https://mycomany.company.com:50001/irj/portal"

Hi Experts,

I have created WD program. The WD progam is running in say Development portal whose URL is as below- https://mycomany.company.com:50001/irj/portal

How I can find out the value of this string ("https://mycomany.company.com:50001/irj/portal" ) programatically inside the WD program. I believe there may some plug-in or any thing like that.

Please help.

Regards,

Gaurav

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 06, 2009 at 11:48 AM

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

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

    or

    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getServerName();

    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getServerPort();

    Remark:

    Using non-API classes like TaskBinder is not recommended, in NW 7.1 this will even be impossible.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All,

      The issue got resolved using following:

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

      I have used following code:

      	String hostName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();
      	
      	if (hostName.equalsIgnoreCase("ruepd.mycompany.com"))
         {
         if(!"".equals(wdContext.currentContextElement().getTripNumber())&&null!=wdContext.currentContextElement().getTripNumber())
      	wdContext.currentContextElement().
      	setUrl("https://ruepd.mycompany.com:50001/irj/portal?" +

      Regards,

      Gary