Skip to Main Content

APEX

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.make_request returns Bad Request HTML

This is on an autonomous database. I've tried several things, setting content-type on the header, with or without the action parameter, with or without the version parameter. Every iteration gives me the same error message.

Here's the code:

DECLARE 
  l_body CLOB; 
  l_response XMLTYPE; 
BEGIN 
  apex_util.set_workspace(p_workspace => 'interface'); 
  l_body := '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService"> 
  <soap:Header/> 
    <soap:Body> 
      <pub:runReport> 
        <pub:reportRequest> 
          <pub:attributeFormat>xml</pub:attributeFormat> 
          <pub:attributeLocale>en_US</pub:attributeLocale> 
          <pub:reportAbsolutePath>/Custom/OpenOrders.xdo</pub:reportAbsolutePath> 
          <pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload> 
        </pub:reportRequest> 
      </pub:runReport> 
    </soap:Body> 
  </soap:Envelope>'; 

  l_response := apex_web_service.make_request ( 
    p_url => POD||'/xmlpserver/services/ExternalReportWSSService', 
    p_envelope => l_body, 
    p_version => '1.2', 
    p_username => 'user', 
    p_password => 'password' ); 
  for i in 1.. apex_web_service.g_headers.count loop 
    dbms_output.put_line('DEBUGMSG: response header: '||apex_web_service.g_headers(i).name||': '||apex_web_service.g_headers(i).value); 
  end loop; 
  dbms_output.put_line('Response: '||l_response.getclobval()); 
END; 
/

Here is the output:

DEBUGMSG: response header: Date: Wed, 04 Sep 2024 23:00:56 GMT
DEBUGMSG: response header: Content-Type: text/html; charset=ISO-8859-1
DEBUGMSG: response header: Content-Length: 245
DEBUGMSG: response header: Connection: close
DEBUGMSG: response header: Referrer-Policy: origin
DEBUGMSG: response header: X-Content-Type-Options: nosniff
DEBUGMSG: response header: Cache-Control: no-store
DEBUGMSG: response header: Pragma: no-cache
DEBUGMSG: response header: X-ORACLE-DMS-ECID: 0068LC_YtXU0vlKMyUedMG00FE5A0002PC
DEBUGMSG: response header: X-ORACLE-DMS-RID: 0:3
DEBUGMSG: response header: Content-Security-Policy: default-src 'self' ; script-src 'self' 'unsafe-inline' 'unsafe-eval' ; style-src 'self' 'unsafe-inline' ; style-src-elem 'self'  'unsafe-inline'; img-src 'self'  data:; frame-src 'self'  data:; media-src 'none'; frame-ancestors 'self'
DEBUGMSG: response header: Vary: Accept-Encoding,User-Agent
DEBUGMSG: response header: X-XSS-Protection: 1; mode=block
DEBUGMSG: response header: Content-Language: en
DEBUGMSG: response header: Strict-Transport-Security: max-age=31536000; includeSubDomains
Response: <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>Invalid Content&#45;Type: application/soap&#43;xml&#59; charset=UTF&#45;8&#59; action=&#34;&#34;&#59;, application/soap&#43;xml&#59;charset=UTF&#45;8</PRE></BODY></HTML>


PL/SQL procedure successfully completed.

This post has been answered by Maynard with Xenemm on Sep 12 2024
Jump to Answer
Comments
Post Details
Added on Sep 4 2024
5 comments
515 views