Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using oracle 19c database character set AR8MSWIN1256 ON WINDOWS 
and tried on another database where character set is AMERICAN_AMERICA.AL32UTF8 
I used utl_http to get a soap response but I am getting invalid characters
this is the response

XML
<pre>  ?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><xrsi:h2h-das-reply xmlns:xrsi="http://www.westernunion.com/schema/xrsi"><MTML><REPLY HOST="AUHOST" CLIENT="WUCLIENT"
    TYPE=""><DATA_CONTEXT><HEADER><ACCOUNT_NUM>AJX129993</ACCOUNT_NUM><DATA_MORE>N</DATA_MORE><DATA_NUM_RECS>56</DATA_NUM_RECS><NAME>GetStateList</NAME><FSID>WGHHJOI390T</FSID><COUNTER_ID>JOI39ARP001D</COUNTER_ID><TERM_ID>WAQt</TERM_ID></HEADER><RECORDSET><GETSTATELIST><STATE_CODE>AL</SaR?EA9????????AB{q?kJt4
    ??/Bh??Y???p????^?H?4%??p????d?mY;J?g?????w?<??@?????7?kQ???$???h+?zpS????{~*????o8/9?????p#?IK?8e?S?8?a????????+?k@???H???#???_??}U???W)????I??s^    .?"?`????M??????? ?ZsS?>?c??????[?0[?G[??4???s/%}?vi*9?$~????0?????l?d???????LFF"???????_A?F-Qs%??



this is my plsql code:
declare
url varchar2(2000):='https://wugateway2pi.westernunion.net';
body varchar2(32000):='
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xrsi="http://www.westernunion.com/schema/xrsi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:header><soapenv:body><xrsi:h2h-das-request><channel><type>H2H<name>abc
<version>141<foreign_remote_system><identifier>xyz
<reference_no>1213<counter_id>xyz
<name>GetStateList<filters><queryfilter1>en
<queryfilter2>US';
req UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
myclob clob;
buff varchar2(32767);
begin
UTL_HTTP.set_wallet('file:D:\wallet',null);
utl_http.SET_BODY_CHARSET('utf-8');
UTL_HTTP.SET_TRANSFER_TIMEOUT(120);
req:= UTL_HTTP.BEGIN_REQUEST(url, 'POST');
UTL_HTTP.SET_HEADER (req,'Content-Type','text/xml;chartset=utf-8');
UTL_HTTP.SET_HEADER (req,'Content-Length',lengthb(body));
UTL_HTTP.WRITE_TEXT (req,body);
resp:=UTL_HTTP.GET_RESPONSE(req);
-----------
DBMS_LOB.createtemporary(myclob, FALSE);
BEGIN
LOOP
UTL_HTTP.READ_TEXT(resp, buff, 1000);
dbms_output.put_line(buff);
DBMS_LOB.WRITEAPPEND(myclob, length(buff), buff);
END LOOP;
UTL_HTTP.END_RESPONSE(resp);
EXCEPTION
WHEN UTL_HTTP.END_OF_BODY THEN
UTL_HTTP.END_RESPONSE(resp);
END;
dbms_output.put_line(myclob);
DBMS_LOB.freetemporary(myclob);
end;
/


is it possible to be a matter of decryption errors because this site uses a mutual authentication
and using a private key ?

What I have tried:

I tried convert function but no success
l_text:=convert(l_text,'AR8MSWIN1256','AL32UTF8');
I tried to  set the header :
utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8');
utl_http.set_header(http_req, 'Content-Type', 'application/xml; charset=utf-8');
utl_http.set_header(http_req, 'Content-Type', 'application/soap+xml;charset=UTF-8');
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
no success
Posted
Updated 27-Oct-21 12:13pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900