0 Replies Latest reply: Apr 17, 2013 2:26 AM by 1003539 RSS

    RE -Function with Return type Object and how to display this value in Forms

    1003539
      Dear All,

      I am using Oracle 11g data base and Forms 11g R2 version for my development.Currently i involved in integration activities i.e integration of my application to external third party service provider to get some information.For this am invoking webservice method from my application (from forms) to connect external service provider.I import the Jar file in my forms.Below is the package created after importing the method
      PACKAGE BODY LightStoneServices IS

      --
      -- DO NOT EDIT THIS FILE - it is machine generated!
      --

      args JNI.ARGLIST;

      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
      args := NULL;
      RETURN (JNI.NEW_OBJECT('com/iii/premia/msti/sp/lightstone/services/LightStoneServices', '()V', args));
      END;

      -- Method: returnProperties (Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)Ljava/util/ArrayList;
      FUNCTION returnProperties(
      obj ORA_JAVA.JOBJECT,
      a0 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
      args := JNI.CREATE_ARG_LIST(1);
      JNI.ADD_OBJECT_ARG(args, a0, 'com/iii/premia/msti/sp/lightstone/model/LightStoneAddress');
      RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnProperties', '(Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)Ljava/util/ArrayList;', args);
      END;

      -- Method: returnProperties (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;
      FUNCTION returnProperties(
      obj ORA_JAVA.JOBJECT,     -- LightStoneServices
      a0 VARCHAR2,     --Client ID
      a1 VARCHAR2,     -- Streeet Name
      a2 VARCHAR2,     -- Suburb Name
      a3 VARCHAR2     -- Province Name
      ) RETURN ORA_JAVA.JOBJECT -- List<LightStonedAddress>
      --LightStoneAddress
      -- String id
      -- String street
      -- String suburb
      -- String province
      IS
      BEGIN

      args := JNI.CREATE_ARG_LIST(4);
      JNI.ADD_STRING_ARG(args, a0);
      JNI.ADD_STRING_ARG(args, a1);
      JNI.ADD_STRING_ARG(args, a2);
      JNI.ADD_STRING_ARG(args, a3);
      RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnProperties', '(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;', args);
      END;

      -- Method: returnPropertiesNR (Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)V
      PROCEDURE returnPropertiesNR(
      obj ORA_JAVA.JOBJECT,
      a0 ORA_JAVA.JOBJECT) IS
      BEGIN
      args := JNI.CREATE_ARG_LIST(1);
      JNI.ADD_OBJECT_ARG(args, a0, 'com/iii/premia/msti/sp/lightstone/model/LightStoneAddress');
      JNI.CALL_VOID_METHOD(FALSE, obj, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnPropertiesNR', '(Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)V', args);
      END;

      -- Method: returnPropertiesST (Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)Ljava/util/ArrayList;
      FUNCTION returnPropertiesST(
      a0 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
      args := JNI.CREATE_ARG_LIST(1);
      JNI.ADD_OBJECT_ARG(args, a0, 'com/iii/premia/msti/sp/lightstone/model/LightStoneAddress');
      RETURN JNI.CALL_OBJECT_METHOD(TRUE, NULL, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnPropertiesST', '(Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)Ljava/util/ArrayList;', args);
      END;

      -- Method: returnPropertiesST (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;
      FUNCTION returnPropertiesST(
      a0 VARCHAR2,
      a1 VARCHAR2,
      a2 VARCHAR2,
      a3 VARCHAR2) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
      args := JNI.CREATE_ARG_LIST(4);
      JNI.ADD_STRING_ARG(args, a0);
      JNI.ADD_STRING_ARG(args, a1);
      JNI.ADD_STRING_ARG(args, a2);
      JNI.ADD_STRING_ARG(args, a3);
      RETURN JNI.CALL_OBJECT_METHOD(TRUE, NULL, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnPropertiesST', '(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;', args);
      END;

      -- Method: returnPropertiesNRST (Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)V
      PROCEDURE returnPropertiesNRST(
      a0 ORA_JAVA.JOBJECT) IS
      BEGIN
      args := JNI.CREATE_ARG_LIST(1);
      JNI.ADD_OBJECT_ARG(args, a0, 'com/iii/premia/msti/sp/lightstone/model/LightStoneAddress');
      JNI.CALL_VOID_METHOD(TRUE, NULL, 'com/iii/premia/msti/sp/lightstone/services/LightStoneServices', 'returnPropertiesNRST', '(Lcom/iii/premia/msti/sp/lightstone/model/LightStoneAddress;)V', args);
      END;


      BEGIN
      NULL;
      END;


      I have to use this -- Method: returnProperties (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;
      FUNCTION returnProperties(
      obj ORA_JAVA.JOBJECT,     -- LightStoneServices
      a0 VARCHAR2,     --Client ID
      a1 VARCHAR2,     -- Streeet Name
      a2 VARCHAR2,     -- Suburb Name
      a3 VARCHAR2     -- Province Name
      ) RETURN ORA_JAVA.JOBJECT -- List<LightStonedAddress>
      - obj input -LightStoneAddress
      --a0 output String id
      -- a1 output String street
      -- a2 output String suburb
      --a3 output  String province

      function to get address details.This function return type is OBJECT (contains 4 columns) and this will return more than one record as output.I want to display the address in my application.Pls throw some light on this.
      Any pointers are greatly appreciate.

      Thanks and Regards

      Prakash.S.Rao