Skip to main content

Hi,

Im trying to send a file in json format, destinatiion http. Im almost there but my problem is that I get the .xml extension to my file. One soluton would problably be to create xml file when transform to json, but since it is in this case easier to create the json directly using  json_object select into a clob and then send the clob as application message I want to find a way to send as filename with .json. Any suggestions?

IFS 10, Upd 16.

 

Code example:

declare 

  json_clob_  CLOB;

  message_id_ NUMBER;

  

  cursor get_attr_value is

  select json_object('partNo' is rn.part_no,

                   'partDescription' is assort_node_desc,

                   'attributes' is

                   (select json_arrayagg(json_object('attribute' is

                                                     ra.char_code,

                                                     'value' is ra.value))

                      from RETWHO_ASSORT_NODE_CHAR ra

                     where rn.assortment_node_id = ra.assortment_node_id

                       and rn.assortment_id = ra.assortment_id

                       and ra.char_code in

                           ('EPD_RESOURCE_ID',

                            'GENERIC_GWP',

                            'PRODUCT_SECURITY_SHEET',

                            'PRODUCT_DATA_SHEET',

                            'PRODUCT_DECLARATION_SHEET',

                            'ARTICLE_IMAGE_SINGLE'))

                   

                   ) as parts

  from retwho_assortment_node rn

 where part_no is not null

   and leaf_state_db = 'Active'

   AND rownum = 1;

BEGIN            

  OPEN get_attr_value ;

  FETCH get_attr_value  INTO json_clob_ ;

  close get_attr_value ;

                               

  Plsqlap_Server_API.Post_Outbound_BizAPI(

         bizapi_name_  => 'PART_INFO',  

         xml_          => json_clob_,

         sender_       => 'IFS',

         subject_      => 'Part Info Message',

         receiver_     => 'AWS',

         message_type_ => 'xx',

         message_id_   => message_id_);  

end;

 

 

 

Be the first to reply!

Reply