Reporting errors or exceptions back to the caller

I'm u sing OracleAS 10.1.3 and I'm exposing some of my PL/SQL procedures as web services. I was wondering what the convention is for reporting errors back to the caller. I read a little bit about Soap faults and some lack of support in the current JDev release.
Are soap faults the standard way of reporting handled exceptions? What about returning a record like:
   type r_ws_response_string is record (
      result          varchar2 (4000),
      return_code     number,
      error_message   varchar2 (4000)
   );... and having the caller check the return_code. Bad idea?
Any resources you can point is is appreciated (books/sites).
-Vahid Pazirandeh

Hi Toby,
Yes, I've come up with a working solution.
Essentially, I've made use of PL/SQL's OUT parameters and always reporting a status to the caller. At minimum, any procedure or function that I expose as a web service will have two out parameters: status, error_msg. The benefit of having a status being returned is that the caller can build logic based on different problems encountered, rather than just saying "an error occured". The error strings that you define are textual error codes, so they shouldn't change once you decide on an API.
The caller will always check for the value of status, if it is not 'SUCCESSFUL', then something is wrong. They can then log the value of error_msg so that their developers can figure out what went wrong later.
What's also nice is that the XML that's generated by JDeveloper looks clean when we're using one or more OUT params.
I don't know what the best way is to deal with this problem, but this works for me. :) Here's an example:
g_status_success        := 'SUCCESSFUL';
g_status_bad_password   := 'ERROR_INVALID_PASSWORD';
g_status_file_not_found := 'ERROR_FILE_NOT_FOUND';
g_status_unknown_error  := 'ERROR_UNKNOWN_EXCEPTION';
procedure give_me_file(password varchar2,
                       status out varchar2,
                       error_msg out varchar2,
                       file out blob)
is
begin
     if bad_password(password) then
          status := g_status_bad_password;
          error_msg := 'You entered the wrong password friend!';
          return;
     end if;
     file := get_top_secret();
     if file is null then
          status := g_file_not_found;
          error_msg := 'Your file could not be found';
          return;
     end if;
     status := g_status_success;
     exception
          when others then
               status := g_status_unknown_error;
               error_msg := 'An unknown error occured.  Please file a ticket.';
end;Regards,
Vahid Pazirandeh

