Call Webservice/API during browser close event

Hello,
I am using JDEV 11g. My application catches the browser close event to call a return Task Flow.
I am wondering if its possible to call a webservice/API during the same event.
Thanks
Padmapriya

Probababy too late to ask .. did u manage to get this resolved.
I am not able to call any server Listeners during browser close event ...
Details here -Re: Calling an ActionListener on browser window close using JS event queuing

Similar Messages

  • Catching browser close event and showing my own popup

    Hi,
    I want to show my own warning popup on browser close event. Kindly help me with the solution.
    Thanks a lot in advance.
    Lavanya.

    Lavanya,
    I don't think you could show a ADF Popup during the onload event. Instead, you could use javascript's confirm method to prompt the user to choose what they want to do and perform that operation accordingly.
    Ex :
    jspx code
       <af:document id="d1" onunload="performUnloadEvent" clientComponent="true">
                <af:resource type="javascript">
                  // For Mozilla and Firefox
                  if(window.addEventListener){
                  window.addEventListener('beforeunload', function (event) {
                    showConfirm();
                  // For IE
                  else if(window.attachEvent){
                       window.attachEvent('onbeforeunload', function (event) {
                    showConfirm();
                  function showConfirm(){
                          var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
                          var sel = confirm("Are you sure you want to exit?");
                        if(sel==true){
                            alert('Perform OK Operation');
                            var x = AdfCustomEvent.queue(eventSource, "handleOnUnload", {result : 'ok'},false);
                            var y = 0;
                        else {
                        alert('Perform Cancel Operation');
                         var x = AdfCustomEvent.queue(eventSource, "handleOnUnload", {result : 'cancel'},false);
                         var y = 0;
                </af:resource>
                <af:serverListener type="handleOnUnload" method="#{UnloadHandler.onUnloadHandler}"/>
                <af:form id="f1" clientComponent="true">
                </af:form>
            </af:document>onUnloadHandler method in bean
        public void onUnloadHandler(ClientEvent clientEvent) {
            System.out.println("Unload Event fired..");
            String outcome = clientEvent.getParameters().get("result").toString();
            if(outcome.equalsIgnoreCase("ok")){
                System.out.println("Outcome is OK ");
                // Perform some operation like Commit;
            else if(outcome.equalsIgnoreCase("cancel")){
                System.out.println("Outcome is Cancel ");
                // Perform some cleanup operation like Rollback;
        }-Arun

  • Browser Close Event

    Hi,
    I want to track Browser close event in EP to close all the sessions of the user.
    Plz guide me with detailed steps.
    Thanks in advance.
    Regards,
    Priya

    Hi search for "Browser close event" in google.
    Result: there is no such thing. You can do something with onbeforeunload but that might not work for all browser.
    Kai

  • How to catch browser close event excluding navigation events

    Hi,
    I tried using onBeforeUnload event and onUnload events.. but they are catching navigation events within the same site. Could you please let me know how I can catch browser close events without catching Navigation events?
    Thanks.

    Just set them to null when navigation takes place.
    Said that, you should be asking Javascript/DHTML related questions in a forum devoted to Javascript/DHTML. There are ones at webdeveloper.com and dynamicdrive.com. This has nothing to do with Java.

  • How to detect browser close event in flex ?

    How to detect browser close event in flex ?

    This link may help:
    http://cookbooks.adobe.com/post_Close_event_of_browser_or_browser_tab-18211.html
    Best,

  • Capturing browser close event

    Hello everyone,
    Even though this question has been answered before, I find that none of the answers seem to work for me.
    My problem is the following: Locks are placed on records and tables at certain points in my application. But if the user simply closes the browser without closing the application properly, all the locks are still in place. So I need to catch an event that allows me to ABAP my way out of this.
    I have the following BSP page which loads my application:
    function startBSPApplication()
    function endBSPApplication()
      <frameset id="<%=guid %>_FRAMESET" rows="*,0" onload="startBSPApplication('<%=guid %>_A');" onunload="exitBSPApplication();" noresize framespacing="0" frameborder="0" border="0">
        <frame name="<%=guid %>_A" src="session_default_frame.htm">
        <noframes>This browser does not support frames.</noframes>
      </frameset>
    The start and end functions simply start and end a session, and I find myself unable to actually call an ABAP function in there. All ABAP code placed inside the javascript functions is called everytime the page is loaded, not everytime the function is called and that's not what I want.
    I also already tried the <bsp:htmlbEvent> tag, but I couldn't get that to work either. I tried it like this:
    Notice however that I wrote this on top of the frameset. Does this mean that the onunload event will be called twice and does this cause a problem?
    I tried to call the onDestroy event from within my endBSP function, but nothing happened either.
    <htmlb:content design="design2003" >
      <htmlb:page title="Capture browser close " >
        <htmlb:form>
          <bsp:htmlbEvent id      = "myid"
                          onClick = "onDestroy"
                          name    = "onDestroy"/>
          <script for="window" event="onunload"  type="text/javascript">
               alert('Starting the Server Event');
               onDestroy();
           </script>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Does anybody have another suggestion, or notice me overlooking something?
    Thank you in advance,
    Niels.

    Hi Eddy,
    I can't find anything really helpful in that blog. Except maybe adding the onbeforeunload attribute to my frameset and calling a JS function to back it up.
    The problem still persists that any ABAP you put in a JS function is executed regardless of wether or not the function is actually called.
    I need to get to my DO_HANDLE_EVENT somehow when the user closes the window.

  • Confirmation of browser close event

    Hello,
    In my application, I have a function "myCloseFunction" which looks something like this:
    public function myCloseFunction
         Alert.show("This is an alert.");
         trace("myCloseFunction called");
    This is only called upon closing the browser (set up using ExternalInterface.addCallback and window.onbeforeunload)
    The strange thing is, no alert ever pops up BUT the trace does show.  I have (of course) imported the alerts library (and used alerts elsewhere successfully in the application).  Has anyone ever experienced it or does anyone know of a fix?
    I will post my Javascript and .mxml file if needed, though I doubt it is.
    Thanks in advance for your help!

    hi,
    Frastructed with the window close example using ExternalInterface.addCallback provided by Adove not working. Any help would truly appreciated.  here is what i've found:
    1. when tested, it passes data from html to Flex if I use onchange="callApp();" of the <Input> tag by typing something to invoke onchange event;
    2. if I choose to use window.onbeforeunload = callApp(); at the JavaScript section to detect window closing event, it does detect window is closing, but it won't pass the data ("Window Closing") to Flex. 
    Thank you very much for any help.
    In Html:
    <html><head>
    <title>wrapper/AddCallbackWrapper.html</title>
    <SCRIPT LANGUAGE="html/JavaScript">
       function callApp() {       
            window.document.title = document.getElementById("newTitle").value;       
            mySwf.myFlexFunction("Window Closing");
        //window.onbeforeunload = callApp();   
    </SCRIPT>
    </head>
    <body scroll='no'>
    <h1>AddCallback Wrapper</h1>
    Enter a new title: <input type="text" size="30" id="newTitle" onchange="callApp();">
    <table width='100%' height='100%' cellspacing='0' cellpadding='0'>
        <tr>
            <td valign='top'>
                <object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='200' width='400'>
                    <param name='src' value='testWrapper.swf'/>
                    <param name='flashVars' value=''/>
                    <embed name='mySwf' src='testWrapper.swf' pluginspage='http://www.adobe.com/go/getflashplayer' height='100%' width='100%' flashVars=''/>
                </object>
            </td>
        </tr>
    </table></body></html>
    In Flex:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">
          <mx:Script>
              <![CDATA[              
              import flash.external.*;
              import mx.rpc.events.ResultEvent;
              import flash.events.Event;
              import mx.rpc.events.FaultEvent;    
              import mx.controls.Alert;
         public function initApp():void {
            ExternalInterface.addCallback("myFlexFunction",myFunc);      
         public function myFunc(s:String):void {           
            Alert.show(s);    
        ]]> 
      </mx:Script>
      <mx:Label id="l1"/> 
    </mx:Application>

  • URL Escaping when calling Webservices API Changed?

    Hello,
    It seems that something has changed recently with the Adobe Connect Webservices API. In the past, when I would call 'principal-update' to create or update a user, I would sanitize all my strings using urlencode() in PHP, which takes any non-alphanumeric characters (or dashes and underscores) and "percent encodes" them. For example, a "@" character in an email address becomes "%40".
    This is important especially in the case that a string contains an ampersand (&) or question mark (?) since those characters are used to pass the parameters themselves in the URL string.
    This has always worked fine until I noticed a few days ago it was no longer working.
    If I attempt to create a user with an email address formatted with the "%40", Connect now comes back with an error message saying it wasn't formatted properly. Removing the encoding fixes the problem.
    However, this is NOT best practice. And especially for passwords, which could theoretically contain ampersands and question marks, you cannot simply pass the raw string in the URL as it will create a malformed URL.
    Has anyone noticed this, and does Adobe know about it? Seems like a major problem, and means I will have to prevent users from using these special characters in their passwords until this is fixed.
    -Jeff

    Jeff,
    Thanks for the posting. I suggest you should call this into Support as a bug. It's possible that they changed something that affected this without seeing the ramifications.

  • Can Flex detect browser close event?

    Is Flex notified by the browser when the browser is closed
    (or browser tab)? I need to be able to save any unsaved data in the
    application before the browser closes.
    Thanks in advance

    Thanks for your reply.
    I found a good example that I followed and got it working:
    http://flexblog.faratasystems.com/?p=134

  • Catching the browser close event...

    Hello Fellow Portal-Heads,
    There's a nagging issue that I've been pondering (RE EP6 NW04).  In the MSS iViews there is the potential issue of a user viewing an employee and then closing the browser via the 'X' (vs. clicking the logoff link).  This 'X-ing' out of the browser leaves the viewed employee locked which is to be expected.  So... anyone have a good way to catch the 'X-ing' out of the browser and then trigger some code to perform a proper logoff?  I've tried inserting code in the masthead which catches a browser unonload() event... but it was not the smoothest operator.
    Cheers,
    Mike
    Message was edited by: Mike Yang

    Hi Mike,
    I have got a chance to work in a similar issue.The following code traps the 'X' of the browser and logoff the user.
    <script type="text/javascript">
    window.onunload = function unloadEvent()
         if (gIsPreviewMode)
              return;
         else
              if(window.screenLeft < 10004)
                     //this is refresh
              else
                     logoff();
    </script>
    Preview is taken care and the code is working fine. I am posting code so that somebody else can use it,
    Regards
    Message was edited by: Rem Swa
    This is for EP6 SP2

  • How to call webservice application using Browser

    Hi Everybody,
    Synchronous Scenario:  Calling XI Server using WebServices( Sending the Customer no through Soap and from there the receiver adapter RFC is picking that no and it will send it to R/3 using BAPI and getting the Customer Details from R/3.
    I followed the below two blogs and I created the complete scenario. And I deployed the ear file in WebAs in xi server.
    Now the question is how to run this program using the browser. That is how to call.
    Message Interface Name: CDWS_MI
    Service Name                : Soap_Service
    Namespace                   : urn:xiwebservicesusingwebdynpro.com
    Can you tell me how to call through the browser?
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3592---- [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    >1
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3593---- [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    >2
    Advance thanks,
    Abdullah Shaik.

    Hi,
    It's not clear to me what you did. Have you exposed an XI Message Interface through a Web Service? Or have you developed a Web Service in the other way? What is the "ear" that you said? Is an webdynpro app? If it is, I think your question would be properly answered at WebDynpro forum
    cheers!
    roberti

  • When calling webservice Session event listener threw exception

    Hi All,
    I have Schdule the process to call webservice for 1 hour.
    When it accessed It is throwing Exception But data send to Server and received response as true from webservice.
    Exception details found in log file.
    2007-12-04 01:00:36 StandardManager[npbpqa] Session event listener threw exception
    java.lang.IllegalStateException: getAttribute: Session already invalidated
         at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:925)
         at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:124)
         at org.apache.axis.transport.http.AxisHTTPSessionListener.destroySession(AxisHTTPSessionListener.java:43)
         at org.apache.axis.transport.http.AxisHTTPSessionListener.sessionDestroyed(AxisHTTPSessionListener.java:72)
         at org.apache.catalina.session.StandardSession.expire(StandardSession.java:623)
         at org.apache.catalina.session.StandardSession.expire(StandardSession.java:572)
         at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:746)
         at org.apache.catalina.session.StandardManager.run(StandardManager.java:823)
         at java.lang.Thread.run(Thread.java:534)
    Can any one help me urgently.
    Thanks in advance.
    Venkat K
    Edited by: venkat2007 on Dec 4, 2007 2:44 PM

    The service is working fine from a web page that my coworker did.  I have not installed soap UI yet, but I used it at my last job.  Since I posted this I have a new computer, have installed BizTalk Server 2013 R2 and Visual Studio 2013 Premium.
     This is what I've done...
    Created a new Host called BizTalkServerApplication64 with the '32-Bit only' unchecked.
    Created a new host instance using the new host.
    Created a new Send Handler for both Adapters 'WCF-BasicHttp' and 'WCF-Custom' using the new host.
     configured both Send Ports (WCF-BasicHttp and WCF-Custom) to use the new send handler.
    Have tried binding the logical port to both basic and the custom ports.
    Now I get a different error which is:
    Error Description: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to http://lbenson/MDSVC2/Service1.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due
    to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. --->
    System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host...
    Any suggestions for this error?  I'm not sure if this means I'm closer to getting it work or further.
    Thanks for your help!
    Jean
    jRenae.s

  • Calling oracle API having parameter as record type throughPL/SQL WebService

    Hi All,
    I dont know whether this is the right forum to put this query, but as i am using a pl/sql web service , putting the query on this forum.
    My requirement is to call oracle API which in turh creates a single Invoice(using Ar_Invoice_Api_Pub.create_single_invoice )
    But the issue is this API in turn has some of the input parameters as Record type and table type, my concern is how to pass this data(record type or table type) as parameter thorugh java code .. If i use Collection or Hashmap will it work , I dont think so , some intermediate conversion will require.
    Subsequently the other requirement is fetch this record/table type data and return it to the java code
    Please correct me if i am wrong and suggest a proper solution if anybody is aware off or tried such things before.
    Thanks in advance.
    Regards,
    Anant.

    Hi,I'm new comer of this world,
    I've a pl/sql like this:
    package MY_WS_API is
    type record_set is ref cursor;
    PROCEDURE Get_User_Info(p_user_id VARCHAR2,
    p_rep_id VARCHAR2,
    p_flag out number,
    p_msg out varchar2,
    p_recordset out record_set);
    end MY_WS_API;
    when I using jdeveloper trying to publish it as a webservice, in the step 4 of the wizzard poping me choose the program unit to expose, the PROCEDURE Get_User_Info is not available and told me "Ref cursor Type is not supported due to a jdbc limitation and Ref Cursor Types are only supported for use of return type".
    THE QUESTION is:
    1.the cursor I used is of return type,I'm not very understanding the "why not" message upon.
    2.in such case , need I trans the return cursor into Object[] if have to?
    3.any other limitation for generating WS from PL/SQL using jdeveloper?
    Thanks!

  • XI 3.1 Webservices API: Read time out during getDocumentInformation()

    Hi,
    my client is moving vom BO 6.5 to BO XI 3.1. The client uses BO to create mass reports for indivual subscribers in a batch mode fashion. We are currently evaluating the Webservices API, dealing with Desktop Intelligence reports.
    I have implemented a load test prototype using the Webservices API with the help of the examples found here.
    Retrieving a single report works fine, but when I try to put some load on the server and request reports with several parallel threads, I get the "Read timeout error" when calling getDocumentInformation(repID, null, actions, null, boRetrieveData). The actions array just contains the FillPrompts instance.
    2008-12-05 11:05:07,448 INFO  (test-5    ) [HTTPSender                    ]   Unable to sendViaPost to url[http://bojv01:8080/dswsbobje/services/ReportEngine]
    java.net.SocketTimeoutException: Read timed out
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
         at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
         at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
         at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1373)
         at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
         at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
         at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
         at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:520)
         at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
         at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
         at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
         at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
         at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
         at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
         at com.businessobjects.dsws.reportengine.ReportEngine.getDocumentInformation(Unknown Source)
    BTW, the threads use different logins and in consequence different connections/sessions.
    The timeout occurs after 30secs, so simple reports with no prompts are created without error. Increasing the timeout on the connection as suggested in other postings did not help.
    I think the issue is related to Axis2. I don't know how to set the timeout on the Axis client via the BO API. Trying to recreate the client API from the WSDL did not work. Is there any example how to do this correctly? Having the source of the Axis client, one would have the chance to set the timeout on the client programmatically ...
    Any help would be greatly appreciated,
    con

    I found a workaround for the issue by patching and compiling the Axis2 kernel library. You need to download it form Apache, install Maven 2.0.7, set the default timeout in .../client/Options.java to a value that suits your needs (for me: 20min), and compile the whole thing using mvn clean install.
    But this is obviously not the solution one wants. So, is there anybody with a REAL answer to the problem?
    Regards,
    con

  • Error when calling getAllServerPools() using WebService API

    Hi,
    I try to get All the Server Pool created on my Oracle VM Manager with the WebService API, but i'm get an error.
    Here is the code (I used the wsimport to create proxy class Oracle VM 2.2.0):
    - 1.Get "AdminService Webservice" --> OK
    private AdminService_Service adminServiceService=null;
    private AdminService adminService=null;
    try
    this.adminServiceService=new AdminService_Service(new URL(url + WS.CONTEXT_PATH +WS.ADMINSERVICEWS),new QName(WS.QNAME, WS.ADMINSERVICE));
    catch (MalformedURLException e)
    // TODO Auto-generated catch block
    e.printStackTrace();
    this.adminService=this.adminServiceService.getAdminServiceSoapHttpPort();
    bindProvider = (BindingProvider) this.adminService;
    requestContext = bindProvider.getRequestContext();
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url + WS.CONTEXT_PATH +WS.ADMINSERVICEPORT);
    requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
    requestContext.put(BindingProvider.USERNAME_PROPERTY, userName);
    requestContext.put(BindingProvider.PASSWORD_PROPERTY, password);
    - 2. Login to OracleVM Manager with an administrator user account--> OK
    LoginElement loginElmnt=new LoginElement();
    loginElmnt.setAccountName(userName);
    loginElmnt.setPassword(encyptPassword(password));
    LoginResponseElement res=this.adminService.login(loginElmnt);
    String loginToken=res.getResult();
    --> Admin Session token: 510175389-1257996206446
    -3. Get the "ServerPoolService Webserice" --> OK
    private ServerPoolService serverPoolService=null;
    private ServerPoolService_Service serverPoolSrvService=null;
    try
    this.serverPoolSrvService=new ServerPoolService_Service(new URL(url + WS.CONTEXT_PATH +WS.SERVERPOOLSERVICEWS),new QName(WS.QNAME, WS.SERVERPOOLSERVICE));
    catch (MalformedURLException e)
    // TODO Auto-generated catch block
    e.printStackTrace();
    this.serverPoolService=this.serverPoolSrvService.getServerPoolServiceSoapHttpPort();
    bindProvider = (BindingProvider) this.serverPoolService;
    requestContext = bindProvider.getRequestContext();
    requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url + WS.CONTEXT_PATH +WS.SERVERPOOLSERVICEPORT);
    requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
    requestContext.put(BindingProvider.USERNAME_PROPERTY, userName);
    requestContext.put(BindingProvider.PASSWORD_PROPERTY, password);
    -4. Get the AllServerPool --> KO
    GetAllServerPoolsElement getAllServerPool=new GetAllServerPoolsElement();
    GetAllServerPoolsResponseElement getAllserverPoolResp=null;
    ServerPool serverPool=new ServerPool();
    List<ServerPool> serverPoolArr=new ArrayList<ServerPool>();
    i have the java.lang.NullPointerException when calling:
    getAllserverPoolResp=this.serverPoolService.getAllServerPools(getAllServerPool);
    What is the problem ?
    Thanks in advance,
    Christophe.

    just a silly bug....

Maybe you are looking for