Keep alive a session in CRM

Dear CRM folks -
I am calling CRM using BAPIs. The BAPIs are published as Web Services.
I would like that the session between 2 BAPI calls is maintained in an optimized way so I don't make specific calls to the DB to store my session info.
Anyone knows a way of keeping alive a session in the CRM between 2 BAPI calls?
Thanks !

BAPIs are just basically function modules.  Two function modules which are in the same function group are able to share information while the session is open.
If your two BAPIs are not in the same function group(you didn't mention the names or I could have checked) then you can create a wrapper function module which has it's own variables to store the information.  Unfortunately once the RFC session/ICM Web Session is closed then you'll lose that in-memory information.
I assume that you're making the two BAPI calls at different times which is why you're having this problem.  Like one to get user information and then one more to get some other detailed info once the user inputs something.
Without knowing much about what you are really trying to do, my quick idea is to create a Stateful BSP in CRM which accepts all your requests.  The BSP can simply call the BAPIs(eliminate the need for the web service - unless you have some reason you need it) and then between the first and second BAPI call, the BSP will keep the state of the BAPI results in-memory.
If you give more info, might be easier to answer your question.

Similar Messages

  • How to keep alive a session in Web Services?

    I have to do my project, that will be including some following features:
    1. Login to Application through Web Services method. For example:
    http://mydomain.com/web-services/Login?WSDL
    2. After logging in, use mySms method to send message to Cellphone through Web Services! For example:
    http://mydomain.com/web-services/mySms?WSDL
    My questions are:
    1. How can I keep alive the session after logging in the application in Web Services? In Web, I can use "Session".
    2. If someone has not logged in the Application, he/she could not use mySms method for sending Sms. How can I do that?
    3. I know, when I invoke a Web Services, one JavaBean has been called, and this bean is persistence with his own states. It means, if I set value to parameters of this bean, these values are persistence for invoked methods by other persons.
    For example:
    mySms bean has a private field "jid" inited with NULL value.
    Person A invoked mySms.
    Then, A set jid of mySms to value "A".
    Person B invoked mySms. B got jid value. He receive the result value is "A".
    The question is, how can I set mySms bean so that mySms bean is not persistence?
    Thanks many!

    Hi,
    I can right away answer your FIRST Question.
    Since WebServices are PURELY Based on SOAP which is in tern based on HTTP, they rely on a Stateless protocol.
    I am sure you know that the HTTP is the STATELESS Protocol and so you can not maintain Session and so EACH Http REQUEST is considered as a SEPERATE REQUEST.
    Now, still you want to maintain the Session in WebServices,
    The simple answer is PASSING PARAMETERS.
    Just Maintain your Session on Client (If you are using JSPs or Servlets to CAll WEBSERVICES then maintain Session through your HTTPSession) and each time you Invoke WebService PASS ON REQUIRED Parameters.
    This Approach is Exactly like your URL REWriting OR your Parameters Passing through QUERY STRINGS.
    I hope you got what I am saying!
    Take care,
    Himanshu/

  • Keep alive a session between 2 BAPI calls

    Hi -
    I am calling several BAPIs to maintain data. I am calling from an outside system as I published the BAPIs as Web Services.
    I would like that the session between 2 BAPI calls is kept, so I don't miss some session info between call #1 and call #2.
    Anyone knows a way of keeping alive a session between 2 BAPI calls?
    Thanks !

    Try this..
    <b>ARFC with Resource Management (Parallel Remote Function Call)</b>
    CALL FUNCTION 'MYFUNC'
    STARTING NEW TASK 'T1'
    DESTINATION IN GROUP 'PRFC'
    EXPORTING ...
    TABLES ...
    EXCEPTIONS ...
    communication_failure = 100
    system_failure = 101
    resource_failure = 200.
    IF sy-subrc= 102.
    wait and retry...
    ENDIF.
    <b>Define ‘PRFC’via RZ12</b>
    Amandeep

  • HFM Web Sever Configuration--Keep Alive and Session Time Out Optimal Config

    We recently implemented an HFM 9.3.1 environment. We are using Windows 2003 Enterprise SP2 servers with IIS6. We have two HFM Web servers connecting to an application cluster with two application servers in the cluster. We were getting some errors when trying to unlock HFM cells in Workspace, but we were able to perform the functions fine on the application using the WIN32 client.
    I opened a ticket with support and they recommended modifying the subcontext.properties file located in %HYPERION_HOME%\deployments\WebLogic9\servers\Workspace\webapps\workspace\conf. They recommended changing the following settings:
    #KeepAliveInterval=30
    #SessionTimeout=60
    From what I understand, these settings are for the communication between the HFM Web Servers and the application cluster servers. I'm wondering how changing these settings may affect our environment. Are there negative effects and/or trade-offs for changing these settings? Is there a recommended threshold or maximum value?

    Hi Dinesh,
    This cannot be achieved without development enhancements to some standard SAP framework component, to introduce a "keep-alive" concept. If you are using a CMS for CTI or email integration, you need to ensure it supports keeping the communications session alive also.
    Sincerely,
    Glenn
    Glenn Abel
    Covington Creative
    www.covingtoncreative.com

  • How to keep alive a session with a timeout

    my session have a timeout of 20 minutes (it's a system setting i cannot change)
    i run a program that generates a file excel that need 60 minutes to  end.
    i cannot run the program in background because OLE and creating excel is not supported
    is there a way to avoid my session time out?
    is there a way to make the sistem don't close my session while it's creating my file excel?
    thanks,
    Giacomo

    Giacomo,
    Try it.
    REPORT  zz_keep_alive.
    CLASS lcl_trigger DEFINITION.
      PUBLIC SECTION.
        METHODS: fim_timer FOR EVENT finished OF cl_gui_timer.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    CLASS lcl_trigger IMPLEMENTATION.
      METHOD fim_timer.
        cl_gui_cfw=>set_new_ok_code( new_code = 'ONLI' ). "ONLI = Executar
      ENDMETHOD.                    "fim_timer
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    DATA: r_timer   TYPE REF TO cl_gui_timer.
    DATA: r_trigger TYPE REF TO lcl_trigger.
    PARAMETERS: p_uzeit TYPE sy-uzeit.
    AT SELECTION-SCREEN OUTPUT.
      p_uzeit = sy-uzeit.
      CREATE OBJECT: r_timer, r_trigger.
      SET HANDLER r_trigger->fim_timer FOR r_timer.
      r_timer->interval = 60.
      r_timer->run( ).
    Hope it helps.
    Rgs
    Paulo Afonso Cordeiro

  • Is possible to keep alive 2 sessions at the same time?

    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    Francesco

    fmarchioniscreen wrote:
    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    FrancescoSaving critical user information in cookies is not a good practice.Please divert your approach to scoping it in session to fix your problem.
    usage of session.set/getAttribute() accordingly.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Session Keep Alive

    I have seen that my user sessions for a room will expire if there is no activity for some period of time. After that time it looks as if the authentication token for that user cannot be used again.
    Is this expected behavior? If so, after what period of inactivity does the session become invalid?
    Ideally I would like to keep the user session alive for a controlled period as long as they stay in the room(browser is not closed). Is there a recommended "keep alive" call I can make from clients to keep sessions alive?
    Thanks,
    Barry

    I ran another test and it does seem like an auth token becomes invalid in some circumstances after a period of inactivity. I still can't pin down exactly why, but the main reason for the problem I was seeing was because I had another process that deleted the room in the background.
    If I see a pattern for how auth tokens become invalid I'll post back, but it works well enough now for my purposes.
    Jamie,
    Yes, the tokens are created using the server api.
    Thanks,
    Barry

  • Weblogic proxy plugin closes keep-alive connections to clients randomly

    In short we have following arhitecture:
    clients ---> wl proxy plugin 1 ----> weblogic 1
    clients ---> wl proxy plugin 2 ----> weblogic 2
    Beacuse of the application/installation specific requirements, we are not using failover, one wl proxy always forwards requests to one weblogic (simple configuration).
    Application is TR-069 protocol based (SOAP over HTTP) so it very much relays on persistence TCP connections (Connection: keep-alive). This TCP persistence has to work correctly in order that TR-069 messages are exchanged in required order, otherwise we have a error on application layer.
    Here and there we've noticed applications errors which suggest that we have some problems in TCP connection between the client and the weblogic server. After sniffing, we've noticed that weblogic proxy plugin (Apache) randomly, or because of some other reason we do not know, decides to close TCP connection to client, even app on weblogic did not request so ???
    As a result, client opens new connection to the server with new TR-069 session and it gets bounced beacuse it allready has one open on weblogic server.
    We've sniffed, traced everything we could, we were searching for patterns in time, etc... but we can not find the reason why proxy plugin decides to close the connection to the client (not to the weblogic server).
    Trace (replaced sensitive information):
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: CompleteStatusLine set to [HTTP/1.1 200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> URL::parseHeaders: StatusLine set to [200 OK]
    Thu Apr 29 15:05:50 2010 <958012725463463784> parsed all headers OK
    Thu Apr 29 15:05:50 2010 <958012725463463784> sendResponse() : r->status = '200'
    Thu Apr 29 15:05:50 2010 <958012725463463784> canRecycle: conn=1 status=200 isKA=1 clen=545 isCTE=0
    Thu Apr 29 15:05:50 2010 <958012725463463784> closeConn: pooling for '$IP$/$PORT$'
    Thu Apr 29 15:05:50 2010 <958012725463463784> request [$URL$] processed successfully..................
    !!!! Now it closes the TCP connection and inserts "Connection: close" HTTP header !!!
    WL proxy plugin conf params are:
    WebLogicCluster $IP$:$PORT$
    DynamicServerList OFF
    KeepAliveTimeout 90
    MaxKeepAliveRequests 0
    KeepAliveSecs 55
    Apache worker configuration is:
    <IfModule mpm_worker_module>
    PidFile var/run/httpd-worker.pid
    LockFile var/run/accept-worker.lock
    StartServers 2
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadLimit 200
    ThreadsPerChild 200
    MaxClients 2000
    MaxRequestsPerChild 0
    AcceptMutex pthread
    </IfModule>
    Why weblogic proxy plugin ignores Keep-alive directive and decides to close connection to the client by itself?
    Any help?

    If a WebLogic Server instance listed in either the WebLogicCluster parameter or a dynamic cluster list returned from WebLogic Server fails, the failed server is marked as "bad" and the plug-in attempts to connect to the next server in the list.
    MaxSkipTime sets the amount of time after which the plug-in will retry the server marked as "bad." The plug-in attempts to connect to a new server in the list each time a unique request is received (that is, a request without a cookie).
    Note: The MaxSkips parameter has been deprecated as the MaxSkipTime parameter.
    See also here: http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/plugins/plugin_params.html
    You said the problem arises under significant load. Maybe, it is wise to tune the number file descriptor's on your operating system. HTTP connections are nothing more than TCP sockets on the operating system. All modern operating systems treat sockets as a specialized form of file access and use data structures called file descriptors to track open sockets and files for an operating system process. To control resource usage for processes on the machine, the operating system restricts the number of open file descriptors per process. You should be aware that all TCP connections that have been gracefully closed by an application will go into what is known as the TIME_WAIT state before being discarded by the operating system.
    On most unix systems you can use netstat -a | grep TIME_WAIT | wc -l to detemine the number of socket in time_wait state. You have to check with your system adminstrator how to tune the tcp_time_wait_interval. On solaris you can use: /usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000

  • Keep alive script for HTTPS service with GET method

    Hello,
    I tried to implement a keep alive to services that support HTPS connections. I’ve created a script that opens a tcp connection on port 443 and tries to do a GET of a test web page. This web page only displays “OK”.
    In a resumed form I used the following script commands:
    Socket connect host 192.168.136.134 port 443 tcp
    Socket send ${SOCKET} “GET /teste.template\n\n”
    Socket waitfor ${SOCKET}” 200 “ 2000
    Socket disconnect ${SOCKET} graceful
    I was unable to receive the expected “ 200 “response and received a message saying string not found, I used the socket inspect command to inspect the socket’s internal data buffer and the result was nothing, it seemed empty.
    I tried the same operation using a linux machine that has IP connectivity with the Webservers and I was successful.
    In the same CSS I have services configured to respond to HTTP sessions. I tried the following script and everything went well
    Socket connect host 192.168.136.151 port 80 tcp
    Socket send ${SOCKET} “HEAD /index.html\n\n”
    Socket waitfor ${SOCKET}” 200 “ 2000
    Socket disconnect ${SOCKET} graceful
    When I issued the socket inspect command I could in fact see the socket’s internal data buffer content.
    The CSS is running WebNS 5.0 build 66
    Can someone give me a help?
    Thanks,
    Ricardo Lourenço

    Hello,
    There is no direct no direct link between TCP and SSL.
    So, in spite of having success with the TCP port 443 connection the CSS will not be able to negotiate de security parameters necessary to establish the SSL session.
    This was the reason for not having success through the use of the socket commands, as i refered in my original message.
    Thanks for your collaboration,
    Ricardo Lourenço

  • LB configuration - Keep Alive.

    I need to help configure proper load balancing between 2 building modules of Portal server.
    SetUp:
    Server A - Portal 1,Access Manager 1 , Directory 1
    Server B - Portal 2, Access Manager 2, Directory 2
    Logical Architecture.
    -------- Server A
    User Request -------------------->LB ------------>
    ------ Server B
    I need to configure LB in a way that It has keep Alive info for Server A and B.I think there is a configuration required in some xml/property file so that If lets say server A goes down...the LB will automatically direct the next request to server B.
    Can somebody point me in the right direction?
    Thanks.

    Do you need the SSO session created on Server A to failover to Server B or is it ok that the user has to reauthenticate if Server A goes down?
    In any case you can either configure the LB for s.c. active cookie based persistence (LB is inserting it's own cookie) or s.c. passive cookie based persistence (LB is using a predefined cookie). I guess this is what you mean by 'keep-alive info' - correct?
    Of course this does only work if no SSL is used or if SSL is terminated at the LB.
    If SSL is used the only solution is to use client-IP based persistence.
    All the above is only needed to prevent cross-talk between AM instances.
    -Bernhard

  • Keep-Alive Portlet

    Does anyone know of a keep-alive portlet that will keep the users session alive while they are on a specific page? My problem is that the users are getting logged off of the portal after 20 minutes of inactivity, so what I'd like to do is have a portlet that will post back behind the scenes every 5 minutes or so, in order to keep the portal from logging the user off. Does anyone know of any such portlets?
    Thanks
    -Ben

    Couple of questions:
    * What version of the portal are you using?
    * Is the portal session timing out or is this a specific portlet?
    The portal's session timeout can be controlled by editing config files and restarting. For a portlet - if you're experiencing a session timeout, can you bump up session duration through the remote web server? For portlets we control we usually try to match remote portlet session timeout to the portal's timeout. Since we try to do everything as a gatewayed portlet this usually works well for us.
    Thanks,
    Eric

  • 3270 Emu program keep alive setup cause 7507(TN3270 Server) Down

    Hi
    need all of your suggest
    my cx use 3270 Emu program which enable keep alive 30 second in it's default config
    when client idle 30 second,it auto triger keepalive to TN3270 server(7507)
    But 7507 send back TN_DEV_IN use(TN device in use)to client,and client must reconnect to server
    does any one know how to bypass 7507 send this to client,
    my cx have exceed four hundred 3270 client
    it takes so long to set per client
    so any command can issue in 7507 to bypass this
    tks

    I don't know if these commands will bypass the problem, only that they might. I'm really guessing here, because the result you describe doesn't add up. My guess is that your emulator is missing a timing-mark or no-op keepalive from the server, and when the client then sends it's own keepalive the server views it as a sequence error and closes the session. The best way to work this out is probably to start with a trace of a complete session.

  • I tried purchasing songs and it keeps saying my session has timed out

    I am trying to download songs and it keeps saying my session has timed out...how do i get aroudn this

    I can purchase songs, then when it goes to download, it won't because the "network connection has timed out"
    Help!  How do I fix this problem!!

  • I am trying to manage my media from the computer but it keeps saying my session has timed out and I've tried it so many times. How can I successfully manage my media?

    I am trying to manage my media from the computer but it keeps saying my session has timed out and I've tried it so many times. How can I successfully manage my media?

        Hi Valeria07,
    We want managing your media to be easy! It saddens me to hear that this is not occuring. Do you receive a specific error message when the browser times out? Have you tried using a different browser?
    Thanks,
    PamelaF_VZW
    Tweet us @vzwsupport

  • Keep-alive problem in apache/weblogic

    I have a server with Weblogic 5.1 and Apache
    1.3.12 with the weblogic-plugin.
    When apache serves pages, the keep-alive works
    fine.
    When weblogic serves pages, the keep-alive works
    fine.
    When i added a handler in apache so all requests
    to apache should go to weblogic through the
    plugin, the keep-alive stopped working.
    Anyone seen this before?
    Gunnar

    send a message to [email protected] with as much info as you can. i d
    on't think they're watching the newsgroups for bug reports.
    maybe someone who frequents the newsgroups regularly could do a FAQ...
    anyone actually got time?
    "Gunnar" <[email protected]> wrote in message
    news:3a51995e$[email protected]..
    In case anyone wondered:
    I tried with sp5 and sp7 and everything worked fine. It seems sp6 is
    buggy...
    Gunnar <[email protected]> skrev i
    meldingsnyheter:3a41e618$[email protected]..
    I have a server with Weblogic 5.1 and Apache
    1.3.12 with the weblogic-plugin.
    When apache serves pages, the keep-alive works
    fine.
    When weblogic serves pages, the keep-alive works
    fine.
    When i added a handler in apache so all requests
    to apache should go to weblogic through the
    plugin, the keep-alive stopped working.
    Anyone seen this before?
    Gunnar

Maybe you are looking for