Oracle defined array type

Hi,
I am trying to pass an input parameter to a stored procedure as oracle defined array type. The input parameter will be stored as an array_varchar type which is defined by our own in our oracle 9i. Can anyone tell me how ? I've been looking for solution for 2 days and still dont know how.
Thanks.
yves

The solution described in Passing Array of UDT or Collection as IN OUT using OracleDbType.InputOutput
is working for me.
Edited by: stzueger on Jan 2, 2012 10:32 AM

Similar Messages

  • Calling a stored proc that has a parameter of a user-defined (array) type

    Hi,
    Hope someone can help me on this, because I am really struggling...
    From a c-program, I am calling stored procedures using the OCI Interface. Everything is OK, when using the standard types (integer, string, date), but I am encountering problems when one of the parameters is of a type that is defined in the database as an array. My application calls multiple array-type parameters in one call, but for the sake of simplicity, I created a test application to only use one.
    The following call is working (but it needs to be called using the OCI functions):
    BEGIN
    p_test_table_num (pin_num1 => T_ARRAY_EH_DEP(1,2,3));
    END;
    My first step was to have the following combination:
    statement: begin p_test_table_num(:pin_num1);end;
    parameter: pin_num1
    value: t_array_eh_dep(1,2,3)
    That lead to the error (when executing the statement): wrong number or types of arguments
    Second idea (after a lot of browsing):
    statement: begin p_test_table_num(t_array_eh_dep(:pin_num1));end;
    parameter: pin_num1
    value: 1,2,3
    This leads to the error: numeric or value error: number precision too large.
    My bind function call looks like:
    if (res = OCIBindByName(stmthp, &bndArray[parCount], errhp, (text *) curPar,
    -1, (dvoid *) curVal, (sb4) sizeof(curVal), SQLT_NUM, (dvoid *) 0,
    (ub2 *) 0, (ub2) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) != OCI_SUCCESS){
    checkerr(errhp, "OCIBindByName", res);
    OCIHandleFree(stmthp, OCI_HTYPE_STMT);
    return -1;
    (in this function curPar is the name of the parameter and curVal contains the value)
    I also investigated the BindArrayOfStruct, but I concluded that this is to execute a stored procedure multiple times using different values for the parameters, and that is not what I want.
    I really hope someone can give me a direction to look in. I also need to call string and date arrays in the same way...
    Thanks
    Margit

    For those who are interested, I found the solution myself...
    To use any user-defined type, you need to perform the following steps:
    1. OCIBindByPos or OCIBindByName as you would bind a normal parameter
    2. OCITypeByName to get a reference to the type definition in Oracle
    3. OCIObjectNew to create a reference to the array (OCI_TYPECODE_VARRAY)
    4. Assign a value to the column, for instance use OCIStringAssignText, OCINumberFromInt, OCIDateFromText
    5. OCICollAppend ( to add the value from step 4 to collection)
    6. OCIBindObject
    7. OCIStmtExecute
    8. OCITransCommit
    Example:
    if (res = OCIBindByName(stmthp, &bndArray[parCount], errhp, (text *) curPar,
    -1, (dvoid *) curVal, (sb4) sizeof(curVal), SQLT_NTY, (dvoid *) 0,
    (ub2 *) 0, (ub2) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT) != OCI_SUCCESS){
    checkerr(errhp, "OCIBindByName", res);
    OCIHandleFree(stmthp, OCI_HTYPE_STMT);
    return -1;
    if (res = OCITypeByName(envhp, errhp, svchp,
    (CONST text *) currentUserName, (ub4) strlen((CONST char *) currentUserName), /*schema*/
    (CONST text *) "T_ARRAY_EH_DEP", (ub4) strlen((CONST char *) "T_ARRAY_EH_DEP"), /* type */
    (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
    &type_array_eh_dep) != OCI_SUCCESS){
    checkerr(errhp, "OCITypeByName", res);
    OCIHandleFree(stmthp, OCI_HTYPE_STMT);
    return -1;
    OCIArray* eh_dep_array = (OCIArray*)0;
    OCINumber eh_dep_num;
    OCIObjectNew(envhp, errhp, svchp, OCI_TYPECODE_VARRAY, type_array_eh_dep,
    (dvoid*) 0, OCI_DURATION_DEFAULT, TRUE, (dvoid**)&eh_dep_array);
    /* get the values from the incoming array */
    curArrayItem = SOM_AtrValGetStrList(arrayValuesListMem,
    arrayValuesListAtr, arrayValueCount);
    do {
    if (STR_Eq(curArrayItem, "NULL")){
    OCICollAppend(envhp, errhp, (CONST dvoid *)0, &null_ind,
    (OCIArray*) eh_dep_array);
    else{
    tmpInt = atoi(curArrayItem);
    OCINumberFromInt(errhp, &tmpInt, sizeof(int), OCI_NUMBER_SIGNED,
    &eh_dep_num);
    OCICollAppend(envhp, errhp, (CONST dvoid *)&eh_dep_num, (CONST dvoid *) 0,
    (OCIArray*) eh_dep_array);
    arrayValueCount = arrayValueCount + 1;
    curArrayItem = SOM_AtrValGetStrList(arrayValuesListMem,
    arrayValuesListAtr, arrayValueCount);
    printf( "curArrayItem = %s\n", curArrayItem );
    } while (STR_Eq(curArrayItem, "%%%") == falseCN);
    arrayValueCount = arrayValueCount + 1; /* skip the %%% */
    if (res = OCIBindObject(bndArray[parCount], errhp,
    (OCIType *)type_array_eh_dep, (dvoid **) &eh_dep_array,
    (ub4 *) 0, (dvoid **) 0, (ub4 *) 0) != OCI_SUCCESS){
    checkerr(errhp, "OCIBindObject", res);
    OCIHandleFree(stmthp, OCI_HTYPE_STMT);
    return -1;
    }

  • Problem Encountering in oracle.sql.ARRAY type

    Hi,
    i am using one stored procedure to get a set of records.
    i am getting it by mapping those things with java.sql.Array. And after that i am getting the values as ResultSet from that Array. The same thing is working fine in Windows platform. If i posted those thing into Unix - AIX, i am facing an ArrayIndexOutofBoundsException while getting ResultSet from oracle.sql.ARRAY class. I checked out ARRAY instance.it is not null. Both Application and Database are same except O.S.
    Can Anybody help me. I need it imm.
    Thanks in Advance
    Regards
    Eswaramoorthy.G

    Hi
    Did you ever figure out what the problem was with this? We have a client that is experiencing the same problem on AIX but we cannot reproduce using their database running under NT nor Sun. Any information would be appreciated. You can respond directly to [email protected]
    Thanks in adavance
    Rick DeMilia
    Sungard DataSystems

  • Deadlock in Oracle.sql.ARRAY type

    Hi,
    We've come across the deadlock situation below when running multiple J2EE MDB instances that are trying to write to the DB:
    [deadlocked thread] [ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'oracle.jdbc.driver.T4CConnection@90106ee' that is held by thread '[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
    oracle.sql.ARRAY.toBytes(ARRAY.java:673)
    oracle.jdbc.driver.OraclePreparedStatement.setArrayCritical(OraclePreparedStatement.java:5985)
    oracle.jdbc.driver.OraclePreparedStatement.setARRAYInternal(OraclePreparedStatement.java:5944)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8782)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8278)
    oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8868)
    oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:240)
    weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:287)
    org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
    org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
    org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:127)
    org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.setValues(PreparedStatementCreatorFactory.java:298)
    org.springframework.jdbc.object.BatchSqlUpdate$1.setValues(BatchSqlUpdate.java:192)
    org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:892)
    org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
    org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
    org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184)
    com.csfb.fao.rds.rfi.common.dao.storedprocs.SaveEarlyExceptionBatchStoredProc.execute(SaveEarlyExceptionBatchStoredProc.java:93)
    com.csfb.fao.rds.rfi.common.dao.EarlyExceptionDAOImpl.saveEarlyExceptionBatch(EarlyExceptionDAOImpl.java:34)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.saveEarlyExceptions(RulesEngine.java:302)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.executeRules(RulesEngine.java:209)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.onMessage(RulesEngine.java:97)
    com.csfb.fao.rds.feeds.process.BaseWorkerMDB.onMessage(BaseWorkerMDB.java:518)
    weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
    weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
    weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
    weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
    weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
    weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
    weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    [deadlocked thread] [ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)':
    Thread '[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'oracle.jdbc.driver.T4CConnection@b48b568' that is held by thread '[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)''
    Stack trace:
    oracle.sql.ARRAY.toBytes(ARRAY.java:673)
    oracle.jdbc.driver.OraclePreparedStatement.setArrayCritical(OraclePreparedStatement.java:5985)
    oracle.jdbc.driver.OraclePreparedStatement.setARRAYInternal(OraclePreparedStatement.java:5944)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:8782)
    oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8278)
    oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8868)
    oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:240)
    weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:287)
    org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
    org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
    org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:127)
    org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.setValues(PreparedStatementCreatorFactory.java:298)
    org.springframework.jdbc.object.BatchSqlUpdate$1.setValues(BatchSqlUpdate.java:192)
    org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:892)
    org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)
    org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:883)
    org.springframework.jdbc.object.BatchSqlUpdate.flush(BatchSqlUpdate.java:184)
    com.csfb.fao.rds.rfi.common.dao.storedprocs.SaveEarlyExceptionBatchStoredProc.execute(SaveEarlyExceptionBatchStoredProc.java:93)
    com.csfb.fao.rds.rfi.common.dao.EarlyExceptionDAOImpl.saveEarlyExceptionBatch(EarlyExceptionDAOImpl.java:34)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.saveEarlyExceptions(RulesEngine.java:302)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.executeRules(RulesEngine.java:209)
    com.csfb.fao.rds.rfi.application.rulesengine.RulesEngine.onMessage(RulesEngine.java:97)
    com.csfb.fao.rds.feeds.process.BaseWorkerMDB.onMessage(BaseWorkerMDB.java:518)
    weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
    weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
    weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
    weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
    weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
    weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
    weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
    weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Looking at the ARRAY.toBytes() method:
    public byte[] toBytes()
    throws SQLException
    synchronized (getInternalConnection())
    return this.descriptor.toBytes(this, this.enableBuffering);
    ..., it synchronizes on the following method (getInternalConnection() -> getPhysicalConnection()):
    oracle.jdbc.internal.OracleConnection getPhysicalConnection()
    if (this.physicalConnection == null)
    try
    this.physicalConnection = ((oracle.jdbc.internal.OracleConnection)new OracleDriver().defaultConnection());
    catch (SQLException localSQLException)
    return this.physicalConnection;
    defaultConnection() does the following:
    public Connection defaultConnection()
    throws SQLException
    if ((defaultConn == null) || (defaultConn.isClosed()))
    synchronized (OracleDriver.class)
    if ((defaultConn == null) || (defaultConn.isClosed()))
    defaultConn = connect("jdbc:oracle:kprb:", new Properties());
    return defaultConn;
    So there's synchronizations on the connection instance and OracleDriver.class object... I can't see how this can deadlock. To get to the point of needing the lock on OracleDriver.class, the thread would already have the lock on the connection instance.... clearly I'm missing something.
    Thanks
    Edited by: 928154 on 17-Apr-2012 03:42

    Welcome to the forum. If you want help, at least try to think where to post a question and look for a forum that matches the topic. Lets examine what you have:
    - its Weblogic, so if you would ask a non-programming related question anywhere it would be in the Weblogic forum
    - HOWEVER, if you check the top of the stacktrace, you'll see that the problem stems from the JDBC driver, so a JDBC related forum would be a closer match
    For future reference, Weblogic specific questions should go here: https://forums.oracle.com/forums/category.jspa?categoryID=193
    and JDBC/OJDBC driver related questions should go here: Java Database Connectivity (JDBC)
    Final tip: use \ tags to post code so it is readable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Executing a Stored Procedure passing Oracle Defined User Type

    Hello All,
    I am having problems in executing a SP from Java. Here is the detailed info of the prob I am facing.
    I have a SP created which takes in a Table Type as one of the input parameter. This table type say "SERVICE" is of the Object Type "OBJ_SERVICETOMOVE".
    Now I am writing a simple Java Clinet which executes the procedure. and below is the sample code I am pasting.
    public class DBClient {
         public static void main(String args[])
              DBConnection dbclass = new DBConnection();
              dbclass.getConnection();
              //String movingOrder = args[0];
              ArrayList arrList = new ArrayList();
              arrList.add("10001");
              arrList.add("10002");
              arrList.add("10003");
              java.sql.Date date = null;
              try
                   SimpleDateFormat objSDF = new SimpleDateFormat("dd/MM/yyyy");
                   java.util.Date dtCcDate = (java.util.Date) objSDF.parse("02/01/2005");
                   java.sql.Date localdate = new java.sql.Date(dtCcDate.getTime());
                   date = localdate;
              catch(ParseException e)
                   System.out.println("Parse Exception CAUGHT"+e.getMessage());
              combttmOE04ServicesToMove inputParam = new combttmOE04ServicesToMove(arrList);
              try
                   OracleCallableStatement cs = dbclass.getCallableStatement("saveMovingOrder4Service(?,?,?)");
                   cs.setInt(1,10);
                   cs.setInt(2,date);
                   cs.setObject(3,inputParam);
                   dbclass.executeStoreProc();
              catch(SQLException e)
                   e.printStackTrace();
              catch(Exception e)
                   System.out.println("Exception CAUGHT"+e.getMessage());
    The error I am getting is
    java.sql.SQLException: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java)
    at DBClient.main(DBClient.java:84)
    Can anyone of you advise me on this
    Regards
    Rags

    Rags,
    Have you looked at the JDBC sample code available from here:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html
    And the "how-to" documents, available from here:
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/index.html
    I once did something similar to what (I think) you are trying to do -- but unfortunately I lost that code when the hard-disk on my PC died. I do remember though, finding how to do it from the above-listed URLs.
    Good Luck,
    Avi.

  • Oracle PL/SQL type defined within a package can't be passed from JAVA

    Hello,
    I am trying to create an Oracle ArrayDescriptor in order to receive a colloection element of type "TABLE".
    The PL/SQL array type is defined in a package - the array descriptor creation fails.
    The type is created within a package call MyPackage
    TYPE SERVERLIST IS TABLE OF VARCHAR2(50);
    I try to create the ArrayDescriptor using MyPackage.SERVERLIST but it fails with the message:
    java.sql.SQLException: invalid name pattern: MyPackage.SERVERLIST
    If I create the SERVERLISTtype at the database level - everything works. The problem is that we have a requirement not to pollute the global namespeace with our types, so I can't create the type at the top level.
    I got no input from the Oracle JDBC tean - so any ideea would be very much appreciated.
    Database is Oracle 8.1.7
    And I am using oracle-jdbc thin driver.

    This is only possible, when u define ur custom type globally. The reason being, in JDBC code when u define struct statement, the code with db connection in constructor finds that if the custom type is present in DB , it does not search in specific procedure, so it would only get this , if ur cuustom type is defined globally.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Troubleshooting Oracle array type names in JDBC calls

    Hi,
    There are several threads in this forum about people having trouble with the array SQL type names that the Oracle JDBC driver recognizes (e.g., in a call setting up PLSQL procedure OUT parameters like "call.registerOutParameter(1, Types.ARRAY, "VARCHAR_NESTED_TAB_TYP");"). I've seen at least the following threads:
    * vinay saini's "accessing package defined datatypes in oracle from JDBC" thread (Re: Heterogeneous Connectivity to SQL Server from 8.0.5
    * fwelland's "PL/SQL Tables as IN parameters???" thread (Re: entity relationship/model of database diagram
    * Ernesto Marquina's "Table Type as OUT parameter" thread (Re: Changing namespace
    * Nazneen Nahid's "Oracle PL/SQL type defined within a package can't be passed from JAVA" thread (Re: BI Beans Graph in JSp
    * vinay saini's "mapping Table/VARRAY data type to JDBC data type" thread (Re: 9.0.3 unable to find session bean for AM
    I'm stuck in the middle of this myself, and found that something useful to look at is the PLSQL procedure that the driver uses to determine whether the type is there. You can run the following test PLSQL block with your schema name and type name to check on the database side whether it will work:
    declare
    schemaname varchar(255);
    typename varchar(255);
    typoid raw(255);
    version integer;
    tds long raw;
    lds long raw;
    begin
    schemaname := 'MKT2_SMD9';
    typename := 'VARCHAR_NESTED_TAB_TYP';
    dbms_output.put_line('Result for '||schemaname||','||typename||'='||
    dbms_pickler.get_type_shape(schemaname, typename, typoid, version, tds, lds));
    end;
    If the procedure returns 0, then the JDBC code should have no trouble picking up the array type and handling your call. If the procedure returns a nonzero number, the JDBC code using the same schemaname and typename will probably fail. This at least allows you to try a number of different schema and type names with the application and driver layers eliminated. Unfortunately, I have no idea how get_type_shape works, and it doesn't seem to be documented in Oracle's 9i docs, so I can't shed any light on why some things work and others don't.
    Jim

    I guess, in hibernate, in order to make it serialized object, try using set/collection implementation.

  • How to create Array type parameter of Oracle 10.2.0.1.0 in java

    I create a collection type with:
    CREATE OR REPLACE
    type TEST_User.T_ARRAY AS TABLE OF VARCHAR2(100);
    and in java code, I use following code to create a parameter of this type, and set it for a procdure
    String[] userMakeArray = new String[]{"V", "N", "A"};
    oracle.sql.ArrayDescriptor descriptor = oracle.sql.ArrayDescriptor.createDescriptor("TEST_User.T_ARRAY", cn); // cn is connection instance to database
    oracle.sql.ARRAY array = new oracle.sql.ARRAY(descriptor, cn, userMakeArray);
    ((oracle.jdbc.OracleCallableStatement)call).setArray(8, array);
    when i use this to call procedure in Oracle 10.1, it work well.
    In Oracle 10.2, it does not work well.
    For test, I can execute procedure well in sql plus, but in java client, I found that array contains three items "Null", while array is correct when conect to 10.1 enviroment.
    does anybody know what's the reason for this.
    thanks a lot.

    Hi,
    Too long to copy/paste here but i have a simpler working example of Nested Table of VARCHAR2 type against 10.2.0.x, in chapter 3 and 8 of my book:
    create or replace type NTab_Vc2 as TABLE of varchar2(30)
    create table NSTableTab (id int, numnt NTab_Num, vc2nt NTab_Vc2, datnt
    NTab_Dat)
    nested table numnt store as NSTabNum,
    nested table vc2nt store as NSTabVc2,
    nested table datnt store as NSTabDat;
    insert into NSTableTab values (1,
    NTab_Num(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
    NTab_Vc2 ('One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'),NTab_Dat('01-JAN-2003', '02-JAN-2003', '03-JAN-2003', '04-JAN-2003',
    '05-JAN-2003', '06-JAN-2003', '07-JAN-2003', '08-JAN-2003',
    '09-JAN-2003', '10-JAN-2003')
    // The following code snippet retrieves and returns a
    // NTab_Vc2 as a java.sql.Array
    OraclePreparedStatement ps = (OraclePreparedStatement)
    conn.prepareStatement ("SELECT VC2NT FROM NSTableTab
    WHERE ID = ?");
    ps.setNUMBER (1, id[0]);
    OracleResultSet rs = (OracleResultSet) ps.executeQuery();
    Array a = null;
    while (rs.next())
    a = (Array) rs.getObject(1);
    ps.close();
    return a;
    Kuassi, http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Associative array type for each blob column in the table

    i am using the code in given link
    http://www.oracle.com/technology/oramag/oracle/07-jan/o17odp.html
    i chnages that code like this
    CREATE TABLE JOBS
    JOB_ID VARCHAR2(10 BYTE),
    JOB_TITLE VARCHAR2(35 BYTE),
    MIN_SALARY NUMBER(6),
    MAX_SALARY NUMBER(6),
    JOBPIC BLOB
    CREATE OR REPLACE PACKAGE associative_array
    AS
    -- define an associative array type for each column in the jobs table
    TYPE t_job_id IS TABLE OF jobs.job_id%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_job_title IS TABLE OF jobs.job_title%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_min_salary IS TABLE OF jobs.min_salary%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_max_salary IS TABLE OF jobs.max_salary%TYPE
    INDEX BY PLS_INTEGER;
    TYPE t_jobpic IS TABLE OF jobs.jobpic%TYPE
    INDEX BY PLS_INTEGER;
    -- define the procedure that will perform the array insert
    PROCEDURE array_insert (
    p_job_id IN t_job_id,
    p_job_title IN t_job_title,
    p_min_salary IN t_min_salary,
    p_max_salary IN t_max_salary,
    p_jobpic IN t_jobpic
    END associative_array;
    CREATE OR REPLACE package body SHC_OLD.associative_array as
    -- implement the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary,
    P_JOBPIC IN T_JOBPIC
    ) is
    begin
    forall i in p_job_id.first..p_job_id.last
    insert into jobs (job_id,
    job_title,
    min_salary,
    max_salary,
    JOBPIC
    values (p_job_id(i),
    p_job_title(i),
    p_min_salary(i),
    p_max_salary(i),
    P_JOBPIC(i)
    end array_insert;
    end associative_array;
    this procedure is called from .net. from .net sending blob is posiible or not.if yes how

    Ok, that won't work...you need to generate an image tag and provide the contents of the blob column as the src for the image tag.
    If you look at my blog entry -
    http://jes.blogs.shellprompt.net/2007/05/18/apex-delivering-pages-in-3-seconds-or-less/
    and download that Whitepaper that I talk about you will find an example of how to do what you want to do. Note the majority of that whitepaper is discussing other (quite advanced) topics, but there is a small part of it that shows how to display an image stored as a blob in a table.

  • Oracle 8i array DML operations with LOB objects

    Hi all,
    I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
    INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
    where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
    To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
    Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
    As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
    Chris Simms
    [email protected]
    null

    Before 9i, you will have to first insert empty locators using EMPTY_CLOB() inlined in the SQL and using RETURNING clause to return the locator. Then use OCILobWrite to write to the locators in a streamed fashion.
    From 9i, you can actually bind a long buffer to each lob position without first inserting an empty locator, retrieving it and then writing to it.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by CSimms:
    Hi all,
    I have a question about Oracle 8i array DML operations with LOB objects, both CLOB and BLOB. With the following statement in mind:
    INSERT INTO TABLEX (COL1, COL2) VALUES (:1, :2)
    where COL1 is a NUMBER and COL2 is a BLOB, I want to use OCIs array DML functionality to insert multiple records with a single statement execution. I have allocated an array of LOB locators, initialized them with OCIDescriptorAlloc(), and bound them to COL2 where mode is set to OCI_DATA_AT_EXEC and dty (IN) is set to SQLT_BLOB. It is after this where I am getting confused.
    To send the LOB data, I have tried using the user-defined callback method, registering the callback function via OCIBindDynamic(). I initialize icbfps arguments as I would if I were dealing with RAW/LONG RAW data. When execution passes from the callback function, I encounter a memory exception within an Oracle dll. Where dvoid **indpp equals 0 and the object is of type RAW/LONG RAW, the function works fine. Is this not a valid methodology for CLOB/BLOB objects?
    Next, I tried performing piecewise INSERTs using OCIStmtGetPieceInfo() and OCIStmtSetPieceInfo(). When using this method, I use OCILobWrite() along with a user-defined callback designed for LOBs to send LOB data to the database. Here everything works fine until I exit the user-defined LOB write callback function where an OCI_INVALID_HANDLE error is encountered. I understand that both OCILobWrite() and OCIStmtExecute() return OCI_NEED_DATA. And it does seem to me that the two statements work separately rather than in conjunction with each other. So I rather doubt this is the proper methodology.
    As you can see, the correct method has evaded me. I have looked through the OCI LOB samples, but have not found any code that helps answer my question. Oracles OCI documentation has not been of much help either. So if anyone could offer some insight I would greatly appreciate it.
    Chris Simms
    [email protected]
    <HR></BLOCKQUOTE>
    null

  • Java.sql.SQLException: Internal Error: at oracle.sql.ARRAY.getArray(ARRAY.j

    hi all,
    I am getting the below exception
    Basically i am registering an out parameters like this
    cs.registerOutParameter(4, Types.ARRAY, "ISSUESECTION_LIST");
    my database version: oracle 11.1.0.7.0.
    I have created a synonym and given the execute privileges ,but also it comes up with the below exception
    java.sql.SQLException: Internal Error
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
    at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
    at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
    at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
    at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
    at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    at com.db.gmr.eds.sm.jdbc.IssueSectionStoreJDBC.getResources(IssueSectionStoreJDBC.java:69)
    at com.db.gmr.eds.handler.GetResources.handle(GetResources.java:126)
    at com.db.gmr.eds.servlet.PageController.handle(PageController.java:138)
    at com.db.gmr.eds.servlet.PageController.doGet(PageController.java:80)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at com.db.gmr.core.servlet.filters.TomcatParameterBugFix.doFilter(TomcatParameterBugFix.java:65)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:500)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
    If i use cs.registerOutParameter(4, Types.ARRAY, "SCHEMA_OWNER_NAME.ISSUESECTION_LIST"); Then i wont be getting the error.
    COULD ANYONE LET ME KNOW THE WORK AROUND OTHER THAN THE ABOVE SOLUTION LIKE ADDING THE OWNER SCHEMA NAME WITH THE USER DEFINED COLLECTION TYPE.

    There couold be two reasons:
    1) it depends how u have defined type. if ISSUESECTION_LIST is defined in type SCHEMA_OWNER, then you have to call this ways only 'SCHEMA_OWNER_NAME.ISSUESECTION_LIST'
    2) You might have defined using schema_owner_name like scott.<TYPE_NAME>. if its so, then drop it and again define type without using schema owner.
    For detail help post your type declaration.

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • Using XSLT "adapter" for invoking a WS with SOAP-ENC array type param.

    Hello,
    I had to write a BPEL process that calls inside it a web service which has as an input an array parameter and as an output, also an array. I already know that BPEL has limitations regarding using the SOAP-ENC Array type. I tried to rewrite the web service in order to use a literal encoding of the array parameters (using "maxOccurs" attribute), but unfortunately, the OC4J container 9.0.4 that I have to use doesn't allow this. It only allows the SOAP-ENC types for array types.
    I started to write, inside the BPEL process, some "adapters" XSLT transformations before and after the invoking of the web service that uses SOAP-ENC array. The XSLT transformation before the web service invoking will translate the input array parameter defined with no SOAP encoding types (based on "maxOccurs" attribute) into a SOAP-ENC type, as it is expected by the web service. The XSLT transformation after the web service invoking will translate the returned array SOAP-ENC type into a data type defined with no SOAP encoding types (based on "maxOccurs" attribute).
    The approach is pretty hairy, from the XSLT point of view and it introduces a supplementary delay due to the XSLT processing needed, but it works. The only think is that when I build the service, I obtain the following error message:
    [bpelc] [Error] GCDBWebservice?WSDL:30:42: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema ...
    But in spite of this, the process is built and deployed successfully and I was able to run it from the BPEL console.
    Do you think that this approach could hide some other future problems that I can't see in this moment?
    Thanks,
    Marinel

    Please help me for this.
    I am new to Webservices and SOAP.
    I am facing problem when i am calling a "add" method in the .net webservices with the following code but it gives correct result when i'm calling the "HelloWorld" method present in the webservice.
    I think it will happening because, when i'm going to pass any parameter to the "add method , it does not process it.It will return me 0.
    Please help me in this.
    The code is:
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.encoding.*;
    import org.apache.soap.encoding.soapenc.*;
    import org.apache.soap.encoding.literalxml.*;
    import org.apache.soap.rpc.*;
    import org.apache.soap.transport.http.SOAPHTTPConnection;
    import org.apache.soap.transport.*;
    import org.apache.soap.messaging.*;
    import org.apache.xerces.parsers.*;
    import org.apache.xerces.dom.DocumentImpl;
    public class testClient {
    public static void main(String[] args) throws Exception {
    URL url = new URL ("http://Eurotele-it3/webService1/Service1.asmx");
    //Map the Types.
    SOAPMappingRegistry smr = new SOAPMappingRegistry ();
    StringDeserializer sd = new StringDeserializer ();
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("http://Eurotele-it3/WebService1/Service1","addResult"),Integer.class,null,sd);
    // create the transport and set parameters
    SOAPHTTPConnection st = new SOAPHTTPConnection();
    // build the call.
    Call call = new Call();
    call.setSOAPTransport(st);
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI ("http://Eurotele-it3/WebService1/Service1/add");
    call.setMethodName("add");
    //call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement(new Parameter("x",Integer.class,"10",null));
    params.addElement(new Parameter("y",Integer.class,"20",null));
    call.setParams(params);
    Response resp = null;
    try {
    resp = call.invoke (url,"http://Eurotele-it3/WebService1/Service1/add");
    catch (SOAPException e) {
    System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " +e.getMessage ());
    return;
    // check response
    if (resp != null && !resp.generatedFault()) {
    Parameter ret =resp.getReturnValue();
    Object value =ret.getValue();
    System.out.println ("Answer--> " +value );
    else {
    Fault fault = resp.getFault ();
    System.err.println ("Generated fault: ");
    System.out.println (" Fault Code = " + fault.getFaultCode());
    System.out.println (" Fault String = " + fault.getFaultString());
    This is the complete WSDL format:
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://Eurotele-it3/WebService1/Service1" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://Eurotele-it3/WebService1/Service1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://Eurotele-it3/WebService1/Service1">
    - <s:element name="HelloWorld">
    <s:complexType />
    </s:element>
    - <s:element name="HelloWorldResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="HelloWorldResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="add">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="y" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="addResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="addResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    - <wsdl:message name="HelloWorldSoapIn">
    <wsdl:part name="parameters" element="tns:HelloWorld" />
    </wsdl:message>
    - <wsdl:message name="HelloWorldSoapOut">
    <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
    </wsdl:message>
    - <wsdl:message name="addSoapIn">
    <wsdl:part name="parameters" element="tns:add" />
    </wsdl:message>
    - <wsdl:message name="addSoapOut">
    <wsdl:part name="parameters" element="tns:addResponse" />
    </wsdl:message>
    - <wsdl:portType name="Service1Soap">
    - <wsdl:operation name="HelloWorld">
    <wsdl:input message="tns:HelloWorldSoapIn" />
    <wsdl:output message="tns:HelloWorldSoapOut" />
    </wsdl:operation>
    - <wsdl:operation name="add">
    <wsdl:input message="tns:addSoapIn" />
    <wsdl:output message="tns:addSoapOut" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="HelloWorld">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/HelloWorld" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="add">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/add" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="Service1">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    - <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
    <soap:address location="http://eurotele-it3/webService1/Service1.asmx" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

  • Deserializer not found for array Type...

    I hava a web-Servicd deployed in AXIS - is Takes an array of a complex type and returns one.
    Everytime i run the service the service properly does the processing and returns the correct Object.
    When the client receives the REsponse i get the following exception
    - Exception:
    org.xml.sax.SAXException: No deserializer defined for array type {urn:SchufaService}Response
         at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)
         at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:428)
         at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
         at org.apache.axis.client.Call.invoke(Call.java:2272)
         at org.apache.axis.client.Call.invoke(Call.java:2171)
         at org.apache.axis.client.Call.invoke(Call.java:1691)
         at de.awe.client.SchufaServiceSoapBindingStub.getInformation(SchufaServiceSoapBindingStub.java:329)
         at de.awe.client.SessionClient.main(SessionClient.java:45)here is my .wsdd file - i think i did the correct bean and type mappings:
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
                xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    <handler name="session" type="java:org.apache.axis.handlers.SimpleSessionHandler">
    </handler>
    <service name="SchufaService" provider="java:RPC">
      <requestFlow>
           <handler type="soapmonitor"/>
        <handler type="session"/>
      </requestFlow>
      <responseFlow>
           <handler type="session"/>
        <handler type="soapmonitor"/>
      </responseFlow>
      <parameter name="scope" value="session"/>
      <parameter name="className" value="de.awe.webservice.SchufaService"/>
      <parameter name="allowedMethods" value="*"/>
      <beanMapping qname="SchufaService:Person" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Person"/>
      <beanMapping qname="SchufaService:Address" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Address"/>
      <beanMapping qname="SchufaService:Request" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Request"/>
      <beanMapping qname="SchufaService:Response" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.Response"/>
      <beanMapping qname="SchufaService:ResponseAuskunft" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseAuskunft"/>
      <beanMapping qname="SchufaService:ResponseFehlerbehandlung" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseFehlerbehandlung"/>
      <beanMapping qname="SchufaService:ResponseNachbehandlung" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.xml.ResponseNachbehandlung"/>
      <beanMapping qname="SchufaService:Textdaten" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Textdaten"/>
      <beanMapping qname="SchufaService:Merkmal" xmlns:SchufaService="urn:SchufaService" languageSpecificType="java:de.awe.model.Merkmal"/>
      <typeMapping
            xmlns:ns="http://localhost:8080/axis/services/SchufaService"
            qname="ns:ArrayOf_tns1_Request"
            type="java:de.awe.client.Request[]"
            serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
            deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          />
      <typeMapping
            xmlns:ns="http://localhost:8080/axis/services/SchufaService"
            qname="ns:ArrayOf_tns1_Response"
            type="java:de.awe.client.Response[]"
            serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
            deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          />
    </service>
    </deployment>Please tell me where to find the error...
    Thanks a lot

    Hi,
    Can you paste the client's code in here? this error is usually on the client side where in the array type was not mapped properly.
    thanks,
    leighsy
    I hava a web-Servicd deployed in AXIS - is Takes an
    array of a complex type and returns one.
    Everytime i run the service the service properly does
    the processing and returns the correct Object.
    When the client receives the REsponse i get the
    following exception

Maybe you are looking for

  • How to configure the Integration Server Settins?

    Hi, I am doing a scenario like Idoc 2 File, I am passing parameter of Adapter Engine is a Integration Server, and when we generate a Idoc and send to XI system using TC: WE19. XI System is not picked the Idoc, and when i am checking RWB the Adapter F

  • My built in speakers arn't working

    Hello, Just looking for some advice. I have just had a new hard drive fitted into my mac book as the previous one had died. Normally i link my macbook to my HiFi via the aux setting on the hifi and usinga headphobne jack into the headphone socket on

  • Can't sort Podcasts xcpt by Release Date since upgrading to 11.0.4

    I'm on a Macbook Pro running OSX 10.6.8. Since upgrading to iTunes 11.0.4 I'm unable to sort my Podcasts by any criteria but Release Date. I'd like to be able to sort them (as I have in the past) by rating. I've tried by clicking at the top of the Ra

  • Getting pcd location of iview dynamically

    Hi, I need the pcd loaction of a particular iview so that it can be provided as a reference to a link,since on clicking the link from a different iview that particular iview opens.Can you pls. let me know 1.How to dynamically fetch the PCD location o

  • Lost music library

    I have an external hard drive (E) and that is where I keep a copy of My Music and download all my cd's and purchases to. Within that folder there is an itunes folder with a copy of the library there. This library file is out of date, as I have added