Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 234 Big Data Appliance
- 1.9K Data Science
- 449.7K Databases
- 221.5K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.8K SQL & PL/SQL
- 21.2K SQL Developer
- 295.3K Development
- 17 Developer Projects
- 138 Programming Languages
- 292K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 27 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 157 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 387 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1K Español
- 1.9K Japanese
- 230 Portuguese
I can't make SOAP request with apex_web_service.make_request, I got "PLS-00382: expression is of wr

Hi All,
DB: 18c Standard Edition 2 Release 18.0.0.0.0
Using: SQLDev 18.4
have this function pkg_file.get_xml_clob returns XML clob.
I have SOAP URL http://192.168.1.83/CmcGlm/Fileinhlh.svc 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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soap:Body>' || l_clob || '</soap:Body> </soap:Envelope>'; l_resp := apex_web_service.make_request(p_url => 'http://192.168.1.83/CmcGlm/Fileinhlh.svc', p_envelope => l_clob ); dbms_output.put_line(to_char(l_resp));end;
Best Answer
-
Hi,
unlike apex_web_service.make_rest_request (that returns clob) the function make_request returns xmltype https://docs.oracle.com/database/apex-5.1/AEAPI/MAKE_REQUEST-Function.htm#AEAPI1950 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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soap:Body>' || l_clob || '</soap:Body> </soap:Envelope>'; l_resp := apex_web_service.make_request(p_url => 'http://192.168.1.83/CmcGlm/Fileinhlh.svc',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;
Regards,
Pavel
Answers
-
Hi,
unlike apex_web_service.make_rest_request (that returns clob) the function make_request returns xmltype https://docs.oracle.com/database/apex-5.1/AEAPI/MAKE_REQUEST-Function.htm#AEAPI1950 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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soap:Body>' || l_clob || '</soap:Body> </soap:Envelope>'; l_resp := apex_web_service.make_request(p_url => 'http://192.168.1.83/CmcGlm/Fileinhlh.svc',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;
Regards,
Pavel
-
Thanks a lot, Pavel