How to Include Warnings/Error messages in Return Service Data Object

Hello All,
I am using Jdeveloper 11.1.1.3.0, ADF BC. and want to publish Service-Enabled application modules, specifically I want to publish a custome method in the application module as a web service.
While going through Enable support for Service Interface wizard as explained in developer guide, in step 7 I read this
>
7. To expose service information messages such as warnings and exceptions for a custom method or warnings for process operation methods, select Include Warnings in Return Service Data Object. For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
If Include Warnings is not selected, no informational messages will be returned with the service response. This option is only enabled when the method does not return a view row or a list
of view rows. When the method returns view rows, the underlying view object determines whether the method supports warnings, as described Section 11.2.4, "How to Service-Enable Individual View Objects." The informational messages (and warnings) are reported as part of the return object. JDeveloper generates appropriate wrappers as the return objects, and the wrappers contain the actual method return and the informational messages.
>
I am interested in this part: For example, you might want display an informational message when a method returns the total employee compensation and the total is outside of the desired range.
To do this, I write a method in the application module
public Number getEmpSal(Number empId){
        EmployeesViewImpl employeesView1 = this.getEmployeesView1();
        //this is the bind variable setter
        employeesView1.setEmpId(empId);
        employeesView1.executeQuery();
        EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
       return first!=null ? first.getSalary() : null;
}and I selected the Include Warnings in Return Service Data Object check box. but how and where can I expose the error or warning message?
Note:
I tried to throw an exception in the method
public Number getEmpSal(Number empId){
        EmployeesViewImpl employeesView1 = this.getEmployeesView1();
        //this is the bind variable setter
        employeesView1.setEmpId(empId);
        employeesView1.executeQuery();
        EmployeesViewRowImpl first = (EmployeesViewRowImpl)employeesView1.first();
        if(first!=null && (first.getSalary()!=null || first.getSalary().compareTo(1000)==1))
            throw new JboException("out of range salary");
         return first!=null ? first.getSalary() : null;
}and when I test the web service for some employee I get this response:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
     <env:Body>
          <env:Fault>
               <faultcode>env:Server</faultcode>
               <faultstring>out of range salary</faultstring>
               <detail><tns:ServiceErrorMessage xmlns:tns="http://xmlns.oracle.com/adf/svc/errors/" xmlns:xsi=      "http://www.w3.org/2001/XMLSchema-instance"><tns:code/><tns:message>out of range  salary</tns:message><tns:severity>SEVERITY_ERROR</tns:severity><tns:exceptionClassName>oracle.jbo.JboException</tns:exceptionClassName></tns:ServiceErrorMessage>
               </detail>
          </env:Fault>
     </env:Body>
</env:Envelope>but is this the right approach or there is another place to show error/warning messages?
Edited by: Mohammad Jabr on Apr 16, 2012 1:17 PM

This is fine if you raise exception from your code. It will be raised as a server fault only.

