SDK : how to get the server adress and port ?

Almost everything is in the title, I'm look for code to get the server URL and port where the ME is running ;o)
There should be some standard API I guess.
Thanks
Regards

Hi,
In the code that I write I usually have access to the HTTP Request Object.
String serverName = request.getServerName();
String serverPort = request.getServerPort();
Then I just do a compare on the returned value to see if I am on our Test or Production server.
if(request.getServerName().indexOf("prodservername") >= 0)
  // PRODUCTION CODE HERE
else
  // TEST CODE HERE
Hope this helps,
Mike

Similar Messages

  • How to get the Host name and port number

    Hi all,
    I am working in xRPM. I need to get the server name, host name & port number for the portal and i need to diaplay as a link in the Workflow step. I cant give the portal link as static, as it will vary depends on the DEV, QUAL, PROD. Is there any FM or class is available, so i can get the server name, port no. for my purpose?.
    Regards,
    Vinoth

    Hi Kanagaraja,
    My client has configured the portal and backend in different stack. So when i execute the FM you provided and with class: CL_HTTP_SERVER, CL_WD_UTILITIES, i am getting only the backend host name and port no. not the portal's info. So please help is there any way we can get the portal's info.
    Thanks for your reply.
    -Vinoth

  • Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA

    Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA

    This question has already been addressed in this thread:
    Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa?
    John M
    National Instruments

  • Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA

    Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA

    Hello,
    Exactly which USB device are you referring to? Is the device a NI product?
    The Product ID for National Instruments DAQPad-6020E is 0x12C0. The USB vendor ID is 0x3923. This is a 16-bit hexadecimal number(1093) (that is decimal 4243).
    Also, here's a document on our website that will help you in configuring NI-VISA to control your USB device:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/6792BAB18242082786256DD7006B6416?opendocument
    Swapnil P.
    National Instruments Engineer

  • How to get the kerning value and set it to back use script?

    hi,guys
    I come back again.
    I encountered a kerning problem.
    how to get the kerning value and set it to back use script?
    Thanks very much!

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • How to get the server name/hostname on which JVM is running?

    How to get the server name/hostname on which JVM is running from the Servlet or normal class?

    InetAddress.getLocalHost()

  • I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    You can contact iTunes Support via this page (we are fellow users here on these forums) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • When I went and connected  phone to my laptop and hit restore and it got rid of everything my photos my contacts everything and I don't know how to get the stuff back and if you need to know I have an IPhone4S

    When I went and connected my phone to my laptop and hit restore and it got rid of everything my photos my contacts everything and I don't know how to get the stuff back and if you need to know I have an IPhone4S

    I take it you were replacing an older iPhone and this was the first time you plugged it in? If so, that's what happens. It restored the backup of your old phone. A backup of the current phone is not made in those circumstances.
    If that's not what happened, you need to clarify.

  • How to get the Equipements number and desciption for the contract item ?

    Hi Gurus,
            How to get the Equipements number and desciption for the contract item items? It would gr8 helpful to me...
    VBAP,,EQUI,,,,,,?
    Thanks
    Krisna

    Check with below tables :
    EQUI    Equipment master data
    EQKT   Equipment short text
    EQUZ   Equipment time segment
    Thanks
    Seshu

  • How to Know Oracle server id and port

    Dear all
    I try to run oracle report in jdeveloper
    i make the java files that calling the report as from i found in the internet as follow
    OracleReportBean reportBean =
    new OracleReportBean(server id, port, null);
    reportBean.setReportServerParam(OracleReportBean.RS_PARAM_DESTYPE,"cashe");// which will be one of the [cashe - file - mail - printer]
    reportBean.setReportServerParam(OracleReportBean.RS_PARAM_DESFORMAT,"PDF"); // Which will be onr of the [HTML - HTML CSS - PDF - SPREADSHEET- RTF].
    reportBean.setReportParameter("xxx", "ssss");
    reportBean.setReportParameter("kkkk", "uu");
    String url = reportBean.getReportServerURL();
    reportBean.openUrlInNewWindow(url);
    But i do not know what is the server id and port
    and how to specify the report name in the code.
    Please help me in this issue.
    Best Regards;

    I think that the serverid and the port is the ip of your report server and the port. (default 7779)
    see this post http://sameh-nassar.blogspot.com/2010/07/call-oracle-reports-from-your-adf.html
    so I can see, the name of the report is indicated via parameter
            //launch report
            testBean.setReportServerParam(OracleReportBean.RS_PARAM_REPORT, "name_report.rdf");
            testBean.setReportServerParam(OracleReportBean.RS_PARAM_ORIENTATION, OracleReportBean.ORIENTATION_PORTRAIT);
            testBean.setReportServerParam(OracleReportBean.RS_PARAM_DESFORMAT, OracleReportBean.DESFORMAT_PDF);

  • How to get the server port and id from the Initialcontext

    hi
    i know that i can get the server port and id where the jndi service is listening from the InitialContext ( when i create InitialContext ic = new InitialContext(); from within a EJB. ). Does this work on any application server and where (at what position is for example the port) in the Enumeration at the ic are the different things put?

    I would usually just get the PROVIDER_URL property from the InitialContext and use that to determine the location of the naming service:
    String providerURL = (String)ic.getEnvironment().get(Context.PROVIDER_URL);You'll then need to parse that string to obtain the port and the server name. For example:
    // Assume that the provider URL is of form "protocol://server:port"
    int serverStartIndex = providerURL.indexOf("://" + 3);
    int serverEndIndex = providerURL.indexOf(:, serverStartIndex);
    String server = providerURL.substring(serverStartIndex, serverEndIndex);
    String port = providerURL.substring(serverEndIndex + 1);It's a fairly universal approach but there'll doubtlessly be some special cases (for example, the provider URL could be null and the InitialContextFactory class defaults it).
    You might have to adjust the server/port parsing stuff a bit as I just made that up and your URL might not conform to the pattern I described.
    Hope this helps.

  • How to get the client date and time ?

    Dear Sirs...
    Using jdeveloper 10.1.2.0
    How can i get the client date and time using the HttpServletRequest ?
    thanks for any help in advance
    best regards

    If your code is running on the client pc you can just create a new instance of the java.util.Date class. That class automatically defaults to the current time of the client machine. Otherwise if you're running the code on the server, you could insert/post the client date/time by adding its string representation as a parameter to the HTTP request object.
    Ronald

  • How to get FMS server time and date

    hi,
    i m working on a customer support chat application. There is
    neccssary for me to get the FMS server time and date, bcoz
    depending on the server time and date the client instances recive
    different messages.
    i looked at date() function on FMS server, but it returns
    user PC time ( not FMS server time).......
    so i there any way to get FMS server date and time??
    thanks in advance
    shrikant

    See this post.
    How To Display Time Information in Report/Results?
    http://forums.ni.com/t5/NI-TestStand/During-a-test-how-can-I-find-the-start-time-and-date-of-that/td...
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • How to Get the Login Window and/or Bypass Login Items?

    Greetings, folks!
    This is a silly question, but the old standby of “hold down the shift key” doesn’t work in 10.6.1:
    What key(s) need to be pressed to get the LogIn window and then after LogIn, to bypass LogIn Items?
    Thanks!!
    Richard Fairbanks

    Not here, on a fresh (erased) install.
    Pressed either before or after the initial gray Mac appears, the shift key does not access the LogIn screen. It is possible to bypass the account’s LogIn items by holding down the shift key after the LogIn screen has been called and successfully commenced, but how does one call the Login screen when the Mac is normally set up for automatic login?
    It used to be the shift key . . . 
    Thanks!

  • How to get the Server Name in Crystal

    Hi All,
    We created a Crystal Report that pulls images from a File Location at the run time and this File Location is different for each environment (D-Q-P). We are trying to automate the file location by the server name. Is there any function in Crystal Reports that we can get the server name so we know if it is D-Q or P system?
    Thank you,

    Hi,
    There is no function in CR that can fetch the Server Name. That is something you need to provide to the formula.
    If you're loading images from a location on the Server, you can always use a Relative Path. For eg: if the images would be stored in a folder called Images, then you can write a formula on the 'Graphic Location' for the OLE object as:
    "/Images/Crystal.jpg"
    This will load the image from the folder when it is run on D, Q or P.
    Hope this helps!
    -Abhilash

Maybe you are looking for

  • Error in app

    hi gurus,              i am get the error which says payment proposal could not be carried out when i am running the app in f110. i seen open items properly.

  • Java error in Reports

    Hi. I was trying the barcode report. After importing the classes , i written code in the before parameter trigger. In the trigger there is code like Barcode.BarcodeObject := Barcode.new(); While compiling it is showing an error in this place as "comp

  • ORDERED hint in Oracle 11gR2

    Do we have any difference in 11g with the way /*+ ORDERED */ hint works, compared to 10g? Will this hint cause a plan change in 11g, compared to its plan when used in 10g (assuming no other items contribute to a change of plan)?

  • MB52 doesn't show return quantyties values

    Dear experts After sales return, the qty shows under 'Returns'. But in MB51, corrosponding values are not shown under any column. can anybody guide on this issue, where i can see the return qty values? or in sap, return values doesn;t show in MB51? T

  • Reinstall Windows on raid array

    Hello all, I have 2 arrays running a 0+1 which windows in installed on and a raid 1 which my games are installed on. I originally built the array after windows was installed so I didnt have this issue.... I want to reinstall windows on the same array