从 Oracle (10g) 存储过程调用 Web 服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1390787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:57:00  来源:igfitidea点击:

Calling a web service from Oracle (10g) stored procedure

javaoracleweb-servicesstored-procedurescxf

提问by FoxyBOA

Can anybody point me out on working example of calling web service (e.g. CXFbased) from Oracle 10g stored procedure.

任何人都可以指出我从 Oracle 10g 存储过程调用 Web 服务(例如基于CXF)的工作示例。

采纳答案by Jostein Stuhaug

You can do this by using the utl_http package in plsql.

您可以通过使用 plsql 中的 utl_http 包来做到这一点。

I don't have a self made example ready, but would recommend you have a look at the oracle documentation for utl_http.

我没有准备好自制示例,但建议您查看 utl_http 的 oracle 文档。

A quick google search for "oracle plsql web service utl_http", also showed some examples on the top results, for instance this one: rapid plsql web service client development using soapui and utl_http.

在谷歌上快速搜索“oracle plsql web service utl_http”,还显示了顶部结果的一些示例,例如这个:使用 soapui 和 utl_http 进行快速 plsql web 服务客户端开发

As long as the database server has network access to the webservice server you can use it.

只要数据库服务器可以通过网络访问 webservice 服务器,您就可以使用它。

回答by Jim Hudson

One issue you may run into: if the service requires SSL, then you'll need to have a certificate available to the database. That generally means having the Advanced Security option and using Oracle Wallet. For http communications, though, utl_http (and its simpler form, utl_dbws -- database web services -- work pretty well. Marco Gralike's bloghas a good HOW TO on consuming web services in PL/SQL.

您可能会遇到的一个问题是:如果服务需要 SSL,那么您需要有一个可用于数据库的证书。这通常意味着拥有高级安全选项并使用 Oracle Wallet。但是,对于 http 通信,utl_http(及其更简单的形式 utl_dbws——数据库 Web 服务——工作得很好。Marco Gralike 的博客有一个关于在 PL/SQL 中使用 Web 服务的好方法。