Oracle调用WebService utl_http.write参数包含中文调用异常
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);不会发出邮件
请大神指教是哪里的问题?
<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);不会发出邮件
请大神指教是哪里的问题?
...全文
相关推荐
oracle plsql 通过utl_http调用 webservice
oracle plsql 通过utl_http调用 webservice,包括webservice服务端的源码,以及pro的客户端代码。已测试通过。
oracle 调用webservice
oracle 调用 webservice 实现
oracle传入一个字符串,调用webservice
oracle存储过程,传入一个字符串,将传入的字符调用webservice给服务器.oracle存储过程调用webservice
oracle调webservice-post.txt
附件文档以QQ在线WEBAPI接口为实例,使用Oracle自带的 UTL包以POST方式调用WEBAPI,结果正常可用。希望对想通过数据库的方式调用WEBAPI接口的同仁门有帮助。
oracle webservice实例
oracle webservice 开发实例


