简体   繁体   中英

SOA Gateway xml output when using refcursor as a parameter type

I'm trying to use a webservice in my Oracle Application. In my Pl/SQL procedure i have an out parameter of type refcursor

PROCEDURE LISTE_FOURNISSEUR (liste_fournisseurs out SYS_REFCURSOR) 

But when i call the webservice i get the response in this format

<LISTE_FOURNISSEURS>
    <Row>
        <Column name="CODE_FOURNISSEUR" sqltype="VARCHAR2">1</Column>
        <Column name="VENDOR_NAME" sqltype="VARCHAR2">IAM</Column>
        <Column name="ICE" sqltype="VARCHAR2">1</Column>
        <Column name="NIF" sqltype="VARCHAR2">1</Column>
        <Column name="RC" sqltype="VARCHAR2">1</Column>
        <Column name="ADDRESS_LINE1" sqltype="VARCHAR2">Casa</Column>
        <Column name="CODE_PORT" sqltype="NUMBER">101</Column>
        <Column name="BANK_ACCOUNT_NUM" sqltype="VARCHAR2"></Column>
    </Row>
    <Row>
        <Column name="CODE_FOURNISSEUR" sqltype="VARCHAR2">1</Column>
        <Column name="VENDOR_NAME" sqltype="VARCHAR2">IAM</Column>
        <Column name="ICE" sqltype="VARCHAR2">1</Column>
        <Column name="NIF" sqltype="VARCHAR2">1</Column>
        <Column name="RC" sqltype="VARCHAR2">1</Column>
        <Column name="ADDRESS_LINE1" sqltype="VARCHAR2">Casa</Column>
        <Column name="CODE_PORT" sqltype="NUMBER">141</Column>
        <Column name="BANK_ACCOUNT_NUM" sqltype="VARCHAR2"></Column>
    </Row>    
</LISTE_FOURNISSEURS>

But i want my result to be as the following

<LISTE_FOURNISSEURS>
    <FOURNISSEUR>
        <CODE_FOURNISSEUR>1</CODE_FOURNISSEUR>
        <VENDOR_NAME>IAM</VENDOR_NAME>
        <ICE>1</ICE>
        <NIF>1</NIF>
        <RC>1</RC>
        <CADDRESS_LINE1>Casa</CADDRESS_LINE1>
        <CODE_PORT>101</CODE_PORT>
        <BANK_ACCOUNT_NUM></BANK_ACCOUNT_NUM>
    </FOURNISSEUR>
</LISTE_FOURNISSEURS>

The issue doesn't happen when i use other output parameters (Varchar2, number,...) Is there any way to get the wanted results

I'm guessing that you're using dbms_xmlgen to generate XML. So if that's the case then use following command to change default row tag name:

dbms_xmlgen.setRowTag( ctx, 'FOURNISSEUR' );

where ctx is your context initialized something like this:

ctx := dbms_xmlgen.newcontext( ....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM