Parse a WDDX packet using httpservice

Hi,
Can anyone tell me how to parse a wddx packet in flex using
httpservice,
- <wddxPacket version='1.0'>
<header/>
<data>
<struct>
<var
name='Firstname'><string>Henry</string></var>
<var
name='Email'><string>[email protected]</string></var>
</struct>
</data>
</wddxPacket>
How is the result handled? ------------event.result. ??
Thanks in Advance!!
Lama

"lama56" <[email protected]> wrote in
message
news:gfme47$4ht$[email protected]..
> Hi,
>
> Can anyone tell me how to parse a wddx packet in flex
using httpservice,
> - <wddxPacket version='1.0'>
> <header/>
> <data>
> <struct>
> <var
name='Firstname'><string>Henry</string></var>
> <var
name='Email'><string>[email protected]</string></var>
> </struct>
> </data>
> </wddxPacket>
>
> How is the result handled? ------------event.result. ??
http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_12.html
http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_11.html
http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_02.html
It seems like you're having trouble mastering the Flex help
system, so I'd
suggest this as well:
http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

Similar Messages

  • WDDX packet parse error when posting cfquery object

    I am posting a hidden form attribute of a wddx encrypted
    cfquery object to my action page. The data includes ampersands
    '&'. I have verified that the data getting set to the form
    variable has the ampersand encoded as '&amp;' but when passed
    to the next page the ampersand has already been decoded. There fore
    I get the following error message when calling <cfwddx> with
    an action="wddx2cfml": "WDDX packet parse error at line 1, column
    1618. The entity name must immediately follow the '&' in the
    entity reference.."
    How can I make sure that the ampersand is encoded properly
    before deseriealizing by query object?
    Thanks,
    John

    Are you certain the & were converted to &amp; ? It
    seems to work for me.

  • How to parse a HTML file using HTML parser in J2SE?

    I want to parse an HTML file using HTML parser. Can any body help me by providing a sample code to parse the HTML file?
    Thanks nad Cheers,
    Amaresh

    What HTML parser and what does "parsing" mean to you?

  • How to parse an XMl without using prefix in the namespace and elements?

    Hi
    The following is a sample of the xml that I need to parse.
    Without the prefix in the namespace section I am getting an error but when i just put in the prefix it works fine. Any help here would be greatly appreciated.
    I think i need to change something in the parser set up...may be the somewhere in the bolded lines....but i am clueless...
    //Xml begins
    <?xml version="1.0" encoding="utf-8" ?>
    - <Statemessages xsi:schemaLocation="http://www.SomeLocation.com/SomeXSD.xsd" xmlns="http://www.abcd.com/BSN" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <FileControl>
    <CreationDate>2008-08-11</CreationDate>
    - <Source>
    <SystemID>SAP4BSN</SystemID>
    <MandantID>100</MandantID>
    </Source>
    - <Destination>
    <SystemID>CWL</SystemID>
    <MandantID>746</MandantID>
    </Destination>
    <SequenceNumber>000000004</SequenceNumber>
    <Counter>000000001</Counter>
    </FileControl>
    - <Message>
    - <PartyRegistrationID>
    <ID>2101576347</ID>
    <Type>RG</Type>
    <ID>2101576347</ID>
    <Type>AG</Type>
    </PartyRegistrationID>
    <CustomerGroupID>02</CustomerGroupID>
    <Name>Lewicki</Name>
    <Subname>Hans Bruno Michel</Subname>
    <DateTime>2008-08-11T23:59:59</DateTime>
    - <DefaultOfPayment>
    <MessageID>00000001</MessageID>
    <GrossAmountBefore>0.0</GrossAmountBefore>
    <GrossAmountCurrent>-17.9</GrossAmountCurrent>
    <Currency>EUR</Currency>
    <SettlementOfBalance>Nein</SettlementOfBalance>
    <IncludingSubsidiaryClaim>Ja</IncludingSubsidiaryClaim>
    </DefaultOfPayment>
    - <ContractsWithDefaultOfPayment>
    <ContractID>0148863732</ContractID>
    </ContractsWithDefaultOfPayment>
    - <Messagedetails>
    - <ReturnDebitNote>
    <MessageID>00000002</MessageID>
    <KindOf>BA</KindOf>
    <Reason>E2</Reason>
    <Date>2008-08-11</Date>
    <GrossAmount>-15.4</GrossAmount>
    <Currency>EUR</Currency>
    </ReturnDebitNote>
    </Messagedetails>
    </Message>
    </Statemessages>
    //XML end
    I am using the following stored procedure to try this;
    create or replace PROCEDURE CompleteSaveXML_1 AS
    XMLMessage2 XMLTYPE;
    v_parser dbms_xmlparser.Parser;
    v_clob CLOB;
    v_sent DATE;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_nFCL xmldom.DOMNodeList;
    v_nFCN xmldom.DOMNode;
    v_nFCSourceL xmldom.DOMNodeList;
    v_nFCSourceN xmldom.DOMNode;
    v_nFCDestinationL xmldom.DOMNodeList;
    v_nFCDestinationN xmldom.DOMNode;
    m_nl xmldom.DOMNodeList;
    m_n xmldom.DOMNode;
    v_n xmldom.DOMNode;
    v_n3 xmldom.DOMNodeList;
    v_n4 xmldom.DOMNode;
    v_b xmldom.DOMNode;
    v_d xmldom.DOMNode;
    v_a xmldom.DOMNodeList;
    v_c xmldom.DOMNodeList;
    m_prg xmldom.DOMNodeList;
    m_pr xmldom.DOMNode;
    condf_nl xmldom.DOMNodeList;
    condf_n xmldom.DOMNode;
    msgdtl_nl xmldom.DOMNodeList;
    msgdtl_n xmldom.DOMNode;
    rtndbt_nl xmldom.DOMNodeList;
    rtndbt_n xmldom.DOMNode;
    dnlt_nl xmldom.DOMNodeList;
    dnlt_n xmldom.DOMNode;
    cancl_nl xmldom.DOMNodeList;
    cancl_n xmldom.DOMNode;
    conid_nl xmldom.DOMNodeList;
    conid_n xmldom.DOMNode;
    canclid_nl xmldom.DOMNodeList;
    canclid_n xmldom.DOMNode;
    par_ref number(10) :=0;
    msgnum number(20):=0;
    var1 number(30):=0;
    rtnnum number(20):=0;
    dnnum number(20):=0;
    tpmsg number(20):=0;
    condfpmt number(20):=0;
    canclnum number(20):=0;
    --Added the next variable
    sequence_no     number(20):=0;
    --These are the new variables
    condfpmt1 number(20):=0;
    rtnnum1 number(20):=0;
    dnnum1 number(20):=0;
    tpmsg1 number(20):=0;
    canclnum1 number(20):=0;
    --changing
    part_refid_value number(20);
    parid_typ_n xmldom.DOMNode;
    parid_typ_nl xmldom.DOMNodeList;
    parid_id_nl xmldom.DOMNodeList;
    parid_id_n     xmldom.DOMNode;
    party_ref_node xmldom.DOMNode;
    var_pr_reg_typ VARCHAR2(2);
    msgrtdbt_nl xmldom.DOMNodeList;
    msgrtdbt_n xmldom.DOMNode;
    kndrtdbt_nl xmldom.DOMNodeList;
    kndrtdbt_n xmldom.DOMNode;
    rsnrtdbt_nl xmldom.DOMNodeList;
    rsnrtdbt_n xmldom.DOMNode;
    datrtdbt_nl xmldom.DOMNodeList;
    datrtdbt_n xmldom.DOMNode;
    grssrtdbt_nl xmldom.DOMNodeList;
    grssrtdbt_n xmldom.DOMNode;
    currtdbt_nl xmldom.DOMNodeList;
    currtdbt_n xmldom.DOMNode;
    rtnnum2 number(20):=0;
    msgdnlt_nl xmldom.DOMNodeList;
    msgdnlt_n xmldom.DOMNode;
    lvdnlt_nl xmldom.DOMNodeList;
    lvdnlt_n xmldom.DOMNode;
    datdnlt_nl xmldom.DOMNodeList;
    datdnlt_n xmldom.DOMNode;
    grsdnlt_nl xmldom.DOMNodeList;
    grsdnlt_n xmldom.DOMNode;
    curdnlt_nl xmldom.DOMNodeList;
    curdnlt_n xmldom.DOMNode;
    limdnlt_nl xmldom.DOMNodeList;
    limdnlt_n xmldom.DOMNode;
    lvimp number(20);
    nullchk varchar2(30) ;
    chk_flseq number(10);
    fl_seq number(30);
    --these are the new variables
    TYPE tab_type IS TABLE OF FileControl%ROWTYPE;
    t_tab_FC tab_type := tab_type();
    TYPE tab_type1 IS TABLE OF MessageTab%ROWTYPE;
    t_tab1 tab_type1 := tab_type1();
    TYPE tab_type2 IS TABLE OF ContractsWithDefaultOfPayment%ROWTYPE;
    t_tab2 tab_type2 := tab_type2();
    TYPE tab_type3 IS TABLE OF CancellationTab%ROWTYPE;
    t_tab3 tab_type3 := tab_type3();
    TYPE tab_type4 IS TABLE OF ReturnDebitNoteTab%ROWTYPE;
    t_tab4 tab_type4 := tab_type4();
    TYPE tab_type5 IS TABLE OF DunningLettersTab%ROWTYPE;
    t_tab5 tab_type5 := tab_type5();
    cursor MessageCursor is
    select * from OM_BSN_STATEMSGS
    where PROCESSED is null AND SENT in(Select min(SENT) from OM_BSN_STATEMSGS
    where PROCESSED is null)
    order by sent asc;
    v_statemsgs OM_BSN_STATEMSGS%ROWTYPE;
    BEGIN
    DBMS_OUTPUT.put_line('creating parser');
    -- v_parser := DBMS_XMLPARSER.NEWPARSER;
    v_parser := DBMS_XMLPARSER.NEWPARSER();
    DBMS_OUTPUT.put_line('done creating');
    DBMS_XMLPARSER.setValidationMode(v_parser, true);
    DBMS_XMLPARSER.showWarnings(v_parser, true);
    open MessageCursor;
    loop
    fetch MessageCursor into v_statemsgs;
    exit when MessageCursor%NOTFOUND;
    DBMS_XMLPARSER.PARSECLOB(P => v_parser, DOC => v_statemsgs.MESSAGE);
    -- xmlparser.parse(v_parser, File_Location);
    v_doc := xmlparser.getDocument(v_parser);
    dbms_xmlparser.freeParser(v_parser); DBMS_OUTPUT.put_line('Step 1');
    v_nFCL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl');
    v_nFCN := xmldom.item(v_nFCL,0);
    Source
    v_nFCSourceL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl/Source');
    v_nFCSourceN := xmldom.item(v_nFCSourceL,0);
    Destination
    v_nFCDestinationL := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/FileControl/Destination');
    v_nFCDestinationN := xmldom.item(v_nFCDestinationL,0);
    -- Populate tab type for ORFC
    t_tab_FC.extend;
    t_tab_FC(t_tab_FC.last).creation_date := to_date(xslprocessor.valueOf(v_nFCN,'CreationDate'),'YYYY-MM-DD');
    t_tab_FC(t_tab_FC.last).src_sys_id := xslprocessor.valueOf(v_nFCSourceN,'SystemID');
    t_tab_FC(t_tab_FC.last).src_mandant_id := xslprocessor.valueOf(v_nFCSourceN,'MandantID');
    t_tab_FC(t_tab_FC.last).dest_sys_id := xslprocessor.valueOf(v_nFCDestinationN,'SystemID');
    t_tab_FC(t_tab_FC.last).dest_mandant_id := xslprocessor.valueOf(v_nFCDestinationN,'MandantID');
    t_tab_FC(t_tab_FC.last).seq_no := xslprocessor.valueOf(v_nFCN,'SequenceNumber');
    t_tab_FC(t_tab_FC.last).counter := xslprocessor.valueOf(v_nFCN,'Counter');
    --Saving the value of this seq_no so that it can be inserted in the message tab.
    sequence_no:= xslprocessor.valueOf(v_nFCN,'SequenceNumber');
    --Insert into ORFC TAB
    fl_seq := xslprocessor.valueOf(v_nFCN,'SequenceNumber');
    select count(*) into chk_flseq from FileControl where SEQ_NO =fl_seq;
    if (chk_flseq =0) then
    FOR each_FC IN t_tab_FC.first .. t_tab_FC.last LOOP
    INSERT INTO FileControl
    creation_date,
    src_sys_id,
    src_mandant_id,
    dest_sys_id,
    dest_mandant_id,
    seq_no,
    counter)
    VALUES
    t_tab_FC(each_FC).creation_date,
    t_tab_FC(each_FC).src_sys_id ,
    t_tab_FC(each_FC).src_mandant_id,
    t_tab_FC(each_FC).dest_sys_id,
    t_tab_FC(each_FC).dest_mandant_id,
    t_tab_FC(each_FC).seq_no,
    t_tab_FC(each_FC).counter
    END LOOP;
    end if;
    DBMS_OUTPUT.put_line('Step 2');
    if (chk_flseq =0) then /* chk the xml's filecontrol seq exists in filecontrltab */
    -- Use XPATH syntax to assign values to he elements of the collection.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/Statemessages/Message');
    tpmsg := xmldom.getLength(v_nl);
    DBMS_OUTPUT.put_line('Message node length'||tpmsg);
    if (tpmsg>0) then
    FOR cur_emp IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, cur_emp);
    select (BISON_OM_MessageID.NEXTVAL) into var1 from dual;
    t_tab1.extend;
    t_tab1(t_tab1.last).message_id := var1;
    t_tab1(t_tab1.last).seq_no     := sequence_no;
    ---party reg
    m_prg := xslprocessor.selectNodes(v_n,'PartyRegistrationID');
    FOR Ref_Id_Loop IN 0 .. xmldom.getLength(m_prg) - 1 LOOP
    party_ref_node := xmldom.item(m_prg,0);
    part_refid_value := xslprocessor.valueOf(party_ref_node,'.');
    end loop;
    m_pr := xmldom.item(m_prg, 0);
    --changing
    --chang id
    parid_id_nl := xslprocessor.selectNodes(m_pr,'ID');
    DBMS_OUTPUT.put_line('Going to read PartyRegistrationID');
    FOR cur_parid_id IN 0 .. xmldom.getLength(parid_id_nl) - 1 LOOP
    parid_id_n := xmldom.item(parid_id_nl,cur_parid_id);
    DBMS_OUTPUT.put_line('Value of id:'|| xslprocessor.valueOf(parid_id_n,'.'));
    t_tab1(t_tab1.last).party_ref_id := xslprocessor.valueOf(parid_id_n,'.');
    exit;
    end loop ;
    ---- change id
    parid_typ_nl := xslprocessor.selectNodes(m_pr,'Type');
    FOR cur_parid_typ IN 0 .. xmldom.getLength(parid_typ_nl) - 1 LOOP
    parid_typ_n := xmldom.item(parid_typ_nl,cur_parid_typ);
    var_pr_reg_typ := xslprocessor.valueOf(parid_typ_n,'.');
    if var_pr_reg_typ='RG' then
    t_tab1(t_tab1.last).PARTY_REG_TYPE_RG := var_pr_reg_typ;
    elsif var_pr_reg_typ='AG' then
    t_tab1(t_tab1.last).PARTY_REG_TYPE_AG := var_pr_reg_typ;
    end if;
    end loop;
    --Chang
    -- t_tab1(t_tab1.last).PARTY_REG_TYPE_AG := xslprocessor.valueOf(m_pr,'Type');
    par_ref :=xslprocessor.valueOf(m_pr,'ID');
    t_tab1(t_tab1.last).customer_grp_id := xslprocessor.valueOf(v_n,'CustomerGroupID');
    t_tab1(t_tab1.last).name := xslprocessor.valueOf(v_n,'Name');
    t_tab1(t_tab1.last).subname := xslprocessor.valueOf(v_n,'Subname');
    t_tab1(t_tab1.last).datetime := xslprocessor.valueOf(v_n,'DateTime');
    DBMS_OUTPUT.put_line('Step 3 ContractsWithDefaultOfPayment');
    m_nl := xslprocessor.selectNodes(v_n,'DefaultOfPayment');
    m_n := xmldom.item(m_nl, 0);
    t_tab1(t_tab1.last).payment_msg_id := xslprocessor.valueOf(m_n,'MessageID');
    t_tab1(t_tab1.last).gross_amt_before := xslprocessor.valueOf(m_n,'GrossAmountBefore');
    t_tab1(t_tab1.last).gross_amt_current := xslprocessor.valueOf(m_n,'GrossAmountCurrent');
    t_tab1(t_tab1.last).currency := xslprocessor.valueOf(m_n,'Currency');
    t_tab1(t_tab1.last).settlemen_of_balance := xslprocessor.valueOf(m_n,'SettlementOfBalance');
    t_tab1(t_tab1.last).including_subsidiary_claim := xslprocessor.valueOf(m_n,'IncludingSubsidiaryClaim');
    condf_nl := xslprocessor.selectNodes(v_n,'ContractsWithDefaultOfPayment');
    condf_n := xmldom.item(condf_nl,0);
    condfpmt := xmldom.getLength(condf_nl);
    if (condfpmt > 0) then
    conid_nl := xslprocessor.selectNodes(condf_n,'ContractID');
    FOR cur_conid IN 0 .. xmldom.getLength(conid_nl) - 1 LOOP
    conid_n := xmldom.item(conid_nl,cur_conid);
    t_tab2.extend;
    t_tab2(t_tab2.last).message_id := var1;
    t_tab2(t_tab2.last).contract_id := xslprocessor.valueOf(conid_n,'.');
    end loop;
    condfpmt1 := 1;
    end if;
    cancl_nl := xslprocessor.selectNodes(v_n,'Cancellation');
    cancl_n := xmldom.item(cancl_nl,0);
    DBMS_OUTPUT.put_line('No of cancellations'||xmldom.getLength(cancl_nl) );
    canclnum := xmldom.getLength(cancl_nl) ;
    if (canclnum > 0) then
    canclid_nl := xslprocessor.selectNodes(cancl_n,'MessageID');
    FOR cur_canclid IN 0 .. xmldom.getLength(canclid_nl) - 1 LOOP
    canclid_n := xmldom.item(canclid_nl,cur_canclid);
    t_tab3.extend;
    t_tab3(t_tab3.last).message_id := var1;
    t_tab3(t_tab3.last).cancellation_msg_id := xslprocessor.valueOf(canclid_n,'.');
    end loop;
    canclnum1 :=1;
    end if; -- canclnum
    msgdtl_nl := xslprocessor.selectNodes(v_n,'Messagedetails');
    msgnum := xmldom.getLength(msgdtl_nl) ;
    dbms_output.put_line('msgggg::::'||msgnum);
    if (msgnum >0) then
    msgdtl_n := xmldom.item(msgdtl_nl,0);
    rtndbt_nl := xslprocessor.selectNodes(msgdtl_n,'ReturnDebitNote');
    rtndbt_n := xmldom.item(rtndbt_nl,0);
    rtnnum := xmldom.getLength(rtndbt_nl) ;
    if (rtnnum >0) then
    --return debit note
    msgrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'MessageID');
    kndrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'KindOf');
    rsnrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Reason');
    datrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Date');
    grssrtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'GrossAmount');
    currtdbt_nl := xslprocessor.selectNodes(rtndbt_n,'Currency');
    rtnnum2 :=0;
    FOR cur_msgrtndbt IN 0 .. xmldom.getLength(msgrtdbt_nl) - 1 LOOP
    msgrtdbt_n := xmldom.item(msgrtdbt_nl,cur_msgrtndbt);
    kndrtdbt_n := xmldom.item(kndrtdbt_nl,cur_msgrtndbt);
    rsnrtdbt_n := xmldom.item(rsnrtdbt_nl,cur_msgrtndbt);
    datrtdbt_n := xmldom.item(datrtdbt_nl,cur_msgrtndbt);
    grssrtdbt_n := xmldom.item(grssrtdbt_nl,cur_msgrtndbt);
    currtdbt_n := xmldom.item(currtdbt_nl,cur_msgrtndbt);
    t_tab4.extend;
    t_tab4(t_tab4.last).message_id := var1;
    t_tab4(t_tab4.last).ret_debitnote_msg_id := xslprocessor.valueOf(msgrtdbt_n,'.');
    t_tab4(t_tab4.last).kind_of := xslprocessor.valueOf(kndrtdbt_n,'.');
    t_tab4(t_tab4.last).Reason := xslprocessor.valueOf(rsnrtdbt_n,'.');
    t_tab4(t_tab4.last).debit_note_date := to_date(xslprocessor.valueOf(datrtdbt_n,'.'),'YYYY-MM-DD');
    t_tab4(t_tab4.last).gross_amt := xslprocessor.valueOf(grssrtdbt_n,'.');
    t_tab4(t_tab4.last).currency := xslprocessor.valueOf(currtdbt_n,'.');
    rtnnum1 :=rtnnum1 + 1;
    rtnnum2 := rtnnum2 + 1;
    dbms_output.put_line('message_id::::'||var1);
    dbms_output.put_line('rtnnum2::::'||rtnnum2);
    dbms_output.put_line('ret_debitnote_msg_id:::'||t_tab4(t_tab4.last).ret_debitnote_msg_id);
    end loop;
    ----return debit note
    t_tab4(t_tab4.last).message_id := var1 ;
    t_tab4(t_tab4.last).ret_debitnote_msg_id := xslprocessor.valueOf(rtndbt_n,'MessageID');
    t_tab4(t_tab4.last).kind_of := xslprocessor.valueOf(rtndbt_n,'KindOf');
    t_tab4(t_tab4.last).reason := xslprocessor.valueOf(rtndbt_n,'Reason');
    t_tab4(t_tab4.last).debit_note_date := to_date(xslprocessor.valueOf(rtndbt_n,'Date'),'YYYY-MM-DD');
    t_tab4(t_tab4.last).gross_amt := xslprocessor.valueOf(rtndbt_n,'GrossAmount');
    t_tab4(t_tab4.last).currency := xslprocessor.valueOf(rtndbt_n,'Currency');
    rtnnum1 :=1;
    end if;
    dnlt_nl := xslprocessor.selectNodes(msgdtl_n,'DunningLetter');
    dnlt_n := xmldom.item(dnlt_nl, 0);
    dnnum := xmldom.getLength(dnlt_nl) ;
    if (dnnum >0) then
    -- t_tab5.extend;
    --dunning letter
    msgdnlt_nl := xslprocessor.selectNodes(dnlt_n,'MessageID');
    lvdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Level');
    datdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Date');
    grsdnlt_nl := xslprocessor.selectNodes(dnlt_n,'GrossAmount');
    curdnlt_nl := xslprocessor.selectNodes(dnlt_n,'Currency');
    limdnlt_nl := xslprocessor.selectNodes(dnlt_n,'LevelImprovement');
    FOR cur_msgdnlt IN 0 .. xmldom.getLength(msgdnlt_nl) - 1 LOOP
    msgdnlt_n := xmldom.item(msgdnlt_nl,cur_msgdnlt);
    lvdnlt_n := xmldom.item(lvdnlt_nl,cur_msgdnlt);
    datdnlt_n := xmldom.item(datdnlt_nl,cur_msgdnlt);
    grsdnlt_n := xmldom.item(grsdnlt_nl,cur_msgdnlt);
    curdnlt_n := xmldom.item(curdnlt_nl,cur_msgdnlt);
    limdnlt_n := xmldom.item(limdnlt_nl,cur_msgdnlt);
    t_tab5.extend;
    t_tab5(t_tab5.last).message_id := var1;
    t_tab5(t_tab5.last).dunning_msg_id := xslprocessor.valueOf(msgdnlt_n,'.');
    t_tab5(t_tab5.last).d_level := xslprocessor.valueOf(lvdnlt_n,'.');
    t_tab5(t_tab5.last).dunning_date := to_date(xslprocessor.valueOf(datdnlt_n,'.'),'YYYY-MM-DD');
    t_tab5(t_tab5.last).gross_amt := xslprocessor.valueOf(grsdnlt_n,'.');
    t_tab5(t_tab5.last).currency := xslprocessor.valueOf(curdnlt_n,'.');
    lvimp := xmldom.getLength(limdnlt_nl);
    begin
    t_tab5(t_tab5.last).level_improvement := xslprocessor.valueOf(limdnlt_n,'.');
    EXCEPTION
    WHEN OTHERS THEN
    t_tab5(t_tab5.last).level_improvement := null;
    end;
    dnnum1 :=dnnum1 + 1;
    -- dnnum2 := dnnum2 + 1;
    dbms_output.put_line('message_id::::'||var1);
    end loop;
    ----dunning letter
    t_tab5(t_tab5.last).message_id := var1;
    t_tab5(t_tab5.last).dunning_msg_id := xslprocessor.valueOf(dnlt_n,'MessageID');
    t_tab5(t_tab5.last).d_level := xslprocessor.valueOf(dnlt_n,'Level');
    t_tab5(t_tab5.last).dunning_date := to_date(xslprocessor.valueOf(dnlt_n,'Date'),'YYYY-MM-DD');
    t_tab5(t_tab5.last).gross_amt := xslprocessor.valueOf(dnlt_n,'GrossAmount');
    t_tab5(t_tab5.last).currency := xslprocessor.valueOf(dnlt_n,'Currency');
    t_tab5(t_tab5.last).level_improvement := xslprocessor.valueOf(dnlt_n,'LevelImprovement');
    dnnum1 :=1; */
    end if;
    end if;
    END LOOP;
    -- Insert data into the real EMP table from the table collection.
    -- Form better performance multiple collections should be used to allow
    -- bulk binding using the FORALL construct but this would make the code
    -- too long-winded for this example.
    DBMS_OUTPUT.put_line('Step 5');
    FOR cur_emp IN t_tab1.first .. t_tab1.last LOOP
    INSERT INTO MessageTab
    message_id,
    PARTY_REF_ID,
    PARTY_REG_TYPE_AG,
    party_reg_type_rg,
    customer_grp_id,
    name,
    subname,
    datetime,
    payment_msg_id,
    gross_amt_before,
    gross_amt_current,
    currency,
    settlemen_of_balance,
    including_subsidiary_claim,
    seq_no)
    VALUES
    t_tab1(cur_emp).message_id,
    t_tab1(cur_emp).PARTY_REF_ID,
    t_tab1(cur_emp).PARTY_REG_TYPE_AG,
    t_tab1(cur_emp).PARTY_REG_TYPE_RG,
    t_tab1(cur_emp).customer_grp_id,
    t_tab1(cur_emp).name,
    t_tab1(cur_emp).subname,
    t_tab1(cur_emp).datetime,
    t_tab1(cur_emp).payment_msg_id,
    t_tab1(cur_emp).gross_amt_before,
    t_tab1(cur_emp).gross_amt_current,
    t_tab1(cur_emp).currency,
    t_tab1(cur_emp).settlemen_of_balance,
    t_tab1(cur_emp).including_subsidiary_claim,
    t_tab1(cur_emp).seq_no
    END LOOP;
    DBMS_OUTPUT.put_line('Step 6');
    if (condfpmt1 > 0) then
    FOR cur_cnf IN t_tab2.first .. t_tab2.last LOOP
    INSERT INTO ContractsWithDefaultOfPayment
    (message_id,contract_id)
    values
    (t_tab2(cur_cnf).message_id,t_tab2(cur_cnf).contract_id );
    end loop;
    end if; -- condfpmt
    if (canclnum1 > 0) then
    FOR cur_cancl IN t_tab3.first .. t_tab3.last LOOP
    INSERT INTO CancellationTab
    (message_id,cancellation_msg_id)
    VALUES
    (t_tab3(cur_cancl).message_id,t_tab3(cur_cancl).cancellation_msg_id);
    END LOOP;
    end if;
    DBMS_OUTPUT.put_line('Step 7');
    if (rtnnum1 >0) then
    FOR cur_rtndb IN t_tab4.first .. t_tab4.last LOOP
    INSERT INTO ReturnDebitNoteTab
    (message_id,
    ret_debitnote_msg_id,
    kind_of,
    reason,
    debit_note_date,
    gross_amt,
    currency
    VALUES
    (t_tab4(cur_rtndb).message_id,
    t_tab4(cur_rtndb).ret_debitnote_msg_id,
    t_tab4(cur_rtndb).kind_of,
    t_tab4(cur_rtndb).reason,
    t_tab4(cur_rtndb).debit_note_date,
    t_tab4(cur_rtndb).gross_amt,
    t_tab4(cur_rtndb).currency);
    END LOOP;
    end if;
    if (dnnum1 >0) then
    FOR cur_dnl IN t_tab5.first .. t_tab5.last LOOP
    INSERT INTO DunningLettersTab
    (message_id,
    dunning_msg_id,
    d_level,
    dunning_date,
    gross_amt,
    currency,
    level_improvement)
    VALUES
    (t_tab5(cur_dnl).message_id,
    t_tab5(cur_dnl).dunning_msg_id,
    t_tab5(cur_dnl).d_level,
    t_tab5(cur_dnl).dunning_date,
    t_tab5(cur_dnl).gross_amt,
    t_tab5(cur_dnl).currency,
    t_tab5(cur_dnl).level_improvement
    END LOOP;
    DBMS_OUTPUT.put_line('Step 8');
    end if; -- dnn
    end if; -- top msg
    end if; --- fl_seq chk
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    /* refresh array */
    t_tab_FC.delete;
    t_tab1.delete;
    t_tab2.delete;
    t_tab3.delete;
    t_tab4.delete;
    t_tab5.delete;
    /* refsh */
    end loop;
    close MessageCursor;
    END ;
    //

    Errors thrown by Oracle always show a line number (even if it points to the FOR loop that the error occurred within). When you run it, what is the error stack that is being returned. Copy and paste that, don't summarize it.
    If you are still uncertain, add a final
    EXCEPTION
      WHEN OTHERS THEN
         dbms_output.put_line(DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);to have it written out where your normal dbms_output goes. This is your friend in 10g for tracking down errors.
    "But as soon as i add a prefix in the header everything works fine."
    Is that header in the sample XML you provided? Regardless what are you adding? Your data is a clob so you can always tweak it before converting it to a DOMDocument just by doing simple string manipulation.
    Since you are in 10g, you should be using dbms_xmldom instead of xmldom. I think xmldom is just a synonym for dbms_xmldom though. Review the dbms_xmldom documentation. You can go straight from a clob to a DOMDocument via DBMS_XMLDOM.NEWDOMDOCUMENT. You can also parse the document completely using dbms_xmldom calls instead of xslprocessor calls.
    Other random things to evaluate:
    Consider turning
             FOR each_FC IN t_tab_FC.first .. t_tab_FC.last LOOP
                INSERT INTO FileControl
    into a
             FORALL i IN t_tab_FC.first .. t_tab_FC.last LOOP
                INSERT INTO FileControl
                 ...Better performance because one two context switches (PL/SQL -> SQL -> PL/SQL) instead of 2*n switches.
    I like this construct better
       TYPE tab_type IS TABLE OF FileControl%ROWTYPE INDEX BY BINARY_INTEGER;
       t_tab_FC tab_type := tab_type;because then you don't have to       t_tab_FC.extend;you can just do something like     index := 1;
         LOOP
            t_tab_FC(index).creation_date := <whatever>;
            index := index + 1;
         END LOOPYou also have the option of parsing your XML as a XMLType, including purely in SQL, but you can research that avenue at a later date.
    Forgot to mention, wrap any code examples in [ pre ] [ pre ] (without the spaces) to retain your formatting.

  • Problem in parsing a xml string using dom parser

    i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
    InputStream inputstream = new StringBufferInputStream(XmlData) ;
    InputSource inputSource = new InputSource(inputstream );
    but saxexception is coming and also warning called
    "java.io.StringBufferInputStream in java.io has been deprecated"
    please help me.........

    i want to parse a Xml String using a Dom
    parser......the parse function in dom parser takes
    only input stream as argument.......This is not true of the DOM parser in Java 1.4. So you might want to get rid of your old parser and replace it by something more current. Or perhaps you are using 1.4 and you just didn't read all of the API docs.

  • Parsing a XML file using Jdom-Problem.

    Hi all,
    I am reposting it as I was told to format the code and send it again.
    I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element. (I get the expected result) .If the "xmlns" attribute is put in the xml as it should be then the parsing and retrieving returns null. Please tell me how to fix this issue.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xml
    <process name="CreateKBEntryService" targetNamespace="http://serena.com/CreateKBEntryService" suppressJoinFailure="yes" xmlns:tns="http://serena.com/CreateKBEntryService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:nsxml0="http://localhost:8080/axis/services/CreateKBEntryService" xmlns:nsxml1="http://DefaultNamespace" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
    <partnerLink name="client" partnerLinkType="tns:CreateKBEntryService" myRole="CreateKBEntryServiceProvider"/>
    <partnerLink name="CreateKBEntryPartnerLink" partnerLinkType="nsxml0:CreateKBEntryLink" partnerRole="CreateKBEntryProvider"/>
    </partnerLinks>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java:
    import java.io.*;
    import java.util.*;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    public class sample1 {
    public static void main(String[] args) throws Exception {
    // create a XML parser and read the XML file
    SAXBuilder oBuilder = new SAXBuilder();
    Document oDoc = oBuilder.build(new File("**xml file location**"));
    Element root = oDoc.getRootElement();
    System.out.println(root.getName());
    String tgtns= root.getAttributeValue("targetNamespace");
    System.out.println("tgt ns "+ tgtns);
    List list= root.getChildren("partnerLinks");
    Iterator it1= list.iterator();
    System.out.println("Iterator 1 - "+list.size());
    while(it1.hasNext()){
    Element partnerlinks = (Element)it1.next();
    List list2= partnerlinks.getChildren("partnerLink");
    System.out.println("iterator 2 - "+list2.size());
    }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Result:
    Without Xmlns in xml file(Expected and correct output)
    process
    tgt ns http://serena.com/CreateKBEntryService
    Iterator 1 - 1//expected and correct result that comes when I remove xmlns attribute from xml
    iterator 2 - 2
    Result with xmlns:
    process
    tgt ns http://serena.com/CreateKBEntryService
    Iterator 1 - 0 //instead of 0 should return 1

    LOL
    This is what you get for working 12 hours straight....
    I changed:
    xmlObject["mydoc"]["modelglue"]["event-handlers"]["event-handler"][i].xmlAttrib utes["name"]<br>
    to:
    #mydoc["modelglue"]["event-handlers"]["event-handler"][i].xmlAttrib utes["name"]#<br>
    xmlObject is the name of my xml object in memory, and then you reference from the root of the xml doc down the chain.
    Sorry for the inconvenience,
    Rich

  • How to use HTTPSERVICE in Actionscript project.

    Hello all,
    I am doing an actionscript project, I want to use httpservice to send a data to server . Is any one knows how to use httpservice in actionscript project?
    thanx

    following code may help:
    import mx.rpc.http.HTTPService;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    private function callHTTPSERVIDE():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Server.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    //handle your result here
    private function faultHandler( event:FaultEvent ):void
    // code for fault handling.

  • Comparison of number of bytes transferred over network while using HTTPService and RemoteObjects

    If I have to transfer data(say records of 100 employees in a DB) from Server to Client, I could use HTTPService and fetch the data as an XML file and then convert it to ArrayCollection in the Client. Or use RemoteObject and transfer the data in binary. Lets ignore other methods(Web Services etc) of data transfer for the moment.
    Now, for the same data, if I implement the application using HTTPService and RemoteObject, I notice that the number of bytes transferred over the network is less in case of HTTPService(XML) when compared to RemoteObject(AMF) which is a shock to me. My understanding is that AMF transfer should be more compact than XML. Ofcourse, once the data is available, RemoteObject result processing is noticeably faster than HTTPService result processing. My concern is why data transferred using AMF is larger than XML. As an example, you may refer to the samples provided in TourDeFlex. Refer to the following:
    HTTPService:
        Found in : Flex Data Access->HTTPService->BasicExample
        Link: http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#docIndex=0;illustIndex=0;sampleId =12700
        Click on the 'Get Data' button to fetch the data.
        Bytes transferred - 1050
    RemoteObject:
        Found in : Flex Data Access->RemoteObject->BasicJavaRemoting
        Link: http://www.adobe.com/devnet-archive/flex/tourdeflex/web/#docIndex=0;illustIndex=0;sampleId =13300
        Click on the 'Get Data' button to fetch the data.
        Bytes transferred - 1440
    This is a significant size difference. You may see the data transfer size by using developer tools like the HTTPFox Firefox extension.
    Am I missing something here? Any help will be very much appreciated.
    Thanks,
    Balu

    There is definitely problem with your tool or you looked at something else. Please check the attached snapshots of the session using charles capture tool. The response sizes are way bigger than what you mentioned but remoteobjects is almost half of httpservice for the complete transfer including request and response. Check below -
    httpservice -
    http://tinypic.com/view.php?pic=2q2le2e&s=7
    amf -
    http://tinypic.com/r/10wmx4o/7

  • ISO: techniques for resolving "not a valid WDDX packet" errors

    I
    inherited (more honestly - I was drafted into maintaining) a
    large and probably not very well written web app written in
    ColdFusion. My coldfusion experience is minimal - I took a course
    back in the 4.0 days, and really didn't have much need to deal with
    it until now.
    Anyways, the inherited application, when attempting to
    display one particular record, outputs the message that the field
    being displayed "is not a valid WDDX packet". I've gone to the
    database entry for this record, dumped the contents (which is a
    couple thousand bytes of XML).
    How can I figure out what in the data is wrong, so that I can
    hack a solution into place?

    The site in question is a workflow/purchase request
    application. The applicant fills in the details, and the coldfusion
    bundles up the structure as wddx and wites it out to a database.
    Then, later, when the next person in the work flow needs to read
    the details, the database record is retrieved, the xml interpreted
    and the structure filled in, and then they can add details, provide
    approval or disapproval, update the record, and the request moves
    on to the next step in the work flow.
    Just as you suggested, my first thought was to get at the
    data in question to see if I could determine what the problem is. I
    have tried the url 'directly' - it is the only URL I have for the
    operation. All I get, as I mentioned before, is a coldfusion
    message about the data not being a valid wddx packet.
    What I need is some method of determining to what coldfusion
    is specifically objecting.

  • Parsing HTML into DOM using HTMLEditorKit

    I am trying to parse an HTML file using javax.swing.text.html.HTMLEditorKit. My limitations are that I cannot install new libraries like jtidy and I must use a .jsp file, not a servlet. I'm able to get the url and parse it using ParserCallBack, but the new handleText method will not write to the page. Further more I cannot pass anything out of this method to use later because it is void. I want to get some data back from this method or at least do something useful within it. Is that possible?
         java.net.URL url = new java.net.URL("http://" + request.getServerName() + "/" + urls.get(i));
         java.io.InputStream is = url.openStream();
         java.io.InputStreamReader isr = new java.io.InputStreamReader(is);
         java.io.BufferedReader br = new java.io.BufferedReader(isr);
       javax.swing.text.html.HTMLEditorKit.ParserCallback callback =
          new javax.swing.text.html.HTMLEditorKit.ParserCallback () {
            public void handleText(char[] data, int pos) {
                out.println(data);
        new javax.swing.text.html.parser.ParserDelegator().parse(br, callback, false);Attempting to print from within this method gives this error:
    Attempt to use a non-final variable out from a different method. From enclosing blocks, only final local variables are available.
    Maybe I need to try and write the output xml file all from inside the parserCallback?

    Those are rather stupid requirements. Okay, I can see the one about not using external libraries because nobody knows how to deal with the licences. But making you use a JSP instead of a servlet just gets in the way of writing the Java code which you could probably do perfectly well if you didn't have to cram it into a JSP scriptlet. Stupid.
    But anyway: the error message says you need a final local variable. So don't just sit there, give it a final local variable. I forget just what type "out" is supposed to be, but something like "final JSPWriter fakeOut = out", followed by using "fakeOut" rather than "out" should work.

  • Parse a string that uses nested string delimiters

    I’m looking for a way to parse a string that uses double quotes as the delimiter that contains a nested string with double quotes.  I want to keep the double quotes in the nested string.  Is there a function in Labview that I can use to easily do this?  Does Labview have a command line parser / interpreter?
    The string example is: While match "Send Test "Sleep 5" ">""
    The result string would be:  Send Test "Sleep 5" ">"

    Here is another solution which is slightly faster.  Speed won't be
    an issue unless you are running millions at a time, as in my test the
    difference was only 1-2 ms in 10000 iterations.  In this image the
    Match Pattern function retrieves the desired string, including the
    outside quotes, so the String Length and String Subset functions are
    used to remove the first and last characters of the result.
    Message Edited by tuba on 04-11-2006 10:35 PM
    Attachments:
    parse.gif ‏3 KB

  • Populate flex tree control on demand using HTTPService (Flex 3)

    First, I am sorry if the same post is already posted here but after spending 30 minutes or may be more I could not find the solution.
    By the way I have two problems. 1.) I am new to flex which I know if my own problem and soon I will handle it.
    2.) This is major problem for me. I have to populate Tree control from database and I used HTTPService to get the data from database.
    I created a object of HTTPService and on load of Tree control I am calling a function which calls the HTTP URL and returns me the first level of node for my Tree.
    When I click on any node a function is called again using HTTPService and result is appended to the currently selected node. The same goes until n level and it works fine. I was happy with my results. I am stuck in new problem. The problem is if the tree is already populated on my browser and I make some add/update/delete any node or child node, the flex doesn't make a call to HTTP URL and I am not getting updated data.
    The mxml code is below (this code has some extra things too).
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"  backgroundGradientAlphas="[1.0, 1.0]"
    backgroundGradientColors="[#000000, #868686]" >
    <mx:Script>
      <![CDATA[
       import mx.utils.StringUtil;
       import mx.rpc.http.HTTPService;
       import mx.events.ListEvent;
       import mx.binding.utils.BindingUtils;
       import mx.controls.Alert;
       import mx.rpc.events.FaultEvent;
       import mx.collections.XMLListCollection;
       import mx.utils.ObjectProxy;
       import mx.collections.ArrayCollection;
       import mx.rpc.events.ResultEvent;
       import mx.utils.ArrayUtil;
       [Bindable]
       public var datalist:XMLListCollection = new XMLListCollection();
       [Bindable]
       public var xmlFromDatabase:HTTPService=new HTTPService();
       [Bindable]
       private var xmlForChildren:HTTPService;
       private function resultHandler( event:ResultEvent ):void
           var x:XML = event.result as XML;   
           var xl:XMLList = XMLList( x );
       private function faultHandler( event:FaultEvent ):void
        Alert.show(event.message.toString());
       private function display():void
        var params:Object = {};
        params["parent"] = "0";
        xmlFromDatabase.url = "http://localhost:8080/GrailsFlex/department/tree";
        xmlFromDatabase.method = "GET";
        xmlFromDatabase.resultFormat = "e4x";
        xmlFromDatabase.useProxy = false;
        xmlFromDatabase.send(params);
        xmlFromDatabase.addEventListener(ResultEvent.RESULT,displyTree,false,0,false);
       private function displyTree(event:ResultEvent):void
        XMLtree1.dataProvider =  event.result;
        XMLtree1.labelField = "@name";
       private function getChilds(event:ListEvent):void
        try
         var xmlTree:Tree = event.currentTarget as Tree;
         var node:XML = xmlTree.selectedItem as XML
         var params:Object = {};
         params["parent"] = node.@id;
         xmlForChildren = new HTTPService();
         xmlForChildren.url = "http://localhost:8080/GrailsFlex/department/tree";
         xmlForChildren.method = "GET";
         xmlForChildren.resultFormat = "e4x";
         xmlForChildren.useProxy = false;
         xmlForChildren.send(params);
         xmlForChildren.addEventListener(ResultEvent.RESULT,appendChild,false,0,false);
         xmlForChildren.addEventListener(ListEvent.ITEM_CLICK,getChilds,false,0,false);
        catch (E:Error)
         Alert.show("getChilds Error:-- " + E.message);
       private function deleteTreeNode(xmlItem:XML):void
        var xmlParent:XML = XML(xmlItem).parent();
        if (xmlParent.@parent == null || StringUtil.trim(xmlParent.@parent) == "")
         xmlParent.@parent = "0";
        if (xmlParent.@parent != "0")
         //Recursive call until I get reach to children of root node
         deleteTreeNode(xmlParent);
        else
         // Now I am at root.
         var xmlRoot:XML = XML(xmlParent).parent();
         var bActualRoot:Boolean = false;
         if (xmlRoot == null)
          xmlRoot = xmlParent;
          bActualRoot = true;
         if (bActualRoot)
          if (xmlRoot.@parent == "0")
           try
            for each (var xl:XML in xmlParent.children())
             if (xl.@name != xmlItem.@name)
              for (var cn:int=xl.children().length()-1; cn >=0; cn--)
               delete xl.children()[cn];
           catch (ex:Error)
            Alert.show("error Real Root: " + ex.toString());
         else
          for each (var nodexm:XML in xmlRoot.children() )
           if (nodexm.@name != xmlParent.@name )
            try
             for (var cu:int=nodexm.children().length()-1; cu >=0; cu--)
              delete nodexm.children()[cu];
            catch (ex:Error)
             Alert.show("error No Real Root: " + ex.toString());
       private function appendChild(event:ResultEvent):void
        var node:XML = event.result as XML
        var sItem: XML = XMLtree1.selectedItem as XML;
        if (sItem.children().length() > 0)
         delete sItem.children();
        for(var i:int=0; i < node.children().length(); i++)
                        var item:XML = node.children()[i];
                        XMLtree1.selectedItem.appendChild(item);
                        XMLtree1.expandItem(XMLtree1.selectedItem,true,true);
        deleteTreeNode(XML(XMLtree1.selectedItem));
      ]]>
    </mx:Script>
    <mx:Tree id="XMLtree1" width="350" height="470"
          showRoot="false" creationComplete="display()" itemClick="getChilds(event)"  />
    </mx:Application>
    Thanks in advance

    Thanks buddy for the answer.
    Unfortunately the answer came after quite long time of posting the message. Anyway I was able to open a tree on demand using HttpService and due to my new requirement I changed it to RemoteObject.
    I my latest change I am able to populate tree nodes on demand and also the same solution if getting update from server via JMS using Consumer object.
    I kind a like this solution because it took me good amount of effort to find the right solution.
    If any one is intersted the he/she can reply to the post and I can provide code here or may at some location so that it can be easily downloaded.
    The solution is Flex-Grails combination.
    Thanks everybody.

  • Error when reading data in to ArrayCollection using HTTPService

    Hi,
    I am trying to read data in to ArrayCollection using HTTPService result property:
    [Bindable] private var myData:ArrayCollection=new ArrayCollection();
       private function result_handler(e:ResultEvent):void
            myData = e.result.root.contact;
      <mx:HTTPService id="post_submit"
           url="test.php"
           method="POST"
           result="result_handler(event)"
           fault="fault_handler(event)">
           <mx:request xmlns="">
           </mx:request>
       </mx:HTTPService>
    I am getting the following error when there is no "contact" record in the xml root:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Also I am getting the following error when there is only ONE  "contact" record in the xml root:
    TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@280c9ca1 to mx.collections.ArrayCollection.
    And it works fine when there is two or more "contact" records in the xml root.
    Am I missing something?
    Thanks

    I am getting the following error when there is no "contact" record in the xml root:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
         You'll be getting this error because it's trying to access nodes that don't exist;
         there are no 'contact' records, thus when it tries to access node 'root.contact', it doesn't exist, hence it's receiving NULL when it's expecting      something
    Also I am getting the following error when there is only ONE  "contact" record in the xml root:TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@280c9ca1 to mx.collections.ArrayCollection.
    And it works fine when there is two or more "contact" records in the xml root.
    Am I missing something?
    Thanks
          When there is only 1 value, it'll be returned as an object (Arrays are used for multiple items). So it throws an error as it isn't expecting a single           object, it wants an Array.
         This is also why when it returns 2+ records, there is no error. Multiple results will be returned as an Array, what your flex app was expecting.
         My initial guess to solve the first problem would be similar to Greg's, although i'm guessing you'd want;
        if(e.result != null){
         instead of
         if(e.result.root.contact != null){
        as you'd initially want to check if anything was returned in the result, rather than checking to see if a certain node exists.
         If you attempt to see if a certain node isn't null, and the node doesn't exist, it'll probably throw another #1009
         For the #1034 error, you'll have to check to see how many results were returned, as Madhav has described for you.

  • Capturing packets using NAM modules on Prime Infrastructure1.2

      Hi,
    I added or discovered all the NAM modules on my network to PI1.2. however, when i try to create a capture session i don't see my NAM modules list.  or i don't see my NAM modules as datasources. this is despite the fact that the NAM modules are added to the devices list on PI1.2. let me know how to get this working.
    Thanks,
    Kerim

    Hello Kerim,
    We recently published a Cisco Prime Infrastructure Deployment Guide on cisco.com.   There is a section on how to manage NAMs in PI 1.2, as well as how to capture and decode packets using PI 1.2.
    Hope this helps,
    Tejas

  • Sending udp packets using java and receiving it using c

    hi,
    Is it possible to send udp packets using java and receive the same using c??????? if yes.... plz help immediately.

    The biggest issue is data format. The JVM is big endian, with 16-bit characters. The machine running 'C' could be almost anything. A (signed!) byte array is probably the easiest unit of exchange.
    The Java program has its own techniques for storing/retrieving data to/from the byte array - and the C program has its own techniques. ASCII Strings are often the easiest to exchange - just convert the java String objects to byte array and send them.
    apaliwal1 has already given the UDP calls to send/receive the data.

Maybe you are looking for