Forum Stats

  • 3,872,820 Users
  • 2,266,482 Discussions


I can't make SOAP request with apex_web_service.make_request, I got "PLS-00382: expression is of wr

Geekinto Member Posts: 111 Blue Ribbon
edited Mar 7, 2019 7:09AM in APEX Discussions

Hi All,

DB: 18c Standard Edition 2 Release

Using: SQLDev 18.4

have this function pkg_file.get_xml_clob returns  XML clob.

I have SOAP URL to post this XML Clob to it.

So when i execute the next code i got this error

Error report -
ORA-06550: line 19, column 19:
PLS-00382: expression is of wrong type
ORA-06550: line 19, column 9:
PL/SQL: Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.

I need your help please,

Thanks in advance

set SERVEROUTPUT ONdeclare    l_clob      clob;    l_resp      clob;begin        l_clob := pkg_file.get_xml_clob(p_file_id =>7570);                l_clob := '<?xml version="1.0" encoding="UTF-8"?>                    <soap:Envelope xmlns:soap=""                      xmlns:xs="">                      <soap:Body>'                        || l_clob ||                      '</soap:Body>                    </soap:Envelope>';                                                l_resp := apex_web_service.make_request(p_url         => '',                                                p_envelope        => l_clob );       dbms_output.put_line(to_char(l_resp));end;

Best Answer

  • Pavel_p
    Pavel_p Member Posts: 2,314 Gold Trophy
    edited Mar 7, 2019 5:32AM Answer ✓


    unlike apex_web_service.make_rest_request (that returns clob) the function make_request returns xmltype so the l_resp must be declared accordingly. Also the function to_char is overloaded and takes various types of input parameters (number, date...) but not clob nor xmltype, so if you want to print your output, you need to pass dbms_output.put_line an appropriate input parameter datatype.

    declare  l_clob  clob := 'abcde';  l_resp  xmltype;--not clobbegin   l_clob := pkg_file.get_xml_clob(p_file_id =>7570);   l_clob := '<?xml version="1.0" encoding="UTF-8"?>                     <soap:Envelope xmlns:soap=""                       xmlns:xs="">                       <soap:Body>'  ||  l_clob  || '</soap:Body>                     </soap:Envelope>';  l_resp := apex_web_service.make_request(p_url => '',p_envelope => l_clob);  --dbms_output.put_line(to_char(l_resp) );  dbms_output.put_line(l_resp.getClobVal() );--assuming that the l_resp is less than 32kend;