Java - dynamically determining endpoint

I have, until now, hard coded the endpoint for my integration. A customer is having issues logging in through the API. I assume the issue is with this hardcoded endpoint as the url they have sent me for login to OCRMOD is different to the url that I use to login in to my developer account.
I assume just as interactive users have different endpoints so do API users.
My question is how do i programmatically determine the correct endpoint for a user?
Thanks
Andy

Alex,
Thanks for all your input and time.
I think I am beginning to understand the way CRMOD is organised now. Basically there is no ONE instance, it is a collection of instances/pods/servers and which instance an individual uses is not simply a dynamic loadbalancing issue, but a fixed endpoint for that user/organisation.
This gives us a problem in what we are trying to achieve - an integration with our application - because we would require users to also be aware of this fact i.e. what is the unique url that you use to login to CRMOD. This is messy but it appears that there is no way around the fundamental hosting architecture of CRMOD. We will probably store the url against an organisation and use this for login.
Thanks again
Andy

Similar Messages

  • Is there a way to dynamically determine the number of out parameters for a server side procedure?

    Hi,
    Below is a helper method used for calling a server-side function which loops through the inbound bindVars parameter to populate the function's IN parameters. Is there a way to dynamically determine the IN/OUT parameters based on the procedure name in the stmt parameter? No members of the CallableStatement class seemed promising, but the getParameterMetaData() method in the PreparedStatement class seemed like it could be helpful lead. However, I have not found any detailed descriptions (yet) of how to use it.
    protected Object callStoredFunction(int sqlReturnType, String stmt,
      Object[] bindVars) {
      CallableStatement st = null;
      try {
      // 1. Create a JDBC CallabledStatement 
      st = getDBTransaction().createCallableStatement(
      "begin ? := "+stmt+";end;",0);
      // 2. Register the first bind variable for the return value
      st.registerOutParameter(1, sqlReturnType);
      if (bindVars != null) {
      // 3. Loop over values for the bind variables passed in, if any
      for (int z = 0; z < bindVars.length; z++) {
      // 4. Set the value of user-supplied bind vars in the stmt
      st.setObject(z + 2, bindVars[z]);
      // 5. Set the value of user-supplied bind vars in the stmt
      st.executeUpdate();
      // 6. Return the value of the first bind variable
      return st.getObject(1);
      catch (SQLException e) {
      throw new JboException(e);
      finally {
      if (st != null) {
      try {
      // 7. Close the statement
      st.close();
      catch (SQLException e) {}
    James

    The PreparedStatement.getParameterMetaData() object is exactly what you need for this task.
    Once you have the ParameterMetaData you can ask it how many parameters are present and which mode they are. The parameters are numbered from 1 to n and you can use ParameterMetaData.getParameterMode(1); to get the mode of the 1st parameter. The modes are defined as static values in the ParameterMetaData object. Check out the doc at http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html
    Timo

  • How to dynamically determine Receivers within BPM

    I’m trying to design a way to determine my receivers within my BPM process during runtime.   My Scenario is as follows:
    SAP IDOC
        V
      XI
                 XI uses JAVA Mapping MT1 to determine vendors and if customer receives PIDX
                             JAVA Mapping MT2 to creates the PIDX output file if required
      V
    SENDs to required Vendor (PIDX if required otherwise email)
    My problem is how to dynamically determine the appropriate receiving vendor for my PIDX.
    I can not use the condition editor on the standard Receiver Determination because the output message (PIDX) doesn't have specific enough information to determine the vendor.
    Other than the customer number there are no other values and we don't want to use customer number because each vendor can have multiple customer numbers (hundreds).
    I've tried various attempts but none seem to work.  This could also be because I have limited knowledge of BPMs and this is my first complex development.  Below are the different attempts I've made at dynamically determining the receiver.  Any input would be appreciated.
    Receiver Scenario 1 
      I developed an interface mapping with MT1 as input and the SAP Receiver Determination as output.  The problem is for me to use this, the interface mapping had to reference the PIDX output (MT2 instead of MT1) which has no data that I can use to determine the receiver.
    Receiver Scenario 2
    I added a receiver step right before my send step and used the receiver list.  This appears to send the PIDX to everyone in the list and there is no way to evaluate or eliminate a name from the list. 
    Receiver Scenario 3
    I created a context object in the Integration Builder and assigned it to a field in MT1.  I then added a switch step with a branch for each vendor.  Within each specific branch there is a Send step that has the context object name I created in the "Send Context" field.  However, on the configuration side I’m unable to access the context object which I created on the design side.  Whenever I open the condition editor and select the radiobutton for "Context Object" the list  does not include the context object I created in the Integration Builder.

    Hi,
    Try using the enhaced receiver determination concept.
    Maybe based on certain field values you can write a UDF which calculates the receiver.
    Try this Blog out
    Link : [
    http://help.sap.com/saphelp_nw70/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm]
    Regards,
    Abhishek
    Award if helpful.

  • Dynamically determine location for a file relatively to current CLASSPATH

    Hi All,
    I am quite new to Java and I have a problem.
    I am trying to write a program that can dynamically determine the location of a file (the class that handles this will only have the relative path/file name).
    Eg.
    File f = new File(config/MyMainCfg.file);
    The class will then need to be "smart" enough to locate the file "config/MyMainCfg.file" in relative to the current CLASSPATH.
    Hence, if the current CLASSPATH is /usr/local/myclasspath, then the file should be able to be located at "/usr/local/myclasspath/config/MyMainCfg.file".
    My main question is:
    (1) If the CLASSPATH contains multiple values (i.e. CLASSPATH=path_1:path_2:path_3), how do I correctly determine the current CLASSPATH that the currently executing program is using?

    I have a method that does something like that. A few lines of it below:
       // Get location class loaded from
       public final static String getHomeLoc(Object obj, String className) {
            URL ourLoc = obj.getClass().getResource(className);
           ... code gets ourLoc.toString()  and parses it.
    // Called by:
         String loc = getHomeLoc(this, "MyClassname.class");

  • Dynamic determination of IDOC

    Hi,
    I have a scenario wherein based on a particular KeyField, I need to dynamically determine the IDOC.  I haven't used BPM before and I don't know whether this scenario is feasible using BPM.
    My approach is creating a data type for the source which will have common fields of both the IDOCs.  This data type will hold the data sent by the sender system.  Thereafter, I would create 2 message interfaces for each IDOC.  Subsequent Message Mapping and Interface Mapping will also be done.  In BPM based on the KeyField, I will determine the Message Interface dynamically and post it to the target system.
    Kindly advice whether the above approach is right.  Is this scenario possible without using BPM.  If so, kindly suggest how to proceed.
    Thanks in advance.
    Bala

    Hi Kumar,
    Is there any possibilites of coming both the idoc data ? If so, you can do as following.
    As you are going to execute 1:N mapping, it is required to have BPM here. (and one more reason is Idoc adapter is not a part of J2EE engine.)
    <i>Is this scenario possible without using BPM</i>
    >>>If it is not of above case, then you can make use of conditional Interface determination , you can try without BPM
    Hope this helps,
    Regards,
    Moorthy

  • Dynamic Determination of Logical System- Transaction Launcher

    Hi Friends,
    Need your suggestions and inputs on how to dynamically determine the logical system for the transaction launcher.
    Our system landscape is like this.
    We have one CRM connected to mulitple back end ECC Boxes. Currently, we have created separate TL's fo VA01 ( One each for each back end application ) and provided the same in logical link and controlled the same via business role.
    For eg: BROLE1 - LLINK1  having (TL VA01) pointing to ECC System1
    BROLE2 - LLINK2  having (TL VA01) pointing to ECC System2
    BROLE3 - LLINK3  having (TL VA01) pointing to ECC System3
    The above procedure is working fine. But what we are trying to do is, when the end user clicks on the TL link in WEB UI, Based on the assigned business role, it should dynamically determine the back end system and open the VA01 Screen in that system.
    I have activated indicator multiple systems in the customizing of mapped logical systems.
    In debugging mode, i have tried changing the LOGSYS value @ run time in the handler class.
    Any pointers on this would be of great help.
    Thanks,
    Madhu

    Hi,
    Try this..
    To maintain RFC destination in each business role, there is one functional profile  "ERP_SALES_ORDER" where in you can maintain respective rfc destination.
    Create z-functional profile's for "ERP_SALES_ORDER" and maintain corresponding rfc destination, later assign these erp sales order function profiles in respective business roles trxn (CRMC_UI_PROFILE).
    you can use the below statement to fetch rfc destination whcih assigned to business role via functional profile.
      If gv_rfc is INITIAL.
        gv_rfc = CL_CRM_IC_ERP_SERVICE=>GS_ERPPROF-RFCDEST.
      ENDIF.
    Hope this helps.
    Cheers,
    Sumit Mittal

  • Its about CWMS 1.5 MR3 : Some of our clients have restriction on usage of java on the endpoint (desktop/Laptop)

    Hi Team,
    Some of our clients have restriction on usage of java on the endpoint (desktop/Laptop) !
    Would like to know if the dependency on Java is going to be removed in future releases ? Is it on the future roadmap ? to webex join meetings

    We're not allowed to discuss roadmap items on the public forums as this requires an NDA. You may wish to ask your Cisco AM or on the private Collaboration User Group.

  • XI - Dynamically Determine System Details in User Functions

    Hello.
    Does anybody know how to dynamically determine the logon information for the statement JCO.Client mConnection = JCO.createClient() from a user defined function in XI? 
    Within a mapping I have written a user defined function to call a function module on ECC but as the system details are 'hard-coded' the incorrect system is called once the interface is promoted from the DEV system. I am not able to modify the user function code for each system as we transport the interfaces between systems which are locked and as such code the builder objects cannot be modified .  I desperately need a method of determining which logon details should be used and I would prefer the solution to be within the user defined function.
    User defined function code:
    JCO.Repository mRepository;
    // Change the logon information to your own system/user
        JCO.Client mConnection = JCO.createClient(
                "300",         // SAP client   
                "pi_jco_rfc",        // userid
                "ecd4adrt",       // password
                "EN",          // language
                "adrp560dev1",        // host name
                "10" );        // system number                     
    // connect to SAP
    mConnection.connect();
    // create repository
    mRepository = new JCO.Repository( "SAPLookup", mConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("ZPI_DETERMINE_STORE_FROM_SITE");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( site[0] , "IM_WERKS" );
    mConnection.execute( function );
    String ret = function.getExportParameterList().getString( "EX_VLFKZ" );      
    mConnection.disconnect();
    result.addValue(ret);
    Any ideas gratefully accepted.

    Darren,
    Why are you using JCOs directly? It is not advisable to do so. You can/have to use the RFC Lookup API to achieve this.
    Have a look at Michal's article about this.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Jai Shankar

  • Dynamically determining the port number of a deployed application

              Hi
              How do I dynamically determine the port number of a deployed web application ?
              I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              know the port number .
              Is there any API do that ??
              Thanks
              Kar
              

    kar piyush wrote:
              > Hi
              >
              > How do I dynamically determine the port number of a deployed web application ?
              > I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              > know the port number .
              >
              > Is there any API do that ??
              >
              kar,
              Here's what I do under WL 7 SP2:
              import javax.management.AttributeNotFoundException;
              import javax.management.DynamicMBean;
              import javax.management.MBeanException;
              import javax.management.ReflectionException;
              import javax.naming.Context;
              import javax.naming.NamingException;
              import weblogic.jndi.Environment;
              import weblogic.management.MBeanHome;
              String domainName,
              serverName,
              serverPort,
              serverUrl;
              // Getting the initial context
              Environment env = new Environment();
              try
              Context ctx = env.getInitialContext();
              if (ctx == null)
              // unable to retrieve a JNDI context
              return;
              // Retrieving the server-specific MBeanHome interface
              MBeanHome home =
              (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
              if (home == null)
              // unable to retrieve the local server MBean
              return;
              // Get the domain & server name
              domainName = home.getDomainName();
              serverName = home.getMBeanServer().getServerName();
              // The server port and address are a little trickier to extract...
              Object mbeanArray[] =
              home.getMBeansByType("ServerConfig").toArray();
              DynamicMBean mbean = (DynamicMBean) mbeanArray[0];
              try
              serverPort =
              Integer.parseInt(
              mbean.getAttribute("ListenPort").toString());
              serverUrl =
              mbean.getAttribute("ListenAddress").toString();
              catch (AttributeNotFoundException thrown)
              // caught a AttributeNotFoundException
              catch (MBeanException thrown)
              // caught a MBeanException
              catch (NullPointerException thrown)
              // caught a NullPointerException
              catch (ReflectionException thrown)
              // caught a ReflectionException
              catch (NamingException thrown)
              log.debug("caught a NamingException", thrown);
              

  • Dynamically determining the number of cols in Select stmt

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

  • Dynamically Determine the level of approval in OIM

    Hi All,
    I have a requirement in which the level of approval has to be determined dynamically based on the requested resource. We have two levels of approval (first& second) and my customer wants second level approval only for certain resources and these details defined in a csv file. e.g., (resource1,first_app,second_app). So if the file contains second level approver data then 2nd level is required otherwise not required. Also the second level approval task should be intiated after the first level approver approves the request.
    e.g., When the user request for a resource , the request should go to first level approvar. Once the first level approver approves the request it should validate whether second level approval is requred or not for the requested resource. If required then second level otherwise it should provision the resource to the user. Is it possibe to do that in OIM?
    I have created 3 task , First one is for first level approval (unconditonal) . Second task is for second level approval (conditonal) and I have created another task (conditional)is just to validate whether second level approval is requred or not. With this task have attached an adapter and passing the requested resource as an argmuent from the object data , this adapter invokes a java and will return TRUE if second level required or FALSE if not required.
    FIRST LEVEL -- Response Tab - For Approve -- Task to Generate -- I have mpped IS SEOND LEVEL task.
    IS SECOND LEVEL -- Response Tab -- For TRUE - Task to Generate -- I have mapped SECOND LEVEL task (Status C).
    IS SECOND LEVEL -- Response Tab -- For FALSE - Task to Generate -- nothing (Status R).
    if IS SECOND LEVEL returns FALSE the approval ends with Rejected status. If IS SECOND LEVEL returns TRUE it immediately execute the provisioning process and then assigns the request to SECOND LEVEL approver. Am I missing anything?
    Can you suggest me how to process with this?
    Thanks in advance,
    INIYA

    Hey the only basic problem I can see with that is already written over there.
    IS SECOND LEVEL -- Response Tab -- For FALSE - Task to Generate -- nothing (Status R).
    So you have defined that with 'FALSE' response status you are rejecting your task, and if you are rejecting your task then your approval is finished. What you need to modify over here is just change the Status to 'C' which will let your workflow know that now there is no second level required and the approval stands completed.
    I think you will not be able to change the response to 'C' for this because you have already used this 'Task Response' for some tasks. What you can do for this is -
    1) Eitgher go and update the database for this mapping.
    2) Send some other response from the file in place of FALSE. eg Send NO and then mark it as completed- 'C'
    You should be done.
    Thanks
    Sunny

  • How to determine endpoint from a handler

    I want to write a request handler which will set a special header based upon the target endpoint.
    How do I determine the endpoint from the request handler?
    On a (possibly) related note, is there a good reference somewhere of the typical properties which are likely to be set related to the message context during web services flows?
    Thanks,
    -- Frank

    I found at least partial answers to my questions.
    MessageContext.getPropertyNames() can be used to see the properties on a given flow.
    MessageContext.getProperty(prop) can be used to get information for paroperties such as:
    prop=javax.xml.rpc.service.endpoint.address
    prop=wsdl.portName
    -- Frank

  • Dynamic determination of VALUES of an Attribute in a Mail-form

    Hi All,
    We have created a Mail Form with ceratin attributes. We have assigned a target group to a campaign.
    now, the requirement is to determine the VALUES of the attributes dynamically for the BPs in the target groups.
    please help me what should be done to meet this rquirement.

    Hi there,
    I believe the following link demostrates the whole process including your requirements:
    [http://wiki.sdn.sap.com/wiki/display/CRM/NavigationtotheCRMUIComponentfromMailFormorSmartFormsHyperLink|http://wiki.sdn.sap.com/wiki/display/CRM/NavigationtotheCRMUIComponentfromMailFormorSmartFormsHyperLink]
    Please reply if this helps.
    Regards,
    Vinamra.

  • How to determine endpoint bandwith utilization

    Hi,
    I occasionally see large amounts of traffic saturating WAN links between a centrally located WLC and any one of several remote access points.  Most of the traffic on the remote APs is locally switched (flexconnect) but there are a couple of SSIDs that are centrally switched (e.g. guest).  My tools just show the traffic between the AP and the WLC. .How can I drill down and determine which endpoint is consuming that bandwidth?
    Thanks,
    -Jeff

    Hi Jeff
    Probably you have to get WLC netflow data to see what traffic is it.
    From WLC 7.4 code onward this feature supported & below post may give some reference
    http://mrncciew.com/2013/02/12/configuring-netflow-on-wlc-7-4/
    HTH
    Rasika
    **** Pls rate all useful responses ****

  • Dynamically Determine the color of graphic

    Hi Experts,
    Can u plz explain the code how to determine the color of the graphic dynamically.I want black and white graphic on first page and color one on the next page and this must continue
    till the last page.....

    upload two graphics to sap.
    one is black and white and other is color.
    declare a variable for count type i in global declaration.
    before graphic declaration just
    declare program lines i.e. move sfsy-page to count.
    count the no of pages using sfsy-page.
    insert 2 graphic
    make 2 graphic as conditional.
    i.e. in the condition tab of graphic1 -
    > count = 1.
    then the black and white image will print.
    for the graphic 2 declare ---> count > 1 .
    then the color image will print.
    or u can directly maintain condition for both graphics.
    in the condition tab sfsy-page = 1. block and while
    for second image sfsy-page > 1. color image
    it will work .
    with Regards,
    Kiran.G

Maybe you are looking for

  • IMovie HD won't launch with mytv.pvr pluged in to the USB bus

    I recently purchased te Eskape mytv.pvr. After installing it the iMovie HD would crash when launched. If I unplug the mytv.pvr, iMovie launched and works fine. When the mytv.pvr plugin, iMovie quit the the "The application iMove HD quit unexpectedly.

  • Itunes 10.5 on win 7 64bit, AppleMobileDeviceHelper has stopped working.

    itunes 10.5 on win 7 64bit, AppleMobileDeviceHelper has stopped working.

  • Pro Video Editing Programs Alternatives for Final Cut

    Hey I like to shot and edit movies in my spare time and Ihave a 2006 Macbook and I've tried to install Final Cut Pro X and Final CutStudio 3 only to find unsucessfully that my computer doesn't support them. So Myquestion Are there any good video edit

  • Alert on entry in table

    Hi, May I know is there a standard function that I can use to check if there is an entry to a specific table. This is to help alert user that new entry has been made on the specific customized table. Samewise, is there a way to check if new file has

  • Restricted access in NAKISA

    Hi Experts, Weu2019re implementing structural authorization in SAP HR ECC 6.0 and it has integration to a few others applications - one of it is NAKISA. Iu2019m troubleshooting a restricted view in NAKISA Succession Planning and the trace results are