Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX_WEB_SERVICE ORA-29259 end-of-input reached

melinda_fNov 16 2017 — edited Nov 22 2017

APEX 5.03 on an 11g database.  I have a database package that makes calls to a webservice using APEX_WEB_SERVICE.  I am able to perform several different types of calls successfully but when I attempt to post a file to the web service I am getting an ORA-29259 end-of-input reached error.  I am using the Content Server REST API to post a file to Content Server.  Below is the code:

function upload_file(p_parent_id in number

                       , p_filename in varchar2

                       , p_file_blob in blob) return number is

    l_clob    clob;

    v_id      number;

  begin 

    apex_web_service.g_request_headers(1).name := 'Content-Type';

    apex_web_service.g_request_headers(1).value := 'application/x-www-form-urlencoded;';

    apex_web_service.g_request_headers(2).name := 'otcsticket';

    apex_web_service.g_request_headers(2).value := g_ticket;

    l_clob := APEX_WEB_SERVICE.make_rest_request(

      p_url         => g_cs_rest_url||'/api/v1/nodes',

      p_http_method => 'POST',

      p_wallet_path => g_wallet_path,

      p_wallet_pwd  => g_wallet_password,

      p_body_blob   => p_file_blob,

      p_transfer_timeout => 10000,

      p_parm_name   => APEX_UTIL.string_to_table('type:parent_id:name'),

      p_parm_value  => APEX_UTIL.string_to_table(g_doc_type_id||':'||p_parent_id||':'||p_filename)

    );

    -- Display the whole document returned.

    dbms_output.put_line('l_clob=' || l_clob);

    apex_json.parse(l_clob);

    v_id := apex_json.get_number(p_path => 'id');

    return v_id;

  exception

    when others then

      dbms_output.put_line(UTL_HTTP.get_detailed_sqlerrm);

   

      return null;                   

  end upload_file;

I am the first in my company to use these webservices from an Oracle database so unfortunately what I am doing is beyond what any of the DBA's are familiar with and they are not able to help.  Any guidance on how to resolve this would be appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2017
Added on Nov 16 2017
5 comments
1,559 views