Similar Messages

  • In Ztable creation, How can we display error message for a 'To date' field.

    Hi all,
    I have a requirement like this.
    There r two fields in ztable. From date and To date.
    The field 'To date' in table ZKM007 is taking before date than From date field.
    To date should always be greater than from date i need to throw an  error or don't  allow to enter date  if date is less than From date.
    How can we do this?
    Can any one help on this?
    Rewards to all.
    Thanks & Regards,
    Anu.

    I have written below code at event "Creating a new entry" (05) in table maintainance generator.But it is not working. If we give the to date < From date ,
    it is saving.
    Can any one help on this code? Pls Give me code And which event i have to put this?
    ***INCLUDE LZEXE3F01 .
    FORM AT_entry.
    IF ZEXE3-TODATE LT ZEXE3-FROMDATE.
      MESSAGE I001(0) WITH 'ENTER TO DATE GREATER THAN FROM DATE'.
    ENDIF.
    ENDFORM.
    Rewards to all.
    thanks
    Anu.

  • How to read the error message like clipping positive or -ve in Tektronix oscillioscope 3012B

    During acquiring the Sine wave or triangular wave from TDS3012B, if the amplitude or Max or min is clipping, how do you read the error?  I used *ESR?, first time when I ran the error query program, it gave me Error message saying it is clipping, after that If I run again,the error query , It would not give me the error message, I couldn't reproduce it, eventhough but On the screen if I measure, Amp, min and Max it says that it is clipping positive or -ve. I was wondering how to read the error message while aquiring the data?  If any one could help me that would be of great help.. Thanks

    Usually, reading the error status register clears it. I'm not familiar with this particular model of scope but you may have to initiate a new acquisition in order for the scope to generate a new error. Another possiblity is that a new error will be generated when the vertical scale changes. Unless someone posts with an answer, I'd say that your best bet to get an answer is to contact Tektronix technical support.

  • How to show custom error message in WebADI Excel template?

    Hi,
    I've  created a custom Web ADI integrator and associated it with a 'Procedure' based custom interface.
    WebADI Interface API Returns is set to  "Error Message".
    I'm using  raise_application_error(-20001, "Actual Error Message") for invalid rows,but custom error message from PL/SQL  is not populated on the excel template.
    Instead it is showing "SQL exception occurred during PL/SQL upload".
    Am I missing anything? How to show custom error message from Pl/SQL procedure to WebADI Excel template?
    TIA
    Narasimha

    The custom API errors are visible in the BNE log but not on the Excel.
    BNE Log=>
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Exception while uploading to PL/SQL API.  Error Code: 20001, Message: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Stack trace: java.sql.SQLException: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
      at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
      at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
      at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550)
      at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4710)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
      at oracle.apps.bne.integrator.upload.BnePLSQLUpload.doUpload(BnePLSQLUpload.java:284)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.processDeepestLevel(BneSAXUploader.java:2346)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.startElement(BneSAXUploader.java:1182)
      at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:181)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:234)
      at oracle.apps.bne.integrator.upload.BneUploader.processUpload(BneUploader.java:301)
      at oracle.apps.bne.integrator.upload.BneAbstractUploader.processUpload(BneAbstractUploader.java:114)
      at oracle.apps.bne.integrator.upload.async.BneAsyncUploadThread.run(BneAsyncUploadThread.java:140)
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 WARNING        BneOracleWebAppsContext.getTimeZone CLIENT_TIMEZONE_ID has not been set
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 ERROR          BneOracleWebAppsContext.getExtraJDBCConnection recieved the same connection as the base connection.  There may be transaction problems.
    How to show the same error in the excel template?
    Here is the package:
    CREATE OR REPLACE PACKAGE BODY APPS.XXPO_COSTFACTS_WEBADI_PKG
    AS
       PROCEDURE upload_data (
                              P_CONTAINER_ID IN VARCHAR2
                            , P_SAIL_DATE IN DATE
                            , P_PO_NO IN VARCHAR2                     
                             ) IS
        --declare
        lv_err_msg      VARCHAR2(240);
        lf_err_flag     NUMBER := 0;
        ln_temp         NUMBER;
        BEGIN
        --------------------- checking for mandatory parameters---------------------------
          IF (P_CONTAINER_ID IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg||'-'||'Please enter CONTAINER_ID - ';
          END IF;
          -------------Validation for Sail Date Format----------------------
          IF (P_SAIL_DATE IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter Sail Date - ';
          ELSE
             BEGIN
                SELECT 1
                  INTO ln_temp
                  FROM DUAL
                 WHERE P_SAIL_DATE =  TO_DATE (TO_CHAR (P_SAIL_DATE, 'DD-MON-YYYY'), 'DD-MM-YYYY');
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format';
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format'|| SQLERRM;
             END;
          END IF;
          -------------Validation for PO_Number----------------------
          IF (P_PO_NO IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter PO_NO - ';
          ELSE
             BEGIN
                SELECT count(1)
                  INTO ln_temp
                  FROM PO_HEADERS
                 WHERE Attribute4 =  P_PO_NO;
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' No Oracle PO for Biceps PO#'||P_PO_NO;
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Error getting the Oracle PO for Bicpes PO#'||P_PO_NO||' Error-' || SQLERRM;
             END;
          END IF;
         -----------------------Insert Record----------------------------
         IF lv_err_msg is NULL THEN
         BEGIN
             INSERT
              INTO XXP2P_HW_COST_FACTORS_STG
                     CONTAINER_ID
                    ,SAIL_DATE
                    ,PO_NO
                    , ERROR_FLAG
                    , ERROR_MSG
                   ,CREATED_BY
                    ,CREATION_DATE
                    ,LAST_UPDATED_BY
                    ,LAST_UPDATE_DATE
                    ,LAST_UPDATE_LOGIN              
                VALUES
                     P_CONTAINER_ID
                    ,P_SAIL_DATE
                    ,P_PO_NO              
                    ,lf_err_flag
                    ,lv_err_msg
                  ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.LOGIN_ID              
                  --  commit;
                  DBMS_OUTPUT.put_line
                    '-' || 'After ap_invoices_interface'
            EXCEPTION
            WHEN OTHERS THEN
              ROLLBACK;
              lf_err_flag := 1;
              lv_err_msg  := lv_err_msg || ' ' || 'error loading CONTAINER_ID-' || P_CONTAINER_ID || SQLERRM;
              raise_application_error(-20001, lv_err_msg);
            END;
        ELSE
              raise_application_error(-20001, lv_err_msg);
        END IF;
      END upload_data;                        
    END XXPO_COSTFACTS_WEBADI_PKG;

  • How to display an error Message in Web Dynpro

    Hello,
    I want to display an error message in Web Dynpro. I'm using this,
    IWDMessageManager message = wdComponentAPI.getMessageManager();
    message.reportSuccess("<some relevant debug message>");
    However, the message is always shown at the bottom of the screen. It is possible to select the location in the screen for showing this object? Or what is the best way for doing this? I've tried to use a Label but I can't set the type (warning, error, info) it's only a message.
    Thanks
    Regards
    SU

    Hi,
    If you include the UI, it will display at the top of the screen..
    Please see below how to create a message in the message editor.
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    and this is how you access the error message in the application ti display it to the end user
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    Regards,
    Ganesh N

  • How to configure a error message

    Hello,
    I have a User bean that hold informations about a user login ( login and password ). I write a method protected String logon() that search if the login and the password entered by the user match with those stored in a database. If not, i would like to add an error message to the FacesContext and so return null value.
    My question is : how to add an error message to the FacesContext and so to get it in the current page.
    Thanks

    Hi flam70,
    well, in my opinion you should do any access to your business logic in an action class and in the invoke application phase and not in the validation phase.
    Your Action class returns e.g. "success" if the user passed the authentication and "null" if not (if jsf gets null value it returns on the same page back)
    To put the error message into context you may do following:
    In the invoke() Method of your Action class do authentication against your database.
    If it fails, use the component(s) that were wrong for the error message(ids e.g. "username" and "password").
    Add the message into context:
    context.addMessage(nameComponent, new MessageImpl(Message.SEVERITY_INFO, "Username not found !", "LoginError"));
    context.addMessage(passwordComponent, new MessageImpl(Message.SEVERITY_INFO, "Password wrong !", "LoginError"));
    On your jsp page you use the error tag:
    <h:output_errors for="username" />
    <h:output_errors for="password" />
    Greetings,
    Rene

  • Delete windows warnings, error messages from hard drive

    delete windows warnings, error messages from hard drive

    Hello @NeoTaino,
    I have read your post on how your desktop computer is displaying a "delete Windows warning, error messages from hard drive". Did you install any hardware or software recently? What does the full error message state as it appears on the screen? I would be happy to help you, but first I would encourage you to post your product number for your computer. Below is a is an HP Support document that will demonstrate how to find your computer's product number. In addition, it will also help if you indicate which operating system you are using; and whether your operating system is 32 or 64 bit. The more information you can provide, the better!
    How Do I Find My Model Number or Product Number?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Please re-post with the necessary information, this way I will be able to research this further for you. I look forward to your reply!
    Cheers!
    MechPilot
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks” for helping!

  • How do I resolve error message R6034

    How do I resolve error message R6034 when trying to access itunes

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • TS4223 How do I bypass error message and download movie to my computer, then transfer to my iPod?

    How do I bypass error message just to download HD movie to my computer, so I can transfer to my iPod and/or my iPhone?

    What does the error message say? (Precise text, please. Include error message numbers if you're getting any.)

  • How to customize the error messages in web analysis reports

    Does anyone know how to customize the error messages that web analysis shows ,
    I want to customize the below error message with a custom error message
    "Document does not exist or no authorization to open document.Error occurred while loading document"
    Does anyone know how to do this ?

    Rajesh,
    you may want to check these links
    How to the Change the Application Stopped Message
    How to Change the Dispatcher Running, No Server Connected Message
    http://help.sap.com/saphelp_nw70/helpdata/en/65/18fc3f9ec4e669e10000000a155106/frameset.htm
    Thanks
    Bala Duvvuri

  • How can we trigger error message in BADI PARTNER_UPDATE

    Hi All,
    I have implemented a BADI PARTNER_UPDATE. In this I have validation ( Error Message ) on saving buisness partner.
    It is giving the error message but it freeze all the fields. On pressing enter it goes for short dump.
    In short dump it gives error The COMMIT WORK processing must not be interrupted.
    Kindly suggest me that how can we pass error message and it also does not freeze the fields.
    Regards,
    Narendra Goyal

    Hi Narendra,
                          How are you trying to display message.
    Is it using message service class instance of message statement (which should not be used, as that is for GUI messages) or using collect FM or by adding to genil message class container.
      Please try different approaches and see what works for you.
    Thanks,
    Rohit

  • How to fix this error message The backup disk image "/Volumes/AirPort Disk/FARES DEL VALLE's iMac.sparsebundle" could not be accessed (error -1).

    how to fix this error message The backup disk image “/Volumes/AirPort Disk/FARES DEL VALLE’s iMac.sparsebundle” could not be accessed (error -1).

    The troubleshooting C17 is the specific article.
    http://pondini.org/TM/Troubleshooting.html
    This is generally a Lion error.. and you will need 5.6 utility to get access to the disk area.
    So download the real utility. Run it instead of v6 toy version.
    http://support.apple.com/kb/DL1482
    Go to the manual setup, disk page and click on disconnect all users.. that will unmount all users connected to the disk and allow it to start working. But there are a number of other issues that are possible cause. Pondini lists some of them.

  • How to populate a Error message in WebUI Screen

    Dear Experts,
    I have a small issue in Lead creation screen. I need to restrict the followup document if the lead end date is lesser than the system date, if the end date lesser than the system date system should through a error message in web Ui Screen and the lead follow up creation should be stoped.
    We found an enhancement spot in backend(GUI) of lead creation we raised the error message in the backend screen. Here its working fine, But we are not able to get any error message in WebUI lead creation screen.
    We written the code in CREATE_ORDER Method of lead creation in GUI ( tcode : CRMD_ORDER). We tried to debug the program using external debuger from webui but its not getting triggered.
    Pls suggest me, how to raise a error message for WEBUI lead follow up creation validation.
    Kindly do the needful.
    Reg,
    Anandhan

    HI Anandhan,
    Try this way,
    This should work.
    lr_global_messages type ref to cl_crm_genil_global_mess_cont,
            lr_core                 type ref to cl_crm_bol_core,
      "Instantiate the error message class.
      lr_core = cl_crm_bol_core=>get_instance( ).
      if lr_core is bound.
        lr_global_messages ?= lr_core->get_global_message_cont( ).
      endif.
            if lr_global_messages is bound.
              call method lr_global_messages->add_message
                exporting
                  iv_msg_type       = lv_msg_type
                  iv_msg_id         = '
                  iv_msg_number     =
                  iv_show_only_once = 'X'
                  iv_msg_v1         =
                  iv_msg_v2         =
            endif.

  • How To Display Error Message In Self Service Page

    Dear All,
    I am using 11.5.10 Oracle HRMS self Service ,,,
    How can I display error message on the top of the self service page if some action happen ?
    Best Regards

    Time entry rules maybe?

  • I have install last update for i pod(ios5) but during installation there was one problem....i have restore my ipod and now i have lost all my buyed music!!Is not possible download it....?What are the details, including any error messages, related to your

    I have install last update for i pod(ios5) but during installation there was one problem....i have restore my ipod and now i have lost all my buyed music!!Is not possible download it....?What are the details, including any error messages, related to your question?

    Have you not got the music on your computer and/or on backups on, for example, external drives or CDs/DVDs ?

Maybe you are looking for