Character array type conversion problem

Hi, I'm using BlazeDS (v3.0.0.544) to remotely call Java code on the server from my Flex client. I'm having trouble when converting a character array type from Java to ActionScript and vice-versa. In my Flex code, if the ActionScript class uses a String type to map to the char[] then the char[] is successfully converted from Java to ActionScript, but not from ActionScript to Java.
// Extract from ActionScript code
private var m_charArray:String;
public function get charArray():String
return m_charArray;
public function set charArray(value1:String):void
m_charArray = value1;
Alternatively, if my ActionScript class uses an Array type then I can successfully send data from the client and populate a char[] field on the server, but can't send an updated char[] back to my ActionScript class.
In fact the Flex console reports:
TypeError: Error #1034: Type Coercion failed: cannot convert "myString" to Array.
The code this time:
// Extract from ActionScript code
private var m_charArray:Array;
public function get charArray():Array
return m_charArray;
public function set charArray(value1:Array):void
m_charArray = value1;
All the other types I have tried work successfully, it's only with char arrays that I've hit a problem.
Any help would be appreciated, thanks.

Hi Graeme,
It is how it works. I can see the inconsistency. You can find an example how of echo char[] in blazeds\trunk\qa\apps\qa-regress\testsuites\mxunit\tests\remotingService\dataTypes\CharTy pesTest.mxml. It echos a char[] in return of a string. You can get the char in a string easily string.charAt() and get its length using length(). I think it may be the reason remoting decided to use a string to represent a char[] instead of a generic objects array. It should be more memory efficient. However, I can see that it can turn into problem as what you descibed. When the data has to send back to server, it has to convert back to array. If the char[] type is used inside an object, it is impossible to do the conversion unless the getter and setter are generic
public function get charArray():Object
return m_charArray;
public function set charArray(value1:Object):void
if (value1 is String)
m_charArray = new Array();
//copy the string elements to it
else
m_charArray = value1;
I know it is ugly, but it the only work around I can think of. I think it needs to log a bug to correct this conversion behavior
William

