Exception Handling when calling a PHP Webservice

I followed a great tutorial on setting calling PHP services from ABAP ([Accessing arbitrary databases from within ABAP using a PHP data hub and web services|Accessing arbitrary databases from within ABAP using a PHP data hub and web services]).   Unfortunately I'm getting occassional CX_AI_SYSTEM_FAULT exceptions and I don't know how to handle them gracefully.
I'm calling the web service ABAP code from an RFC function which for some reason doesn't allow TRY/CATCH statements (I get a message saying "During RFC/update, no exception classes can be used".) 
I'd be happy enough just to ignore the error since it's currently dumping users out of order entry.
To make matters more complicated, I can't TRY/CATCH my own RFC since I'm calling it from GuiXT
I'd really appreciate help on this; I'm pretty stumped.
Thanks,
Lee

Well, to answer my own question, I found an ugly workaround.
Change attribute from "Remote-enabled" to "Normal Function", add the TRY/CATCH logic.  Then call this function from the "real" RFC.
Off to program like it's 1979!
Lee

Similar Messages

  • Exception happened when calling deliver API for BI Publisher Bursting

    Hi All,
    I have developed a BI Publisher report on OBIEE standalone instance (Oracle Business Intelligence 11.1.1.5.0).
    I am able to generate the report and burst the output to emails successfully.
    But when I tried to burst the output directly to the printer or to save the output FILEs to local machine, am getting the below error/exception.
    For PRINT type...error is below
    Document delivery failed
    [INSTANCE_ID=bisrv.oracleads.com.1305914111196] [DELIVERY_ID=1182]Error deliver document to printer::Exception happened when calling deliver API::Error deliver document to printer::Exception happened when calling deliver API::oracle.xdo.delivery.DeliveryException: oracle.xdo.delivery.DeliveryException: java.net.UnknownHostException: blr-ibc-7a-prn1 oracle.xdo.service.delivery.DeliveryException: oracle.xdo.delivery.DeliveryException: oracle.xdo.delivery.DeliveryException
    for FILE type.... error is below
    Document delivery failed
    [INSTANCE_ID=bisrv.oracleads.com.1305914111196] [DELIVERY_ID=1192]Error deliver document to file::FILE=[D:\Harish:9930609876-10001969343.pdf::Exception happened when calling deliver API::FILE=[D:\Harish:9930609876-10001969343.pdf::Exception happened when deliver to file:: FILE_NAME= D:\Harish/9930609876-10001969343.pdf] ::oracle.xdo.delivery.DeliveryException: java.io.FileNotFoundException: D:\Harish/9930609876-10001969343.pdf (No such file or directory)oracle.xdo.ser
    Can anyone please help on this?
    Thanks,
    Harish

    Hi Varma,
    thanks for the reply.
    Here are the below sql scripts I used.
    -- Printer
    SELECT BILL_NUMBER      KEY,
    'Layout'           TEMPLATE,     
    'en-US'                     LOCALE,
    'PDF'                          OUTPUT_FORMAT,
    'PRINT'                     DEL_CHANNEL,
    BILL_NUMBER                OUTPUT_NAME,
    'true'                          SAVE_OUTPUT,
    'Direct Printers'           PARAMETER1,
    'LocalPrinter'               PARAMETER2,
    1                               PARAMETER3,
    'd_single_sided'           PARAMETER4,
    'default'                     PARAMETER5
    FROM XXXX_BILL_TAB;
    -- File
    SELECT BILL_NUMBER           KEY,
    'VLayout'           TEMPLATE,
    'RTF'               TEMPLATE_FORMAT,
    'en-US'           LOCALE,
    'PDF'           OUTPUT_FORMAT,
    'FILE'           DEL_CHANNEL,
    'true'           SAVE_OUTPUT,
    'Monthly Bill for ' || MOBILE_NUMBER OUTPUT_NAME,
    'D:\Harish'      PARAMETER1,
    MOBILE_NUMBER||'-'||BILL_NUMBER     PARAMETER2
    FROM XXXX_BILL_TAB;
    Thanks,
    Harish
    Edited by: 899863 on Dec 16, 2011 4:01 AM

  • Exception 1 When calling IWB_HTML_HELP_URL_GET occured

    Hi,
    Could any body help me to overcome from the below problem.
    While executing the queries with an end user id (ofcourse we have only
    one Enduser id presently) in Analyzer we are getting the error
    Exception 1 When calling IWB_HTML_HELP_URL_GET occured.
    But in the query designer , while executing the query as Display Query
    on the web , we are not getting any error with that userid.And also we
    are not getting this problem with the userid which has all
    authorizations.
    Kindly provide a help to sort out this problem in the Analyzer.
    We are working on Netweaver 2004s and on SP 13. And using 7.x Analyzer.
    Thanks and Regards,
    Anil Kumar Sharma .P

    Hi Anil,
    check this thread it may be helpful....
    Re: How to install help files on BI 7.0 bex analyzer
    cheers
    Sunil

  • Exception Message when calling WebService component

    Hi,
    We are using a Webservice component in our workflow. I want to know if there is a way to get the Exception message when an exception occurs in the Webservice call. We want to be able to handle the exception in the Livecycle layer and not the Flex layer.
    When I draw a route from the Exception lightning bolt and select the type of Exception, it goes to the route when an exception occurs but I have not found a way to get the Exception message.
    Does anyone know how to do that?
    Thanks in Advance.
    A

    I'm using Linux in my server, and yes, my application is configured to run through an Http Proxy-server =)
    When running the application on local, I included the Ip of my webservice in the proxy exceptions, so It wasn't blocked.
    Maybe I have to remove the webService Ip from the exceptions, when running in the server.
    I'll provide you with more details of my server as soon as the person in charge arrives.
    But then, you think that exception is raised whenever the proxy or the application is blocking the webservice ip?
    If that's so, I think I have a good track to keep searching.

  • Need of exception handler in calling function, isn't that weird???

    Hi,
    I have written a function as follows
    public String fetchName(String query) throws Exception
              stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery(query);
              rs.next();
              return (rs.getString(1));
    I've handled the for exceptions here using "throws Exception". Inspite of that when i call it from other function and in that funtion no exception need to be handled, compiler gives errror.
    Following is the calling funtion
    public String checksubAction(String action)
              String retValue=" ";
    String query="";
              query = "select Title from dbo.Folder where Folder_Id="+folderId;
              retValue = dataBaseObj.fetchName(query);                                        
    but when i write it in try-catch block, no errror is given.
    Why is it that inspite of handling exception(s) in the called function, we need to handle them in calling functions.

    No you have not handled the exception. Your code say "fetchName" does NOT handle exceptions of type "Exception", the calling method should be aware of this, and handle that type of exception.
    The Java Tutorial: Essential Java Classes: Handling Errors Using Exceptions
    (Please when declaring a method can throw exceptions, be specific, i.e. throw SQLException in this case)

  • Exception handling in calling procedure

    Hi,
    i have a package where currently am making calls to private procedures from public procedure.
    and the senario is:-
    create package body p_tst
    is
    ex_failed exception;
    -- this is private proc
    procedure p_private
    is
    begin
    raise ex_failed;
    exception
    when ex_failed
    then
    raise;
    end p_private;
    procedure p_public
    is
    begin
    -- nomaking call to private
    -- procedure
    p_private;
    -- here i need to catch
    -- the raised exception
    -- passed from the called
    -- procedure
    when ex_failed
    end p_public;
    end;
    basically i want to catch the exception being passed from called procedure to calling procedure, and raise the same exception in calling procdure.
    is it possible to catch the same exception in the calling procedure?

    Yes, you can catch the same exception in the calling procedure, exceptions are propagated to the caller if they are not handled in the called procedure.
    Is this what you are trying to do?
    CREATE OR REPLACE PACKAGE p_tst
    AS
       PROCEDURE p_public;
       ex_failed   EXCEPTION;
    END;
    CREATE OR REPLACE PACKAGE BODY p_tst
    IS
       PROCEDURE p_private
       IS
       BEGIN
          RAISE ex_failed;
       END p_private;
       PROCEDURE p_public
       IS
       BEGIN
          p_private;
       EXCEPTION
          WHEN ex_failed
          THEN
             DBMS_OUTPUT.put_line ('error');
       END p_public;
    END;
    SQL> set serveroutput on;
    SQL> exec p_tst.p_public;
    error
    PL/SQL procedure successfully completed.

  • Exception Handling - WHEN OTHERS

    Good Day to All,
    When i am running a procedure in TOAD-Expert... it says below message.
    *'Avoid using a WHEN OTHERS clause in an exception section without any other specific handlers.'*
    PROCEDURE...
    IS
    BEGIN
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    -- Checking whether cursor is open
       IF cur%ISOPEN THEN
        CLOSE cur;
       END IF;
      UPDATE TABLE
      SET COL..
      WHERE ...
       COMMIT;
       RAISE;
    END procedure;

    The manner in which you are dealing with the exception is not wrong. Your handler does a couple of things:
    - rollbacks the existing transaction as failed
    - attempts resource protection (guard against resource leakage)
    - logs the error
    - re-raises the exception
    None of these are invalid actions when dealing with an exception.
    A suggestion though - move the UPDATE out of the exception and create a procedure that performs the logging for you (as an autonomous transaction). This way you have a reusable logging code unit that can be called from anywhere in your code.
    Resource protection for explicit cursors are also not that critical in PL/SQL - as cursor handles that go out of scope are automatically released. The exception being a ref cursor handle. Of course, you need to resource protect other handles (like socket and file handles). And seeing that PL/SQL does not offer resource protection blocks, the only alternative is to use the "+when OTHERS+" exception handler for that.

  • Deserialization Failed error when calling a SAP Webservice

    Hello,
    I'm trying to call an SAP Webservice from a .NET Mobile application, this particular BAPI expects an array of objects and when I make the call I get a deserialization problems.  I have tried make the array size to 0 but no luck, I have couple of other function modules which are working fine but have a problem with this BAPI BAPI_ALM_ORDEROPER_GET_LIST.
    any help is greatly appriciated.
    Thanks
    Vinay

    Dear Vinay,
    Does your other FM are also using arrays.?
    Deserialization problem comes when xml parser is not able to convert XML schema or values to language specific elements.
    And this problem normally comes if you are using complex data types.
    Can you check once again and reply.
    Regards,
    Piyush

  • 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....

  • Utl_file - exception handling when inserted in bulk.

    Hi,
    I am using Oracle 10gR2. I wanted to write data to a file. Due to huge number of records, I am collecting them into a collection, traversing e collection, appending the values in collection to a varchar variable with new line in a loop.If the array size is say 50, I will have 50 values in the Vatchar variable separated by CHR(10). and I will insert the variable using UTL_FILE.PUT so that 50 lines will be inserted with values into the file.
    Now my query is if any one among those 50 values gives an exception, I feel all the 50 values can't be loaded. Please suggest exception handling in this case.
    Regards,
    Naveen Kumar.C.
    Edited by: Naveen Kumar C on Sep 17, 2009 5:23 PM

    You could use a CLOB in conjunction with UTL_FILE to write it out 32K at a time...
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2    l_file    UTL_FILE.FILE_TYPE;
      3    l_clob    CLOB;
      4    l_buffer  VARCHAR2(32767);
      5    l_amount  BINARY_INTEGER := 32767;
      6    l_pos     INTEGER := 1;
      7  BEGIN
      8    BEGIN
      9      SELECT dbms_xmlgen.getxmltype('select * from emp natural join dept').getclobval()
    10      INTO   l_clob
    11      FROM   dual;
    12    EXCEPTION
    13      WHEN NO_DATA_FOUND THEN
    14        RETURN;
    15    END;
    16    l_file := UTL_FILE.fopen('TEST_DIR', 'Sample2.txt', 'w', 32767);
    17    LOOP
    18      DBMS_LOB.read (l_clob, l_amount, l_pos, l_buffer);
    19      UTL_FILE.put(l_file, l_buffer);
    20      l_pos := l_pos + l_amount;
    21    END LOOP;
    22  EXCEPTION
    23    WHEN NO_DATA_FOUND THEN -- occurs when end of CLOB reached
    24      UTL_FILE.fclose(l_file);
    25    WHEN OTHERS THEN
    26      DBMS_OUTPUT.put_line(SQLERRM);
    27      UTL_FILE.fclose(l_file);
    28* END;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL>

  • 11g preview version 3: JNDI Lookup problem when calling PL/SQL webservice

    Hi,
    I am experiencing a problem when calling a PL/SQL Webservice from a BPEL flow.
    When I am trying to test my BPEL flow from the SOA Console I get a "Error doing JNDI lookup on target jdbc/MyDBDS"
    The composite application including the BPEL flow is deployed in one application. "CompositeApp" and the web service in another Application called
    "WebServiceApp".
    Both applications are deployed on the same built in OC4J Application Server
    If I test the webservice in isolation from the SOA console it works. It also seems to be working if the webservice and the and the BPEL flow is in the same project.
    If anyone has any ideas on this one I would be very greatful.
    Thanks in advance

    try creating the MyDBDS connection as an application resource in both applications.

  • Error when calling a XI-webservice from SQL-Server 2005

    Hi all,
    we have published a webservice with XI 7.0 (using the SOAP-Adapter) and try to call it from a stored procedure within SQL-Server 2005. Upon execution we receive the error
    "<SAP:Code area="MESSAGE">EMPTY_HTTP_REQUEST_RECEIVED</SAP:Code>" and
    "<SAP:Stack>Empty HTTP query received; message processing not possible  </SAP:Stack>".
    We are using the dll MSXML2.ServerXMLHTTP. The webservice is available and can be reached from other tools like SOAP-UI when using the same endpoint-URL. It is also possible to call the service from Visual-Basic using the same code.
    Does anyone has any clue about what's causing this error?
    Thanks in advance!

    It is clear that, PI service is working absolutely fine and the problem is calling it in your SP. I do not think you are calling a web service but actually sending a HTTP request to the server. An HTTP request and a SOAP call are different in terms of protocol. You would need to explore more on how to call web services from SQL SPs.. and the right place to search would be MS SQL Server Forums..!!
    VJ

  • Getting deserialization error when calling a secured webservice

    Hi All,
    I am getting deserialization error: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement when I am calling my secured web service through a proxy client.
    I have secured my webservice using a keystore, I had created using keytool . In key store I have created keys using RSA algorithm.
    when I am doing all this for a webservice in which input is a string variable, then it is working.
    But if I am passing a document then it is giving me ERROR OWS-04045 Malformed Request Message: deserialization error: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement .
    Below is the code of java class, I have exposed as webservice :
    import java.io.StringWriter;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    public class READXML {
    public String getXML(Document xmlDocument) {
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = null;
    try {
    transformer = tFactory.newTransformer();
    } catch (TransformerConfigurationException e) {
    e.printStackTrace();
    StringWriter writer = new StringWriter();
    try {
    transformer.transform(new DOMSource(xmlDocument),
    new StreamResult(writer));
    } catch (TransformerException e) {
    e.printStackTrace();
    return writer.toString();
    Appreciate if any body can help me to resolve the issue.
    thanks in advance

    Mike,
    I have tried by validating xml, again it is giving same error.
    when I am not securing my webservice then it is working fine.
    The problem is coming only when i am securing my webservice.

  • Exception handling when no execuble bindings available in PageDefinition?

    Currently I'm showcasing a simple authentication example to one of our clients. The example consists of the following :
    * a simple AuthenticationFilter setup in my web.xml
    * a simple (V1 ... not V2) DataAction with a modelReference property pointing to the correct pageModel.
    The pageModel looks like this :
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.36.73" id="indexPageDef"
    Package="my.demo.package.pageDefs">
    </pageDefinition>
    As you can see ... it does not contain any executable bindings.
    The DataAction has a "onLogon(DataActionContext ctx)" method which calls out to a method on my ApplicationModule (pretty similar to the Jheadstart authentication example). The method gets actually called and it performs the authentication perfectly. BUT .. when (for example) the username is not correct, it will throw a JboException.
    When I try to login again (this time with the correct credentials) and no (new) exceptions are thrown, the old exception is still on the stack ! !
    I tried forcing a bindingContainer.resetInputState() but that didn't help. After a period of digging in the source code I found out the following :
    // oracle.adf.model.binding.DCBindingContainer
    public void resetInputState() {
    // other code
    if (mExecutables == null)
    return;
    // other code
    mExcs = null;
    Some extra info : mExcs points to an ArrayList which contains the exceptions in the bindingcontainer. mExecutables point to a HashMap which contains the executable bindings in the bindingcontainer (~PageDef).
    In other words : if the PageDef does not contain any executable bindings, the stack of exceptions is not reset. Which in my case is what's happening.
    If I change the code of de DCBindingContainer to the following :
    public void resetInputState() {
    // other code
    if (mExecutables == null)
    // could not be sooner, because it is used later on...
    mExcs = null;
    return;
    // other code
    mExcs = null;
    If I run my demo again I see that the stack of exceptions is actually cleared even though I do not have any executable bindings in my PageDef.
    So, my question is : is it correct behaviour that resetInputState() does not clear the exceptions if I have an empty PageDefinition ?

    ** bump **

  • Mediator exception handling when no data found in database

    hi Guys,
    I am using DB adapter in a composite and using a mediator to invoke them, however not getting how to send the response back,
    in case there is NO_DATA_FOUND error.
    waiting for response
    thanks
    Yatan

    Yatan
    As far as i know a DB adapter will not throw no_data_found exception if it is not able to get rows from database it will just initialize the output variable with null. But yes in case of call to procedure or function it may cause that you should handle then and there only.
    Let us know what exactly is the issue you are facing.
    Thanks
    AJ

Maybe you are looking for

  • Adobe acrobat 7 pro not supported?

    error message tells me not supported??

  • Have a big problem with report. Very urgent please help

    I have a report rep1. When I run the report via batch thru command rwclient to create a file it failed. I got the follwoing error message: REP-0177: Error while running in remote server Job 1413 is terminated due to connection timeout. It does not ev

  • How do I recover .psd files

    Is it possible to recover the original psd file if a cropped section has taken the name of the main image from which the section was cropped? I clicked on SAVE not SAVE AS and of course the crop assumed the original file name....Is there any way back

  • Can't open captivate 3 project in Captivate 4

    Installed Captivate 4. Captivate 3 still installed (don't want to delte it until I know Captivate 4 works). I open Captivate 4 and browse to open a project created in Captivate 3. I get a 'Can't open file' message with the error code -2147286928. Any

  • Looking for web sites w/ advanced text search

    A group of potential customers are looking for a powerful text search engine for a web-published database, and I proposed they use Oracle 9i and Oracle Text for this purpose. They may be interested but they demand to "see it in action". Can you help