Similar Messages

  • An exception occurred during the call of a business method

    An unexpected exception occurred during the call of a
    business method...Im calling the business object thru the business Delegate.Im calling the business method with an argument as hash table .. And Im using Oracle 9i application server.. Hash table contains data packed in the form of xml...
    The exception thrown is
    java.lang.IndexOutOfBoundsException int java.io.ObjectInputStream.read(byte[], int, int) ObjectInputStream.java:1808 void oracle.xml.io.XMLObjectInput.ensureCapacity(int) XMLObjectI nput.java:347 byte oracle.xml.io.XMLObjectInput.peekByte() XMLObjectInput.java :163 void oracle.xml.parser.v2.XMLNode.readChildNodes(oracle.xml.io.XM LObjectInput, oracle.xml.comp.CXMLContext) XMLNode.java:1800 void oracle.xml.parser.v2.XMLNode.readChildNodes(oracle.xml.io.XM LObjectInput, oracle.xml.comp.CXMLContext) XMLNode.java:1797 void oracle.xml.parser.v2.XMLNode.readChildNodes(oracle.xml.io.XM LObjectInput, oracle.xml.comp.CXMLContext) XMLNode.java:1797 void oracle.xml.parser.v2.XMLNode.readChildNodes(oracle.xml.io.XM LObjectInput, oracle.xml.comp.CXMLContext) XMLNode.java:1797 void oracle.xml.parser.v2.XMLElement.readExternal(java.io.ObjectI nput) XMLElement.java:1574 int java.io.ObjectInputStream.inputObject(boolean) ObjectInputS tream.java:1212 java.lang.Object java.io.ObjectInputStream.readObject(boolean) ObjectInputSt ream.java:386 java.lang.Object java.io.ObjectInputStream.readObject() ObjectInputStream.ja va:236 void java.util.Hashtable.readObject(java.io.ObjectInputStream) H ashtable.java:799 java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) native code boolean java.io.ObjectInputStream.invokeObjectReader(java.lang.Objec t) ObjectInputStream.java:2214 int java.io.ObjectInputStream.inputObject(boolean) ObjectInputS tream.java:1411 java.lang.Object java.io.ObjectInputStream.readObject(boolean) ObjectInputSt ream.java:386 java.lang.Object java.io.ObjectInputStream.readObject() ObjectInputStream.ja va:236 java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Objec t, com.evermind.server.ejb.AbstractEJBHome)

    Carol,
    The file is not being read by the programmer.
    The problem seems to be coming when the code tries to return from an ejb call A hashtable is returned while coming back. In this hashtable, the data is present in the form of XML DOM Object(oracle implmentation, because oracle xml development kit is used). I think this exception is coming when EJB tries to serialise the object to send it back.
    So, this exception is compeletely stemming from internal classes of Oracle
    The code is part of a web project.
    regards,
    Amol Behrani

  • Error "An exception occurred within the external code..." when stopping LabView

    I am having an error "An exception occurred within the external code called by a Call Library Node...", see the attached image, when I am trying to stop LabView. As a result of the error, the tag engine doesn't close normally.
    I am using LabView 7.1 with DSC. I read values from a LNS (LON) OPC-server.
    Is this a known issue and is there any way to repair it? I haven't noticed any direct consequences because of the error except that when I re-start LabView and the close it again without having first rebooted the computer, tag engine sometimes starts again when it should stop. This is fixed by always rebooting the computer before restarting LabView. I am getting suspicious that there might be some strange behaviour because the error says "it might have corrupted LabView's memory".
    For example, sometimes when I have made a copy of an input number field to another, they follow each other's value changes even though there is no connections between them.
    Simo Martikainen
    Message Edited by Simo Martikainen on 12-17-2008 03:11 AM
    Attachments:
    LabView stop error.JPG ‏45 KB
    TAGENGINE.JPG ‏16 KB

    Especially in earlier versions of LV these sorts of errors were common if the call wasn't made just right or the parameters were set up incorrectly.
    Where did you get the DLL from? Was it written internally or did it come from another vendor?
    Try building a DLL call into a very small, simple application. Do you see the same issue?
    Are there multiple calls to the same DLL in your code? If so, is there problems with all of them?
    Can you track it down to a specific function that you are trying to access that is causing the problem?
    Is there any indication of a memory leak?
    Finally any additional information you can provide would helpful.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • HTML-DB 1.6 (Apex) calling an URL and go back to the calling page

    Hi everybody,
    Is there somebody who can help us ?
    We have a button in your page which call an URL link. This link creates operate a job that will make an XML document. We try to use target....blank to open a new window and after the job is finished to close this new window; but it doesn't work, no new window have been created.
    But, we want to go back to the calling page after doing the XML document creating job. We can't go back to our calling page, the application is gone.
    How, we can do this?
    Thanks. Bye.

    Hi Timiche,
    Firstly, create a new region on your calling page and add in the following as the region's Region Source:
    <script language="JavaScript" type="text/javascript">
    function exportList(page)
    var url;
    url = 'f?p=&APP_ID.:' + page + ':&APP_SESSION.';
    w = open(url,"winExport","Scrollbars=1,resizable=1,width=100,height=100");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>
    <a href="javascript:exportList('n');">Export XML</a>
    Replace n with the page number for your xml export. Notice that I've added an A tag here - you can style this to look like a button if you like.
    I have also set a branch back to the calling page, but this should not be used by the A tag as it doesn't submit the page - I've just included it on my page for completeness.
    Secondly, on your page containing the xml export, make the following settings:
    In the Page Attributes, set the Page Template to "Popup"
    In the Region's Region Definition, set the Template to "No Template"
    In the Region's Report Attributes, set the Report Template to "export: XML"
    And, here's my working example:
    http://htmldb.oracle.com/pls/otn/f?p=42012:1
    Regards
    Andy

  • An error occurred while backing up the user's  home folder

    I have a user account that I'm trying to remove from a computer. I have updated to 10.5.2, and restarted a number of times and repaired permissions. There were 3 accounts on the machine I'm trying to remove, and the first 2 deleted just fine. However, this last one, the most important one, will not delete and save to a dmg file.
    The error message is "an error occurred while backing up the user's home folder" shortly after beginning the process.
    log file shows:
    /08 12:52:49 AM authexec[266] executing /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-hel per
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] 2008-02-28 00:53:13.213 writeconfig[209:10b] DILDiskImageCreate: internal error - missing kDIHLCreateImageComponentsKey in return dictionary
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] 2008-02-28 00:53:13.230 writeconfig[209:10b] DIHLDiskImageCreate failed: 999 (options:{
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "create-content-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "iff-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "any-owners" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "copy-uid" = 501;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "no-cross-dev-nodes" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] scrub = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "skip-unreadable" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] url = file://localhost/Users/woneal/;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "nbi-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] filesystem = "HFS+";
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] layout = SPUD;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "create-target-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "image-type" = UDIF;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] overwrite = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] url = file://localhost/Users/Deleted%20Users/woneal.dmg;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "suppress-uiagent" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] })
    any ideas?

    This is the correct steps to solve this problem:
    1. Cancel the update (with the backing up error, of course)
    2. Do a manual backup
    3. Do a manual restore (your password to unlock your backup file is your AppleID password, not your IPhone keypad password)
    4. Now Update your phone. This time the backup should work.
    5. After it is updated, it will automatically restore, if you choose to restore not to set up a new phone.
    And yes, copy all your photos manually. Your backup probabally won't include photos.
    If this still doesn't work, try to stop your anti-virus software.

  • [svn:bz-trunk] 15217: Bug: BLZ-508 - If server receives message for an unknown destination it shouldn ' t include the destination name in the error message sent back to the client .

    Revision: 15217
    Revision: 15217
    Author:   [email protected]
    Date:     2010-04-05 03:43:36 -0700 (Mon, 05 Apr 2010)
    Log Message:
    Bug: BLZ-508 - If server receives message for an unknown destination it shouldn't include the destination name in the error message sent back to the client.
    QA: Yes
    Doc: No
    Checkintests: Pass
    Details: Changed the error message to not include destination id. I'm also checking in a few minor fixes I had locally.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-508
    Modified Paths:
        blazeds/trunk/modules/common/src/flex/messaging/errors.properties
        blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java
        blazeds/trunk/modules/core/src/flex/messaging/cluster/JGroupsCluster.java

    Thanx Mete, yeah i did...
    but i solved it some other way... not entirely sure this was
    it though as i was doing a lot of things at once...
    it was fds.swc... possibly it was out of date or missing.

  • Caller doesn't hear a ring back if the call is ringing on agent phone

    Hi team,
    can anybody help me? Here in Germany there are a lot of customers that don't understand why the caller doesn't hear a ring back when the call is ringing on agent phone for instance with UCCX 8. I read some discussions here for that issue but the only solution for that should be to change the MOH on CUCM. This is not a very good solution when the call in queue is set to hold he will hear the ring back tone in the queue as well :-(
    Has anybody another solution for that issue???
    All the discussion I've read was for IPCC version 4 or so. Is there another solution for this issue in version 8.x
    In one discussion I found the following solution:
    Yes, To resolve this issue,Set up a Send H225 User Info Message  service parameter for Cisco CallManager service in CallManager. Perform  the following steps:
    In Cisco CallManager Administration, select Service > Service Parameter.
    Select the correct server from the drop-down list.
    Set the service to Cisco CallManager.
    In  the Send H225 User Info Message field, under the Cluster Wide  Parameters (Device - H323) section, select H225 Info for Ring Back.
    Reset the H.323 voice gateway.
    After completing this procedure, the caller hears ring back when the agent phone is ringing.
    Does it realy work?
    Need you help!
    Thanks in advance.
    Tobias

    Hi Tobais
    you right one of the solutions is to change the MOH to the ring back one
    however there are two types of MOH that you need to select
    use MOH is the music to be played while the call on hold/ in queue
    use Network MOH which is the oneyou need to change to the ring back MOH source file so when the call get transferred to an agent ring back MOH will be played
    these options under the CTI ports in UCCX
    also you can search the forum here and there are many discussions about this topic
    HTH
    if helpful Rate

  • I am trying to update itunes version 500 resule is an error occured while backing up the ipad 5000 would you like to continue..will resule in loss of all contents on ipad...i can't loose all that.what to do

    an error occured while trying to update i tunes version 500...it read an error occured while backing up the ipad (-5000)would you like to continue..to contunue will result in loss of all contents on ipad...i don't want that to happen....my first time doing any of this....

    am i replying to myself.......this is confusing.....where is my answer?

  • History report error: | An Exceptional Error occurred. Application exiting. Check the log file for error 5022

    Hi all
    I've got a error msg when try to generate a report using Cisco history report tool:
    Error | An Exceptional Error occurred. Application exiting.  Check the log file for error 5022
    It only happens when choose report template: ICD_Contact_Service_Queue_Activity_by_CSQ_en_us.
    User tried samething on other PC, it working fine.
    only on user' own PC and only choose this report, error appears.
    user runing windows 7 and do not have crystal report installed
    tried reinstalled the software, doesn't work.
    also tried this: (https://cisco-support.hosted.jivesoftware.com/thread/2041254) - doesn't work
    then tried https://supportforums.cisco.com/docs/DOC-6209  - doesn't work
    attached the log file.
    thanks.

    wenqianyu wrote:From the log file:Looks like you get a Login Window.Error message showed up after username/password be enteredThere is an error in the log: Error happened in comparing UCCX version and HRC versionYou may need to do a clean uninstall, download the Historical report from the server, and install it again on the PC.Does this only happen to one PC or to every PC with this application?Wenqian 
    I have completely uninstalled the HRC, and download from server install again -- still doesn't work with exactly same error.
    this matter only happens on this PC, when user try same thing on other PC, it works.
    so i think it not relate to server or account.

  • CR with Universe error: Unhandled exception in WebI server call

    Hi,
    I encounter an error when creating CR report with did any one ever got Unhandled exception in WebI server call when dragging objects into filter querys of query panel? This worked fine few days ago but failed now. I have check the BO servers are running and tried starting the machine, also not okay. Anyone can help. Thanks
    Charing

    Hello,
    I get the same "Unhandled exception in webI server call" when I run my add more objects in my crystal report. I was wondering if you found solution to this exception. I will really appreciate if you can share the solution.
    Thank you

  • Interactive report - Problem in coming back to the same cursor position

    Hi,
    I have an interactive report. In the first list of the output, a set of data will be displayed. In that first list, if I double click on a field, it goes to a Custom Screen. There, I have to enter some data and save and come back to the first list of the output. This is what my report does.
    I have no issues when the output in the first list is one page. But, when I have the output for more than one page I have a problem. I am going to the 2nd or 3rd page of the output. From there I double click on the field and it goes to the Custom screen. After saving the data in the screen, when I click BACK button, it displays the report from the first page again instead of displaying the output in the 3rd page where I double clicked.
    My requirement is, when I come BACK from the screen to the list, the cursor should stay in the same page where I double clicked earlier. It shouldn't go to the first page of the list again.
    To my knowledge, we have to use a statement in the code after displaying the output.
    Could someone tell me how to do this..?
    Thanks in advance.
    Best Regards,
    Paddu.

    Have a look at the ABAP command "scroll list"... you will need to hold onto the values of sy-lsind, sy-cpage, and sy-staro prior to the call to your popup, and then after you come "BACK" from this, you will need to re-write your report followed by something like:
    scroll list index gs_rpt-lsind   "gs_rpt used to hold the previous SY- values
      to page gs_rpt-cpage
         line gs_rpt-staro.
    Jonathan

  • Sending exceptions back to the client : in return object or in a SOAPFault?

    Hi.
    A question for all the JAX-RPC/SOAP experts out there.
    What is your recommendation for the cleanest way to handle exceptions in a Java web service and send the info back to the client ?
    I am considering two options :
    1- Put the exception info in fields of the object returned by the web service method.
    2- Throw a SOAPFaultException and add any necessary info in the Detail attribute of the Exception using a SAAJ SOAPFactory. In this case, how does the client retrieve the SOAPFaultException attributes ?
    What is the best option ? Pros and cons ?
    Thanks in advance.
    Fabien

    It throws jvm bind error. Please show the full exception stack trace and the block of code it occurs in. The server shouldn't be trying to do a bind at this point.

  • WE DEMAND CALL RATES BACK DURING THE CALL!!! 6.20....

    Hi
    this has been going for some time now, i reported this with Skype's second tier level support at [e-mail removed for privacy and security], i was being told that the DEVs will implement this very soon, this was May and August, YET this feature is not back.
    Can someone else email them there please? They are nice answeering back but not much done for this since 5 months+.
    I think is one of the MOST USEFUL FEATURES to have, that is when you call that in the window you will display call costs!
    I recently upgraded to the very latest 6.20.0.104 yet the feature is not YET back!
    I am quite disappointed and i think it's a technique so that people will not see what they are spending during the calls!
    Anyone with me? Let's keep this thread active until someone at Skype does something!
    thanks
    Gabrio

    It also annoys me that the call credit is no longer shown during calls.  This was a helpful feature in a previous version of Skype, especially when overseas or when calling mobile numbers.  As I top up the credit manually, its handy to know when one is reaching $0.00 while a call is in progress.
    Bring back the call $ meter
    [Removed for privacy]

  • How to get back to the calling application ?

    Hi Friends ,
                I am having a BSP application which is being called from different Planning layouts in BPS .
      Its a stateful application and I am finding that when i hit standard browser Back button i am returning to my application again .
      I tried creating a button and passing the javascript method history.back()
    <htmlb:button id       = "BACK"
                                onClick  = "BACK"
                                text     = "BACK"
                                tooltip  = "Back"
                           disabled = "<%= v_save_disable %>"
                           onClientClick="history.back();"
                                width    = "15" />
    it is notworking.
    Please let me know how can i resolve the issue ? I have another idea to divert the user to the calling application using URL but dont know how to capture the URL of calling application ?
    i appreciate your contribution in advance.

    <i>It generates a BSP in which i am adding a URL link to call my application.</i>
    while adding the url add a parameter to it masterdatabsp.htm?frompage=<currentpagename>
    (runtime->PAGE_NAME will return current page name)
    and in the master data maintenance bsp page declare a page attribute and name it frompage type string and check the auto check box.
    now within your masterdatamanintenance bsp you will have the calling page name.
    Hope this is clear. if not do getback.
    Regards
    Raja
    i work in a place where weekends are on thursdays and fridays - today is a working day

  • Error in critical report ERROR Text is appearing in the dollar

    Hi guru's,
    i'm having issue in a report . ERROR Text is appearing in the dollar amount  field(Column) inods level andDB level its working fine  but in the reporting it displays  with the "ERROR" text
    in production system  this issue starts from this month only till june its working fine
    the report looks like in the production system in july is
    state /provinence           country
    2.17 ERROR                  0.00
    3.45 ERROR                 0.00
    0.00                              2.11ERROR
    Kindly let me know......Helpful answers will be rewarded

    Hi,,
    Have u correctly assigned 0CURRENCY to ur R/3 source field which has currency units liek WAERS
    Check if there data in them
    In reporting side,,
    Can u give this NODIM(Key figure), then execute the query again.
    It shud nt show up
    thanks

Maybe you are looking for