Similar Messages

  • Passing regexp_replace backreference to a function; type conversion problem

    I am trying to convert some text within my CLOB field to HTML links.
    The format of the (part of the link I am having problems with) is:
    <link 12>
    which I wish to convert to
    url_dest
    I am trying to pass the backreference \1 (being the number 12 in this case) in regexp_replace to a simple function I have made and when I run it I receive the error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    I have tested the function on its own with passing a string and it works fine.
    I have passed the string from the backreference to the function and back out as the return value and it works fine.
    However, when I try to pass the string back reference (a set of digits) to use as the NUMBER ID in my where clause, it always returns this error. I have tried CASTing / TO_NUMBER in every way possible I can think of, using temporary variables etc. and still the same error.
    =====
    CREATE OR REPLACE
    FUNCTION GETLINK (linkid IN CLOB)
    RETURN VARCHAR2 AS
    linkstring VARCHAR2(4000);
    linkchar VARCHAR(4000);
    linkint NUMBER;
    BEGIN
    linkchar := TO_CHAR(linkid);
    linkint := TO_NUMBER(linkchar);
    SELECT url_dest INTO linkstring FROM TABLE WHERE ID = linkint;
    RETURN linkstring;
    END;
    =====
    Offending calling code:
    tempcontent := regexp_replace(myClobField, '<link ([[:digit:]]*)>', GETLINK('\1'));
    =====
    I have tried implicit and explicit type conversions that vary the above function; in parameters as VARCHAR2; etc.; no joy.
    Is this a bug within the database, is it by design, or is it just me making a hash of things? I really don't want to have to pull the XML into PHP then run the PHP regex functions with Oracle DB queries to do this!
    Many thanks for your assistance.
    Ingram

    Many thanks for the reply, but I'm not sure how that would work. I wish to do a global regexp_replace on all instances of '<link> ([[:digit:]]*)>' within my XML document, with the return value from the GETLINK function.
    So for instance.
    The return value of GETLINK could be in format:
    &lt;a href="\1"&gt;
    so an XML document of:
    =====
    &lt;doc&gt;
    &lt;link 12&gt;Test Link&lt;/link&gt;
    some content
    &lt;link 783&gt;A second Test Link&lt;/link&gt;
    &lt;/doc&gt;
    =====
    would return as:
    =====
    &lt;doc>
    &lt;a href="12"&gt;Test Link&lt;/link&gt;
    some content
    &lt;a href="783"&gt;A second Test Link&lt;/link&gt;
    &lt;/doc&gt;
    =====
    Obviously I would then do the other replacements to fix broken XML with the non matching end tags etc.
    TIA

  • Unicode Type Conversion Error

    Hi Friend,
    I am working in UNICODE project,i need one help,
    I have one error .
    Actually, im using one structure(Z0028) and passing values to internal table.
    At that time i shows one error.
    Actually,this error is due to type conversion problem.
    In that structure,i ve one packed datatype ,so, if i select
    unicode check it shows error.
    I will sent example prg and error also.
    Please give some solution to slove.
    REPORT  YPRG1                                   .
    TABLES: Z0028.
    DATA:I_Z0028 TYPE Z0028 OCCURS 0 WITH HEADER LINE .
    SELECT * FROM Z0028 INTO TABLE I_Z0028 .
    IF SY-SUBRC <> 0 .
      WRITE:/ ' NO DATA'.
    ENDIF.
      LOOP AT I_Z0028.
        WRITE:/ I_Z0028.
      ENDLOOP.
    Regards,
    Kalidas.T

    Hi,
    Display fields
    do like this..
    REPORT YPRG1 .
    TABLES: Z0028.
    DATA:I_Z0028 TYPE Z0028 OCCURS 0 WITH HEADER LINE .
    SELECT * FROM Z0028 INTO TABLE I_Z0028 .
    IF SY-SUBRC 0 .
    WRITE:/ ' NO DATA'.
    ENDIF.
    LOOP AT I_Z0028.
    WRITE:/ I_Z0028-field1,
                  I_Z0028-field2
    I_Z0028-field3.
    ENDLOOP.
    Regards,
    Prashant

  • Converting bytes to character array problem

    I am trying to convert a byte array into a character array, however no matter which Character Set i choose i am always getting the '?' character for some of the bytes which means that it was unable to convert the byte to a character.
    What i want is very simple. i.e. map the byte array to its Extended ASCII format which actually is no change in the bit represtation of the actual byte. But i cannot seem to do this in java.
    Does anyone have any idea how to get around this problem?

    Thanks for responding.
    I have however arrived at a solution. A little un-elegant but it seems to do the job.
    I am converting each byte into char manually by this algorithm:
              for (int i=0;i<compressedDataLength;i++)
                   if (((int) output)<0)
                        k=(127-((int) output[i]));
                        outputChr[i]=((char) k);
                   else
                        k=((int) output[i]);
                        outputChr[i]=((char) k);
                   System.out.println(k);
    where output is the byte array and outputChr is the character array

  • Problem in adding "TableLayoutPanel" control array type functionality on windows form dynamically using drag and drop

    Environment: -
     (Application Machine)
    OS Name             : -
    Microsoft Windows 7 Professional/XP SP2/SP3            
    OS Bit Version      : -
    32 Bit                     
    Application Name: - Designer.exe                                  
    IDE                  
        : - Visual Studio 2008                        
    EXE Application development: -
    VB. Net
    Application Type: -
    Application “Designer.exe” was designed in vb6.0 and now, it has been upgraded to Visual Studio 2008 and it works properly.
    Product Description: -
                 We have an application Designer.exe, which is used for designing “Forms”.
    It has menu option with following option like Panel, Text Box, Combo Box, Button etc. We drag any of this menu items and place it to form.
    Requirement: -
    We have
    critical requirement in product. In Designer.exe, we need to align form margin, while we increase or decrease window. And for that we have searched that 
     “TableLayoutPanel” components can be helpful.
    Problem description: -
    Earlier code was in vb6.0, now it has upgraded to Visual Studio 2008. In vb6.0, we have used control array for memory utilization with Combo Box, Group Box, and Text
    Box etc.
    But, for alignment we have to use “TableLayoutPanel”
    control array type functionality on form.
    Code Snippet: - For earlier designing component e.g. Frame
    'Required by the Windows Form Designer
    Public WithEvents Frame1 As Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.Frame1 = New Microsoft.VisualBasic.Compatibility.VB6.GroupBoxArray(Me.components)
    CType(Me.Frame1, System.ComponentModel.ISupportInitialize).BeginInit()
    . Kindly suggest approach for implementing requirement.
    Kindly help us to complete the requirement. I will be really
    thankful for any assistance.

    Hi S.P Singh,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Oracle to Mysql character set conversion problem!!! PLZ IGNORE

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    I have another post in Heterogeneous Connectivity forum
    Re: Oracle to Mysql character set conversion problem!!! PLZ HELP
    Kindly update your comments there,
    @@@@@@@@@@@@@@2
    Appreciate your help,
    regards
    Edited by: user10243788 on Apr 21, 2010 3:25 AM

    It is OK to post a globalization-related question in this forum in addition to the forum pertaining to the main technology. Not all experts follow all possible forums on OTN. Of course, you should cross-link the posts to let people merge the answers.
    Regarding the problem itself, make sure that SQL*Plus has the right NLS_LANG setting in the environment. On Windows, in the Command Prompt:
    C:\> set NLS_LANG=.WE8PC850
    C:\> sqlplus ...On Unix:
    $ setenv NLS_LANG .WE8ISO8859P1   (or NLS_LANG=.WE8ISO8859P1; export NLS_LANG)
    $ sqlplus ...-- Sergiusz

  • Problem with array type in SOAP response for sync interface

    Hi,
    We have a Synchronous Interface from SAP -->PI-->Unifier .The WSDL response has array type and when WSDL is imported it is showing red (I was able to activate  and use it in mapping) .We are able to send the request successfully and when retrieving the response we are getting mapping error .Please find the attachment for reference and response message from unifier .I feel that the error is because of array type .Could someone throw some light how we can solve this soon as it was a bit urgent .
    http://scn.sap.com/thread/326591
    I tried to create the Data Type and use the same instead of using the WSDL from External Definition but did not helped.Request your help in this.I have attached the WSDL for reference .
    The response is received as shown below which is giving mapping error :
    <ns1:getUDRDataResponse xmlns:ns1='http://diran:12020/ws/services/mainservice' soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><getUDRDataReturn href='#id0'/></ns1:getUDRDataResponse>
    The complete response looks like below where PI is not able to receive (this is retrieved from SOAP UI)
    <?xml version="1.0" encoding="utf-8" ?>
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    - <soapenv:Body> 
    - <ns1:getUDRDataResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://general.service.webservices.skire.com"> 
    <getUDRDataReturn href="#id0" /> 
    </ns1:getUDRDataResponse>
    - <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:XMLObject" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="mainservice"> 
    <errorStatus soapenc:arrayType="xsd:string[0]" xsi:type="soapenc:Array" /> 
    <statusCode xsi:type="xsd:int">200</statusCode> 
    <xmlcontents xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?> <report> <report_header> <c1>Name</c1> <c2>Number</c2> <c3>Status</c3> <c4>Location</c4> <c5>Phase</c5> </report_header> <report_row> <c1>Test - Sprint 1 - v10</c1> <c2>GB424</c2> <c3>Active</c3> <c4>/North Sea</c4> <c5></c5> </report_row> <report_row> <c1>Test Training 3</c1> <c2>GB424-TRN3</c2> <c3>Active</c3> <c4>/North Sea</c4> <c5></c5> </report_row> </report></xmlcontents> 
    </multiRef>
    </soapenv:Body>
    </soapenv:Envelope>

    Hi Praveen and Mark,
    Thanks for the help.I tried to use XSLT mapping for request and try to read Response as a single string but i was getting an error in SXMB_MONI with Cannot display document format,Do you want too save it to harddisk and i could not get rid of this even after pressing Yes in popup .
    Can some one help to extract only the xmlcontents  from the above response and map it to target where the target structure looks like
    <report>
    <report_header>
    <report_row>
    Please help .

  • Need Help with data type conversion

    Hello People,
    I am new to java, i need some help with data type conversion:
    I have variable(string) storing IP Address
    IPAddr="10.10.103.10"
    I have to call a library function which passes IP Address and does something and returns me a value.
    The problem I have is that external function call in this library excepts IP Address in form of a byte array.
    Here is the syntax for the function I am calling through my program
    int createDevice (byte[] ipAddress).
    now my problem is I don't know how to convert the string  IPAddr variable into a byte[] ipAddress to pass it through method.

    Class InetAddress has a method
    byte[]      getAddress() You can create an instance using the static method getByName() providing the IP address string as argument.

  • Numeric or value error: character to number conversion error

    I'm having problems inserting a value from a date picker field (DD-MON-YYYY HH MI )
    i'm submitting this value to a packaged procedure that accepts this field as VARCHAR2 .
    on the insert, i do a to_date( P_DATE, 'DD-MON-YYYY HH:MI PM' )
    and i get the numeric conversion error.
    If I change the to_date on the procedure side, I get the :could not read the end of the format mask - which I've found threads about on this site.
    I've tried using HH24 and different formats, but I get one of the two above errors on the insert.
    If I don't fill in the datepicker field at all, it works fine.
    help is appreciated !
    Bill

    Here is the trace anyway:
    *** ACTION NAME:(application 4000, page 1) 2004-09-24 12:58:44.052
    *** MODULE NAME:(HTML DB) 2004-09-24 12:58:44.052
    *** SERVICE NAME:(TOPS) 2004-09-24 12:58:44.052
    *** SESSION ID:(151.1) 2004-09-24 12:58:44.052
    *** 2004-09-24 12:58:44.052
    ksedmp: internal or fatal error
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    null;
    null;
    null;
    f(p=>:p);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    null;
    null;
    commit;
    else
    rc__ := 0;
    null;
    null;
    null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    6A3C4A00 532 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2502 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2748 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A0E63C8 991 package body FLOWS_010500.WWV_FLOW_FORMS
    6A11675C 932 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A11675C 247 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A4B54E0 8341 package body FLOWS_010500.WWV_FLOW
    6A2A99F0 102 procedure FLOWS_010500.F
    6A2B9E54 10 anonymous block
    ----- Call Stack Trace -----
    calling call entry argument values in hex
    location type point (? means dubious value)
    ksedmp+524          CALLrel  ksedst+0 1
    ksedmptracecb+15 CALLrel _ksedmp+0            C
    _ksddoa+118          CALLreg  00000000             C
    ksdpcg+143          CALLrel  ksddoa+0
    ksdpec+180          CALLrel  ksdpcg+0 1966 6D7D208 1
    __PGOSF3__ksfpec+11 CALLrel _ksdpec+0            0
    8
    _kgerev+77           CALLreg  00000000             7474210 1966
    kgerec1+18          CALLrel  kgerev+0 7474210 6DCE5EC 1966 1
    6D7D260
    peirve+465          CALLrel  kgerec1+0
    pevmCVTCN+346 CALLrel _peirve+0           
    pfrinstrCVTCN+36 CALLrel pevmCVTCN+0 6E6E604 71CE370 7160F0C
    pfrrunno_tool+51 CALL??? 00000000
    pfrrun+1834         CALLrel  pfrrun_no_tool+0 6E6E604 6A3C010A 6E6E640
    plsqlrun+1051 CALLrel _pfrrun+0            6E6E604
    peicnt+179          CALLrel  plsql_run+0 6E6E604 1 0
    kkxexe+477          CALLrel  peicnt+0
    opiexe+4896         CALLrel  kkxexe+0 6A2B9E54
    kpoal8+1705         CALLrel  opiexe+0 49 3 6D7E06C
    _opiodr+977          CALLreg  00000000             5E 14 6D7E7CC
    _ttcpip+1827         CALLreg  00000000             5E 14 6D7E7CC 0
    _opitsk+1098         CALL???  00000000            
    opiino+938          CALLrel  opitsk+0 0 0 747ABC0 6DEFB14 D8 0
    _opiodr+977          CALLreg  00000000             3C 4 6D7FBBC
    opidrv+479          CALLrel  opiodr+0 3C 4 6D7FBBC 0
    sou2o+45            CALLrel  opidrv+0 3C 4 6D7FBBC
    opimai+237          CALLrel  sou2o+0
    OracleThreadStart@  CALLrel  opimai+0
    4+899
    77E7D338 CALLreg 00000000

  • HOW TO DO CHECKING BETWEEN THE CHARACTER ARRAY.

    hi all!!
    can any one please help me in checking the two character arrays.
    in my code i need to compare a character array(seq) to that of hydrob and hydrop . if the seq has hydrob then it should be given a different colour. if it has a hydrop then it should be assigned a different colour. if the sequence does not have a character that is neither in hydrob and hydrop then they shuld be given a separate colour.
    for (int i=0;i<seqlength;i++)//a for loop to get a letter
                char str1 = seq; // getting the first letter from
    for (int j=0;j<hydroblen;j++)//for loop to check the
    if (str1 == hydrob[j])//checking problem in here (suppose)
    res=1;//setting a value
    System.out.println("reach") ;
    repaint();//calling d paint function to paint in
    //System.out.println("reach") ;
    //j++;
    System.out.println("over") ;
    for (int i=0;i<seqlength;i++)
    char str2 = seq[i];
    for (int k =0;k<hydroplen;k++)
    while(str2==hydrop[k])
    res =0;
    repaint();
    k++;
    System.out.println("reach") ;
    i have compared them using this. but this is not much efficient which just paints the hydrophilic sequence lenght and paints the seq for that length of sequence.
    also the if loop in the paint function which have to do the paint for hydrob is not executing.
    if(res==1)
                gc.drawString(s, 700,700) ;// not executing the loop
                 for (int i =0;i<seqlength;i++)
               gc.drawString(s, 700,700) ;  //to check whether the loop s executing.
            for (int j=0; j<hydroblen;j++)
                x= x0 + radius*Math.sin(theta*(i));
    y[i]= y0 - radius*Math.cos(theta*(i));
    X[i] = (int) x[i];
    Y[i]= (int) y[i];
    gc.fillOval(X[j]-7,Y[j]-7,14,14);
    seq1 = seq[i] + "";
    hydrop1 = hydrop[j]+"";
    gc.drawString(seq1, X[i], Y[i]-8);
    gc.drawString("",X[j], Y[j]-8);
    gc.drawLine(X[j],Y[j],X[j+1],Y[j+1]);
    gc.setColor(Color.yellow);

    Hi Nitish,
    I think you might have to consult SAP for this. In one of my project experience, I had local currency related probled due to currency change in SAP R/3 during the fiscal year.
    I had a way out there, in a way that I dropped BW data with old currency and uploaded data with new currency and re-did the consoldiation starting from begining of the fiscal year. Unfortunatley, in your scenarios this is not possible
    During my discussion with SAP, I came to know that SAP do provide specific conversion consulting in BW BCS area as well.
    Hope this might help you.
    Best Regards,
    UR

  • Does key comparison work for character arrays?

    I am using the berkeley db(C) to store a 2-column table with key as a character array(not strings). Even though I can see that a record is present when i display all records, I cant get that record using the get function with the correct key. Is there a problem with key comparison? How does berkeley db check two keys for equality? Is there a way around this?
    thanks in advance.

    Hi,
    Your code posting was messed up due to the indexed addressing (the i in square brackets) which is in fact the italic start tag. You can put some spaces inside the square brackets, and make sure to enclose your source code between pre tags ([ pre ] <code goes here> [ / pre ], remove the spaces).
    So, I assume you are trying to store a line of the bi-dimensional char array.
         key.data = a + i;          
         key.size = sizeof(a[ i ]);
    // char *aa = "0a0s0d0f0g0h0j0k0l0q0w0e0r0t0y0f";(I've changed the name of this pointer to distinguish it from the array)
    aa points to a sequence of chars (a string in fact) that should be the same as the ones in the line of the bi-dimensional char array, line that was stored as key in the database, right?
    key.data = aa;
    key.size = sizeof(aa);Now, here is the problem. aa is a pointer to char, thus sizeof(aa) is 2B or 4B (depending on the pointer type, near or far) on a 32-bit machine. So, you're performing the search looking only for the match of the first 2 or 4 chars. Change that line to key.size = strlen(aa); or key.size = sizeof(*(a + i)); (the same as key.size = sizeof(a[ i ]);, a being the char array).
    Regards,
    Andrei

  • ORA-06502: PL/SQL: numeric or value error: character to number conversion

    Hello,
    I am new to Oracle Apex so I decided to read and do the tutorials that are on the apex.oracle.com site.
    Now I am at the tutorial 6: How to Work with Check Boxes of the Advanced Tutorials.
    At a certain point you have to add a new radio button.
    At the Item Source Value you have to add SELECT 'Y' FROM DUAL WHERE :P2_LIST_PRICE*0.75=:P2_MIN_PRICE.
    But when I try to create the item, I keep getting the following error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Error creating item.
    Does anybody know what could be the problem.
    Thanks in advance.

    CREATE OR REPLACE PROCEDURE xxbb_query (
    p_branch_code XXBOB_HRMS_APPRAISALS_DATA.Branch_code%TYPE,
    p_PERIOD_NAME XXBOB_HRMS_APPRAISALS_DATA.PERIOD_NAME%TYPE
    IS
    emp_refcur SYS_REFCURSOR;
    v_deposits XXBOB_HRMS_APPRAISALS_DATA.deposits%TYPE :=0;
    v_branch_code XXBOB_HRMS_APPRAISALS_DATA.branch_code%TYPE:=0;
    p_query_string VARCHAR2(500);
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Hello' || ' ' || '...');
    p_query_string := 'SELECT Avg(deposits) Dep,branch_code  FROM XXBOB_HRMS_APPRAISALS_DATA WHERE ' ||
    *' Branch_code = :branch_code '||*
    *' AND PERIOD_NAME = SubStr( :PERIOD_NAME ,1,4))||(SubStr( :PERIOD_NAME ,InStr( :PERIOD_NAME ,'-',1,1)+3,5)) ' ||*
    *' group BY SubStr(PERIOD_NAME,5),BRANCH_CODE ';*
    DBMS_OUTPUT.PUT_LINE('Hi' || ' ' || '...');
    OPEN emp_refcur
    FOR p_query_string USING p_branch_code,v_p_PERIOD_NAME,v_p_PERIOD_NAME,v_p_PERIOD_NAME;
    -- DBMS_OUTPUT.PUT_LINE('----- -------');
    Here I m passing a string variable to pass the select statement for the ref cursor.
    There seems some problem in the substr conversion in the statement.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    But when i run as a independent staement passing real values in the place of placeholders
    i get the result right.
    The *:PERIOD_NAME* format is *'Jan-2009-10'* .
    And I need to pass the *:PERIOD_NAME* to the query as *'Jan-09-10'*
    Pls suggest.
    Edited by: user7391361 on Jul 23, 2009 8:28 AM

  • Assigning value to array type variable in a loop

    Hi
    I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
    My copy operation in assign activity looks like this-
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters"/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    </copy>
    It is inside a while loop activity.
    PS *()* are square brackets
    But it is erroring out at run time.
    Does anybody has an alternate idea to assign value to an array type?.
    i have seen that while extracting value from an array type variable it works fine
    A similar kind of operation is shown below.
    <copy>
    <from variable="Var" part="InputParameters"
    query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
    <to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
    part="InputParameters"
    query="/ns7:InputParameters"/>
    </copy>
    Thanks
    Ayush
    Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AM

    Hi Ayush
    I suppose you are getting some error like "source node returns multiple elements".
    In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
    Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
    Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
    *<copy>*
    *<from variable="Var" part="InputParameters"*
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
    part="InputParameters"
    query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
    *</copy>*
    And the easiest way to do this is by the transform activity as said above.
    Regards
    Suryaveer
    Edited by: Suryaveer on Aug 15, 2009 11:19 PM

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

  • Axis Type Mapping problem,please help!!!

    i want to try out the encoding subsystem of axis,so i write an interface like this:
    public interface BookStore {
        public Book[] getAllBooks();
    }I use the Java2WSDL to generate the wsdl file and WSDL2Java to generate the client/server side bindings ,of course i implemented the BookStoreSOAPBindingImpl class,then use the deploy.wsdd file to deploy the service to axis.the deploy.wsdd is like this:
    <!-- Use this file to deploy some handlers/chains and services -->
    <!-- Two ways to do this: -->
    <!-- java org.apache.axis.client.AdminClient deploy.wsdd -->
    <!-- after the axis server is running -->
    <!-- or -->
    <!-- java org.apache.axis.utils.Admin client|server deploy.wsdd -->
    <!-- from the same directory that the Axis engine runs -->
    <deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    <!-- Services from BookStoreService WSDL service -->
    <service name="BookStore" provider="java:RPC" style="rpc" use="encoded">
    <parameter name="wsdlTargetNamespace" value="urn:bookstore"/>
    <parameter name="wsdlServiceElement" value="BookStoreService"/>
    <parameter name="wsdlServicePort" value="BookStore"/>
    <parameter name="className" value="axis.typemapping.collection.BookStoreSoapBindingSkeleton"/>
    <parameter name="wsdlPortType" value="BookStore"/>
    <parameter name="typeMappingVersion" value="1.2"/>
    <parameter name="allowedMethods" value="*"/>
    <typeMapping
    xmlns:ns="urn:bookstore"
    qname="ns:Book"
    type="java:axis.typemapping.collection.Book"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    />
    <typeMapping
    xmlns:ns="urn:bookstore"
    qname="ns:ArrayOfBook"
    type="java:axis.typemapping.collection.Book[]"
    serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
    deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    />
    </service>
    </deployment>
    As you could see, the necessary ser/deser factories are declared.
    and i checked the http://locahost:8080/axis page and found the service is just right there in the list.
    Then i wrote the client like this:
    import axis.typemapping.collection.*;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ParameterMode;
    public class Client
        public static void main(String [] args)
            try {     
                String endpointURL ="http://localhost:8080/axis/services/BookStore";
                String textToSend;
                Service  service = new Service();
                Call     call    = (Call) service.createCall();
                call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
                call.setOperationName( new QName("urn:bookstore", "getAllBooks") );
                Object[] ret =(Object[])call.invoke( new Object[] {  } );
                System.out.println("book name:"+(Book)ret[0]);
                System.out.println("book name:"+(Book)ret[1]);
            } catch (Exception e) {
                System.err.println(e.toString());
    }But when i execute the client i got the following exception:
    org.xml.sax.SAXException: No deserializer defined for array type {urn:bookstore}
    BookAs you can see,it is the problem that the Book[] can't be deserialized!
    but in the deploy.wsdd the deserializer is declared,so what i have missed?and how to solve this problem please?
    best regards:)

    Some systems are fussy about the method names and some require indexed accessors for array items. I would suggest starting with an implementation like
    public class BookStore {
        private Book[] books = ...;
        public Book[] getBooks() {return books};
        public void setBooks(Book[] books) {this.books = books};
        public Book getBooks(int j) {return books[j]};
        public void setBooks(Book book, int j) {this.books[j] = book};
    }-- Frank

