Oracle调用WebService utl_http.write参数包含中文调用异常

T0virus T0virus 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
req_msg := N'<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ManualSend_07 xmlns="http://tempuri.org/">
<strMailCode>' || c_MailCode || '</strMailCode>
<strRecipients>' || c_MailTo || '</strRecipients>
<strCopyRecipients>' || c_CC || '</strCopyRecipients>
<strSubject>' || c_Subject || '</strSubject>
<strBody>' || c_Content || '</strBody>
</ManualSend_07>
</soap:Body>
</soap:Envelope>';

--2、设定要发送的服务地址
http_req := utl_http.begin_request(URL, 'POST', 'HTTP/1.1');

--3、设定要发送的服务地址
utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8');
utl_http.set_header(http_req, 'Content-Length', length(req_msg));
utl_http.set_header(http_req, 'SOAPAction', 'http://tempuri.org/ManualSend_07');

--4、放入要传送之字符串格式
utl_http.write_text(http_req, req_msg);

--5、接收Web Service回传之讯息
http_resp := utl_http.get_response(http_req);

--6、完成设定后,就可以透过Oracle内的Http_Req发送了
utl_http.read_text(http_resp, resp_msg);
utl_http.end_response(http_resp);



当参数c_Content为纯英文时,程序执行到utl_http.write_text(http_req, req_msg);会发出邮件
当参数c_Content包含中文时,程序执行到utl_http.write_text(http_req, req_msg);不会发出邮件

请大神指教是哪里的问题?
...全文
评论 3
收藏 已收藏
分享
返回顶部
T0virus
Oracle 17,133 成员 55,258 内容