Running@Oracle

Experience around running and Oracle software development

  •  

    January 2008
    M T W T F S S
    « Nov   Feb »
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  

Archive for January 13th, 2008

Calling Web Service from Forms

Posted by xtrailrunner on January 13, 2008

OK, for an OO-experienced person this seems to be obvious but sometimes it helps to clarify things. If you call a web service client (web service stub) from Oracle Forms you have to import one or more classes of the web service client into the Forms module.

There are different case:

  1. If the class is static the signature of the imported methods in most cases only contains simple datatypes like in this example
    FUNCTION <method>(
    a0 VARCHAR2,
    a1 VARCHAR2,
    a2 VARCHAR2) RETURN BOOLEAN;
    This can be handled easily from your Forms application by passing the appropriate values.

  2. If the class is non-static, i.e. there are existing instances of this class you will find an object in the signature of the PL/SQL method call: FUNCTION <method>(
    obj ORA_JAVA.JOBJECT,
    a0 VARCHAR2,
    a1 VARCHAR2) RETURN ORA_JAVA.JOBJECT;
    In this case you have to pass an initialized object for this class by using the method new in your PL/SQL code:
    obj := <class>.new();

  3. If the class is non-static and requires an additional object to be passed as a parameter to the called method the signature of the PL/SQL method call could look like this:
    FUNCTION <method>(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JOBJECT,
    a1 VARCHAR2,
    a2 VARCHAR2) RETURN ORA_JAVA.JOBJECT;
    In this case you have to pass an initialized object for this class by using the method new in your PL/SQL code:
    obj := <class>.new(); and
    to initialize an additional object for the parameter by importing the required class into the Forms module and create a new instance:
    a0:<additional_class>.new();

Posted in Uncategorized | Leave a Comment »