- 浏览: 681253 次
- 性别:
- 来自: 中山
文章分类
最新评论
-
wuhuizhong:
jFinal支持Rest风格吗?可以想spring mvc那样 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
在jfinal中应如何获取前端ajax提交的Json数据?ht ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
jfinal如何处理json请求的数据:问题: 在某些api接 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
Ubuntu14.04 安装 Oracle 11g R2 Ex ...
Oracle 11g release 2 XE on Ubuntu 14.04 -
alanljj:
这个很实用,已成功更新,谢过了!
odoo薪酬管理模块l10n_cn_hr_payroll
Last day, a mission is given to me about calling a web services by pl/sql. Firstly, i started to search ; “What is a web service?” The term Web services describes a standardized way of integrating Web-basedapplications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. Actually we can summarize it; Web Services can convert your applications into Web-applications. Web Services can be used by other applications. The basic Web Services platform is XML + HTTP. We have some input parameters and make a request. Then, we get a response from it with output parameters. All this syntax is in XML format. So, we will use XMLtype in our pl/sql package. Let’s start to write a soap access package or we can use this package (www.oracle-base.com/dba/miscellaneous/soap_api.sql) Let’s assume we have a function “myFunction” in this page http://www.mywebservice.com/web Then,start to write our code CREATE OR REPLACE PACKAGE pkg_my_webservice IS FUNCTION call_myfuntion ( vp_parameter1 VARCHAR2, vp_parameter2 VARCHAR2 ) RETURN VARCHAR2; END pkg_my_webservice; / CREATE OR REPLACE PACKAGE BODY pkg_my_webservice IS vg_funciton_fnc VARCHAR2(256) := 'myFunction'; vg_ws_address VARCHAR2(255) := 'http://www.mywebservice.com/web'; FUNCTION call_myfuntion( --lets assume that it inputs two parameters called string1, string2 vp_parameter1 VARCHAR2, vp_parameter2 VARCHAR2) RETURN VARCHAR2 AS ol_req soap_api.t_request; ol_resp soap_api.t_response; BEGIN -- we initilize a new request ol_req := soap_api.new_request(vg_funciton_fnc, 'xmlns="' || vg_ws_address || '"'); -- we started to add parameters soap_api.add_parameter(ol_req, 'string1', 'partns:string', vp_parameter1); soap_api.add_parameter(ol_req, 'string2', 'partns:string', vp_parameter1); -- we call the web service ol_resp := soap_api.invoke(ol_req, vg_ws_address, vg_funciton_fnc); -- we get back the results RETURN soap_api.get_return_value(ol_resp, 'result', -- result tag name 'xmlns:m="' || --can be change as "xmlns:n1" vg_ws_address || '"'); END call_myfuntion; END pkg_my_webservice; / You may need to change some tag attributes. The main basic function syntax is like this. If you have more than one return xml tags, then you need to call the There are also other ways to do this. You may also use oracle’s “utl_dbws” package, however “utl_http” is more faster than it. You can test it. In my next post, i am gonna explain soap_api package in more details. http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10802/u_dbws.htm
Tom Krueger has an excellent write up on this:
I would like to say that calling a web service has been made easy with Sys.UTL_DBWS package but it took me a bit of time to get it right. This biggest issue that I ran into is that the samples that I found online and in the forums simply don’t work.
The sample below was provided by Oracle support and helped a lot in getting started so I thought that I would pass it along. The sample uses a public web service so if the service is still running this code should just work for you. My ultimate goal was to call a Microsoft WCF service which I have been able to do and plan to post the code soon.
function get_joke
return varchar2
is
service_ sys.utl_dbws.SERVICE;
call_ sys.utl_dbws.CALL;
service_qname sys.utl_dbws.QNAME;
port_qname sys.utl_dbws.QNAME;
xoperation_qname sys.utl_dbws.QNAME;
xstring_type_qname sys.utl_dbws.QNAME;
response sys.xmltype;
request sys.xmltype;
begin
service_qname := sys.utl_dbws.to_qname(null, 'getJoke');
service_ := sys.utl_dbws.create_service(service_qname);
call_ := sys.utl_dbws.create_call(service_);
sys.utl_dbws.set_target_endpoint_address(call_, 'http://interpressfact.net/webservices/getjoke.asmx');
sys.utl_dbws.set_property( call_, 'SOAPACTION_USE', 'TRUE');
sys.utl_dbws.set_property( call_, 'SOAPACTION_URI', 'http://interpressfact.net/webservices/getJoke');
sys.utl_dbws.set_property( call_, 'OPERATION_STYLE', 'document');
request := sys.xmltype(
'<getJoke xmlns="http://interpressfact.net/webservices/">'
|| '<Category>Excuses-10</Category>'
|| '</getJoke>');
response :=sys. utl_dbws.invoke(call_, request);
return response.extract('//getJokeResult/child::text()',
'xmlns="http://interpressfact.net/webservices/"').getstringval();
end;
http://tomkrueger.wordpress.com/2008/09/17/how-to-call-a-web-service-from-oracle-plsql/
Also, there's another page that gives a good explanation of doing this:
By using Web services, your application can publish its function or message to the rest of the world.
With Web services your accounting department’s Win 2k servers can connect with your IT supplier’s UNIX server.
Web services uses XML to code and decode your data and SOAP to transport it.get_return_value
function as much as result attributes. You may also store the results in a pl/sql type and return it back.
发表评论
-
用函数unistr将Oracle数据库中的Unicode转换为中文
2016-07-19 11:51 7918例子: DECLARE V_EXT_DES V ... -
ORACLE APPLICATION EXPRESS 5.0 升级
2016-05-12 11:43 580Oracle11GR2 XE 缺省是安装了oracle ap ... -
Oracle ACL(Access Control List)
2016-05-12 11:36 889在oralce 11g中假如你想获取server的ip或者h ... -
了解systemstate dump
2016-04-26 14:09 487当数据库出现严重的性能问题或者hang了的时候,我们非常需要 ... -
通过ORACLE的UTL_HTTP工具包发送包含POST参数的请求
2016-03-18 16:25 5152DECLARE req utl_http. ... -
Shell: extract more from listener.log(分析监听日志)
2016-03-16 14:57 1148统计一天内每小时的session请求数 # fgrep ... -
ORA-01031: insufficient privileges 问题解决笔记
2016-02-01 15:53 1187A) File $Oracle_HOME/network/a ... -
listener.log中报Warning: Subscription For Node Down Event Still Pending问题的解决方法
2016-01-07 16:34 1634一套Oracle 10.2.0.1 for aix的数据库环 ... -
Oracle触发器和MySQL触发器之间的区别
2015-11-19 12:55 670Oracle触发器格式: CREATE [OR RE ... -
查询正在执行的存储过程
2015-11-13 09:27 20501、找正在执行的PROCEDURE的 sid ,serial# ... -
undo表空间损坏的处理过程
2015-10-14 13:49 1219磁碟陣列故障,分區/rman上包括undo和archivel ... -
登录oracle资料库时很久无反应的问题处理一例
2015-10-11 10:56 993原因是系统存在僵死的进程,促使session处于激活状态.首 ... -
TNS-12560问题解决
2015-10-01 19:52 613tnsping远程主机实例出现TNS-12560: TNS ... -
查看undo中sql语句的占用情况
2015-08-06 17:18 1764查看undo中sql语句的占用情况 select * ... -
Install Open System Architect And ODBC Instant Client
2015-05-21 14:03 749How to Install Open System Arc ... -
恢复oracle中用pl sql误删除drop掉的表
2015-04-03 16:12 553查看回收站中表 select object_name,or ... -
在Oracle Linux 6.6上安装Oracle 10gR2
2015-01-15 15:36 2681查看硬體配置 # df -h Filesystem ... -
kill
2015-01-03 11:36 457--根据某一对象查询进程 col owner fo ... -
Oracle 数据库Storage存储迁移笔记
2014-12-27 11:08 9861.确认数据文件、控制文件、临时文件、日志文件 位置 / ... -
異地備份資料庫的開啟步驟
2014-11-19 14:03 487使用EMC設備執行異地備份, 資料庫的複製是開啟的狀態下, ...
相关推荐
1.Download Axis2 as WAR and...7. Start your servlet container and test the standard version service by calling this url: http://localhost:8080/axis2/services/Version/getVersion?response=application/json
描述 "Calling .NET Web Services from PB11.5" 提到的核心概念是,用户将学习如何在PowerBuilder中创建和消费.NET Web服务。这通常涉及到以下步骤: 1. **添加Web引用**:在PB中,开发者需要通过“项目”菜单选择...
SOAP(Simple Object Access Protocol)和JSON(JavaScript Object Notation)是两种常见的数据交换格式,常用于Web服务通信。本文将详细介绍如何使用JavaScript通过POST方法调用SOAP和JSON Web服务。 首先,让我们...
You'll learn how to automate your infrastructure by programmatically calling the AWS API to control every part of AWS. Next, you'll learn options and techniques for storing your data. You'll also ...
标题中的"Python库 | joint-calling-0.1.88.tar.gz"表明这是一个与Python相关的库,且版本号为0.1.88,它被打包成一个tar.gz文件。这种格式通常用于在Unix/Linux环境中分发软件,因为它可以进行文件压缩并合并多个...
int __cdecl add(int a, int b); ``` 调用示例: ```c++ int result = add(5, 10); ``` 在这个例子中,参数 `10` 和 `5` 将按照从右到左的顺序被压入栈中,然后调用者需要清理栈。 #### Naked Function Calls ...
《ARASHI calling》是日本流行音乐团体ARASHI的一首歌曲,歌词中充满了积极向上的力量和对生命的执着追求。这首歌的主题围绕着把握现在、永不放弃和自我信念展开。 歌词中的“Calling”象征着呼唤,可能是对生活、...
WebAssembly is a new, revolutionary technology that allows developers to program webpages using popular high-level languages like C, C++, Rust, and Python. Code is then compiled to WebAssembly ...
Microsoft Teams Calling Solutions 知识点 Microsoft Teams Calling Solutions 是微软公司的一项电话解决方案,旨在帮助企业和中小型企业(SMB)提高通信效率,降低成本。根据 Forrester 的研究报告,本解决方案...
本篇将详细探讨一个名为"Smoking_calling_train.zip"的数据集,它是一个专门用于训练AI模型,识别人们在吸烟时打电话这一复杂行为的宝贵资源。通过对这个数据集的理解和分析,我们可以更深入地了解AI在图像识别和...
3. **将学生选课成绩从百分制改为等级制**:存储过程需能接收百分制成绩,根据设定的等级标准(如90-100为A,80-89为B等)返回相应的等级。这涉及到条件逻辑和字符串处理。 **实验要求** 学生需要按时完成实验内容...
SAP.Middleware.Connector.RfcCommunicationException:“destination XXXX failed when calling RFC_METADATA_GET -- see log for details” 猜测的原因: 老的DLL库在获取接口实例时,会触发“RFC_METADATA_GET”...
ARM SMC调用规范文档(ARMDEN0028A)提供了关于如何正确使用SMC的详细指导。 #### 目的 - **确保安全通信**:通过定义标准化的调用约定,保证安全模式和非安全模式之间的交互安全可靠。 - **简化开发流程**:为...
该文档描述了常见C++开发平台的调用约定,涉及到16位、32位、64位的程序开发,跨越Windows、Linux、BSD、Mac(基于Intel处理器)等操作系统,包含众多常用的编译器,同时文档也比较新,甚至谈论了AVX-512指令集。
本文将基于Heng Li等人发表的文章《一种统计框架用于基于测序数据的SNP调用、突变发现、关联映射及种群遗传参数估计》(A statistical framework for SNP calling, mutation discovery, association mapping and ...
cad web预览 工具 加载的方法需写在$(document).ready(function(){}) 中 加载转换的图纸文件 图纸文件是四个SVG/JS 文件,由 AutoXchange转换生成 下载地址:...
**1.8 使用参数调用Web Dynpro应用(Calling a Web Dynpro Application Using Parameters)** 通过在URL中添加特定的参数,可以控制应用程序启动时的状态或行为。 #### 二、跨组件编程(Cross-Component Programming) ...
【app-app-calling-android-master源码】是一个针对Android平台的应用程序源码库,它提供了实现应用程序间通信(App-to-App Calling)的功能。这个源码项目对于开发者来说是一份宝贵的资源,可以帮助他们深入理解...
Compound DML triggers allow multiple actions to be triggered by a single DML statement, such as INSERT, UPDATE, or DELETE. This feature simplifies the development of trigger-based business logic, ...
基于GATK3.3以上版本的HaplotypeCaller标准流程进行,测试脚本以sra文件为最初输入,将读取文件见内的所有sra文件(视为同一个样本的数据),进行SNP Calling产生GVCF,然后用户可自行进行jointCall