3

I am making a stored procedure with 2 seperate HTTP Requests. The first one to get an Atuthentication Token and the second one that uses the token.

The first Request works without a problem and I get the token back.

The second Request throws the ora-29259 end-of-input reached exception. They both look exactly the same besides of the URL:

begin
  req := utl_http.begin_request(url,'POST',utl_http.http_version_1_1);
  utl_http.set_header(req, 'Authorization', Token/Credentials);
  utl_http.set_header(req, 'Content-Type', 'application/json');
  utl_http.set_header(req, 'Content-Length', length(content));
  utl_http.write_text(req, content);

  res := utl_http.get_response(req);
    loop
      utl_http.read_text(res, buffer);
      dbms_output.put_line(buffer);
    end loop;
    utl_http.end_response(res);
      
  exception
    when utl_http.end_of_body  then
      utl_http.end_response(res);
end;

I have found this from nearly 3 years ago which suggests updating the database. I am using Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production, is this the issue? I can't find any answer to this googling myself.

The first Website uses TLS 1.2 while the second one uses TLS 1.3, is my Oracle Version too old?

3
  • The version of SQL Developer isn't relevant; what version of Oracle is the database that is making the call? Commented Jan 3, 2022 at 19:55
  • a minimal reproducible example would be helpful Commented Jan 3, 2022 at 20:39
  • @AlexPoole Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production. Sorry for providing the wrong information, I didnt know this was the relevant Version. Commented Jan 4, 2022 at 8:42

1 Answer 1

0

Please provide a sample of your code for a more detailed answer.

But looking at the link you provided, I can already see something missing in the code, which is the exception for utl_http.end_of_body.

This is an example of my code, I used somewhere else:

begin
  req := utl_http.begin_request(url,'POST',utl_http.http_version_1_1);
  utl_http.set_header(req, 'Content-Type', 'application/xml;charset=UTF-8');
  utl_http.set_header(req, 'Content-Length', length(content));
  utl_http.write_text(req, content);

  res := utl_http.get_response(req);
    loop
      utl_http.read_text(res, buffer);
      dbms_output.put_line(buffer);
    end loop;
    utl_http.end_response(res);
      
  exception
    when utl_http.end_of_body  then
      utl_http.end_response(res);
end;
Sign up to request clarification or add additional context in comments.

1 Comment

hi! My code looks exactly the same as yours except that I also have an Authorization Header. I will edit my original post to reflect that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.