Maybe you are looking for

  • [Solved] Emoji fonts in URxvt

    I'm attempting to get emoji (and ideally the entire utf8 set) working in my terminal and other programs. In my .Xresources I previously had just Terminus, I've found that Symbola is the font that you want to display emoji? So I figured that the follo

  • Input ready query on Multiprovider displays two row for two Infoproviders

    Hello experts, We are using below design to develop an input ready query.                    Input ready query                        Multiprovider Aggregation level 1      Aggegation level 2 Realtime cube 1            Real time cube 2 As we are deve

  • Org structure quiries - about sales org to plant assignment &shipping point

    Dear All, My client is asking why the assignment of single sales organization with respect to all plants, why not separate sales organization for each plant?. But here we configured the single sales organization since a single sales department is the

  • Logic, Waveburner crash on "Save As..." under Snow Leopard

    Finally decided to upgrade my Early 2008 Mac Pro 2.8GHz 8-core from 10.5.8 to 10.6.8. Most things work fine, but Logic and Waveburner crash every time I try to do a "Save As..." The programs will open and save already existing documents but will cras

  • Logical Data Extract from SAP/Oracle

    Hi, We have been asked by our client to develop a data extraction tool for SAP/Oracle. For example, we would need to extract user/employee information. What is the best way to go about this? Ideally we would like to allow the user to connect to the D