使用集成SOA网关的PL / SQL中的REST

Oracle电子商务套件集成SOA网关(ISG)是一款开箱即用的模块,支持在Oracle Integration Repository中发布支持的接口类型。这些接口可以转换为SOAP和REST Web服务。请参阅metalink笔记号(文档ID 1311068.1):在版本12.2中安装Oracle电子商务套件集成SOA网关

高级配置步骤:

1)Enabling ASADMIN User with the Integration Administrator Role (ASADMIN should be active user and with complex password and should have UMX|FND_IREP_ADMIN role.)
2)Create a folder called ISG_TEMP in Oracle E-Business Suite. This folder should have write permission.
3)In the $INST_TOP\soa folder, update  ISG_TEMP_DIRECTORY_LOCATION property in the isgagent.properties file as follow:<SID>.ISG_TEMP_DIRECTORY_LOCATION=<ISG_TEMP>
4)Run the  txkISGConfigurator.xml utility with “ebsSetup” argument. The script will stop and restart the servers.
ant -f $JAVA_TOP/oracle/apps/fnd/txk/util/txkISGConfigurator.xml ebsSetup -DforceStop=yes

The following prompts appear:
•Enter the password for user APPS:
•Enter the ASADMIN user name : [ASADMIN]
•Enter the password for user ASADMIN :
•The script will forcefully stop the Oracle WebLogic Server now. Do you want to proceed (yes/no)? (yes, no)
 Enter yes to stop the server. The script will stop the server and then restart the server.

The above script creates and deploys the data source "OAEADatasource" on Oracle E-Business Suite WebLogic Admin server and 'oafm_cluster1' server. It also creates the Authentication Provider "IsgAuthenticator" to be used by the REST services and stops the Weblogic Admin Server after accepting a confirmation from the user.
Note that apart from ISG, the data source "OAEADatasource" is used by other Oracle E-Business Suite edge applications. You will have to size up the data source connection pool accordingly. If the data source "OAEADatasource" is already created, use the -DforceDataSourceExists=true option to replace the existing data source. To proceed the setup without re-creating or overwriting the data source, use the option -DignoreDataSourceExists=true.
Use the option -DforceAuthenticationProviderExists=true to re-create the Authentication Provider.
5.Execute adop phase=fs_clone on Oracle E-Business Suite 12.2 enabled for Online Patching to copy the REST configurations done above to the other file system
6.Add directory $FND_TOP/perl to environment variable PERL5LIB
7.Download patch 13602850 and install this patch for perl library extensions. Patch archive p13602850_R12_GENERIC.zip contains following directories
a) Class-MethodMaker-1.12  b) Compress-Raw-Zlib-2.009  c) Compress-Zlib-2.009
cd <<above listed directory>>
and perform - perl Makefile.PL | make |make install
repeat this step to install all 3 perl modules

使用Oracle电子商务套件集成的SOA网关脚本验证REST服务安装

Execute the following script to validate the Oracle E-Business Suite Integrated SOA Gateway setup for REST services:
For example, use the following script to deploy a PL/SQL interface FND_USER_PKG as a REST service with POST method:
ant -f $JAVA_TOP/oracle/apps/fnd/isg/ant/isgDesigner.xml -Dactions=deploy -DserviceType=REST -DirepNames=FND_USER_PKG[{TESTUSERNAME:SYNC:POST}] -Dverbose=ON -Dalias=FndUserPkgSvc

创建自定义数据库对象(PL / SQL):

  • 现在,在这一步中,我将解释如何在Integration Repository中注册自定义PL / SQL API,并创建REST Web服务。

例如:如果您将用户标识作为参数传递,以下PL / SQL程序包将返回应用程序用户名和电子邮件地址。

创建一个像这样的包规范(文件名xxfndus.pls),它应该有解析器所需的irep注释。

set verify off
whenever sqlerror exit failure rollback;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
CREATE OR REPLACE PACKAGE XXFND_USER_QUERY AS
/* $Header: xxfndus.pls $ */
/*#
* This custom PL/SQL package can be used fetch user details.
* @rep:scope public
* @rep:product FND
* @rep:displayname User Information query
* @rep:category BUSINESS_ENTITY XXFND_USER_Q
*/
 PROCEDURE main_proc(
 p_user_id      IN number
,v_name         OUT  VARCHAR2
,v_email        OUT  VARCHAR2
,v_msg          OUT  VARCHAR2
,v_status       OUT  VARCHAR2)
/*#
* Use this procedure to fetch user information
* @param P_USER_ID is the user_id of the user
* @param V_NAME Returns user name by the program
* @param V_EMAIL Returns user email by the program
* @param V_MSG Returns messages by the program
* @param V_STATUS Returns status of the Program
* @rep:displayname User Information query
* @rep:category BUSINESS_ENTITY XXFND_USER_Q
* @rep:scope public
* @rep:lifecycle active
*/
;
END XXFND_USER_QUERY;
/
commit;
exit;

现在创建一个像这样的包体(文件名xxfndub.pls),包体不需要注释。

CREATE OR REPLACE PACKAGE BODY XXFND_USER_QUERY AS
PROCEDURE main_proc
(p_user_id NUMBER
,v_name OUT          VARCHAR2
,v_email OUT         VARCHAR2
,v_msg OUT           VARCHAR2
,v_status OUT        VARCHAR2)
AS
BEGIN
SELECT USER_NAME , EMAIL_ADDRESS
INTO v_name,v_email
FROM FND_USER
WHERE user_id = p_user_id;
v_msg := 'Successfully completed';
v_status := 'S';
EXCEPTION
    WHEN OTHERS THEN
    v_msg := 'Completed with Error' ;
    v_status := 'F';
END main_proc;
END XXFND_USER_QUERY;
/

现在编译应用程序中的package spec&body

现在执行这个perl命令来进行irep解析

$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v  -username=sysadmin fnd:/patch/115/sql:xxfndus.pls:12.0=xxfndus.pls

这将生成一个名为xxfndus_pls.ildt的ildt文件。

现在执行以下FNDLOAD命令将ildt文件上传到IREP

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/wfirep.lct xxfndus_pls.ildt

  • 现在连接EBS并在Integration Repository中搜索XXFND_USER_QUERY作为内部名称。

  • 单击服务并通过单击部署按钮为此内部PL / SQL API创建REST Web服务。
  • 一旦部署REST服务,查看生成的WADL链接
  • 同时请给予应用程序用户在ISG中新注册的Web服务的授权。

现在在SOAPUI或Chrome ARC中使用以下有效负载测试webservice

web service url: http://host.domain:port/webservices/rest/xxfnd1/main_proc/

Method: Post
Http request header parameters:
Content-Type: application/json
Accept: application/json
Authorization: Basic QVNBRE1JTjpNMGdlcm11bHVr
Content-Language: en-US

Payload Json:
{
"ISGServiceFault" : {
"Code" : "ISG_SERVICE_AUTH_FAILURE",
"Message" : "User is not authorized to execute the service",
"Resolution" : "Please check whether the user has the    requisite grants.",
 "ServiceDetails" : {
 "ServiceName" : "xxfnd1",
 "OperationName" : "main_proc",
 "InstanceId" : "0"
}}}

出JSON是以下

{
"OutputParameters": {
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xmlns": "http://xmlns.oracle.com/apps/fnd/rest/xxfnd1/main_proc/",
"V_NAME": "SYSADMIN",
"V_EMAIL": {...},
"V_MSG": "Successfully completed",
"V_STATUS": "S"
}}

ISG REST Service Invocations中的常见错误有: -

策略要求身份验证令牌

原因:当安全头中的Web Service安全用户名令牌缺失或无效时,服务器将引发此错误。

解决方案:在安全性标头中传递有效的Web服务安全用户名令牌。

安全令牌无法通过身份验证或授权

原因:当Web服务安全用户名令牌中的用户名或(/和)密码无效时,服务器将引发此错误。

解决方案:在Web服务安全用户名令牌中传递有效的Oracle应用程序用户名和密码。

用户无权执行服务

原因:Web服务安全用户名令牌未授权执行在SOAP请求中调用的Web服务功能时,服务器将引发此错误。

解决方案:从Integration Repository UI在用户,角色或全局级别创建授权,以授权用户执行Web Service功能。从功能管理员职责清除缓存。

服务器故障:责任键无效

原因:在责任关键字在标题中的责任标题中传递无效时,服务器将引发此错误。

解决方案:服务器希望标题中的责任标题中包含有效的责任关键字。

使用此查询为特定用户查找有效的责任关键字: -

Select resp.RESPONSIBILITY_KEY, grp.SECURITY_GROUP_KEY,
APP.APPLICATION_SHORT_NAME
From FND_USER_RESP_GROUPS furg, FND_USER usr, fnd_responsibility_vl
resp,FND_SECURITY_GROUPS grp,FND_APPLICATION APP
where furg.user_id=usr.user_id
and furg.RESPONSIBILITY_ID=resp.RESPONSIBILITY_ID
and furg.SECURITY_GROUP_ID=grp.SECURITY_GROUP_ID
and furg.RESPONSIBILITY_APPLICATION_ID=APP.APPLICATION_ID
and usr.user_name= :username

责任申请短名称无效。

原因:服务器在报头中的RespApplication标题中的应用短名称无效时抛出此错误。

解决方案:服务器希望在Header中的RespApplication标题中使用有效的应用程序短名称。使用上面给出的查询来查找有效的应用程序短名称。

安全组密钥无效。

原因:当标题中的安全组标题中的安全组密钥无效时,服务器将引发此错误。

解决方案:服务器希望在标题中的SecurityGroup标题中使用有效的安全组密钥。使用上面给出的查询来查找有效的安全组密钥。

NLS语言无效。

原因:当标题中的NLS语言标题中的NLS语言无效时,服务器将引发此错误。

解决方法:服务器在标题中的NLSLanguage标题中预期有效的NLSLanguage值。使用以下查询来查找有效的NLSLanguage:

SELECT NLS_LANGUAGE FROM   FND_LANGUAGES  WHERE  INSTALLED_FLAG in (‘B’,’I’);

服务未部署。

原因:当调用服务生成但未部署时,服务器会抛出此错误。

解决方案:从Integration Repository UI部署此服务。

来自 <http://www.subhdb.com/2017/02/14/isg/>

使用集成SOA网关的PL / SQL中的REST的更多相关文章

  1. PL/SQL中SELECT总结

      一.SELECT 语句的各个关键词的顺序及作用简解(这个我简略点写~) 1.SELECT 2.FROM 3.WHERE 4.GROUP BY ---对结果集进行分组,通常与聚合函数一起使用 5.H ...

  2. PL/SQL中批量执行SQL脚本(不可把所有的语句都复制到New SQL Windows)

    PL/SQL中批量执行SQL脚本,不可把所有的语句都复制到New SQL Window,因为这样会导致缓冲区过大而进程卡死! 最好的办法是将要执行的SQL脚本存放到指定文件中,如C:\insert.s ...

  3. oracle PL/SQL(procedure language/SQL)程序设计(在PL/SQL中使用SQL)

    在PL/SQL程序中,允许使用的SQL语句只有DML和事务控制语句,使用DDL语句是非法的.使用SELECT语句从数据库中选取数据时,只能返回一行数据.使用COMMIT,  ROLLBACK, 和SA ...

  4. PL/SQL中LOOP循环控制语句

    在PL/SQL中可以使用LOOP语句对数据进行循环处理,利用该语句可以循环执行指定的语句序列.常用的LOOP循环语句包含3种形式:基本的LOOP.WHILE...LOOP和FOR...LOOP. LO ...

  5. PL/Sql 中创建、调试、调用存储过程

    存储过程的详细建立方法 1.先建存储过程 左边的浏览窗口选择 procedures ,会列出所有的存储过程,右击文件夹procedures单击菜单"new",弹出 template ...

  6. PL/SQL中如何执行DDL、SCL?

    PL/SQL程序中不能直接执行DDL语句.为什么? 假设我们在pl/sql程序中有这样的一条DDL语句—— drop table emp:在第一次解析pl/sql中的“drop table emp;” ...

  7. pl/sql 中F8执行单行sql

    pl/sql中设置: tools->preferences->sql window->AutoSelect statement

  8. 在PL/SQL中调用Oracle存储过程

    存储过程 1 什么是存储过程? 用于在数据库中完成特定的操作或者任务.是一个PLSQL程序块,可以永久的保存在数据库中以供其他程序调用. 2 存储过程的参数模式 存储过程的参数特性: IN类型的参数 ...

  9. 在PL/SQL中调用存储过程--oracle

    在oracle10中写好了存储过程,代码如下: CREATE OR REPLACE Procedure Proc_Insert ( sName in varchar2, sAge in int, sE ...

随机推荐

  1. mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg

    mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonagg ...

  2. yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut

    # yum install -y epel-release Loaded plugins: fastestmirror Repository base is listed more than once ...

  3. Vmware中Linux或macOS客户端如何回收硬盘空间

    Vmware对于Windows的客户端,使用GUI操作硬盘回收和整理磁盘即可.对于Linux或macOS客户端,需要在安装Vmware Tools之后,在客户端OS的终端Terminal里输入命令进行 ...

  4. centos7切换启动内核

    1.查看当前系统内核 uname -r 3.18.6-2.el7.centos.x86_64 查看可使用的内核列表 awk -F\' '$1=="menuentry " {prin ...

  5. poj2679

    题意:给出一个有向图,每条边有两个属性:一个长度一个费用.费用可能是负数.长度一定是非负的.给出一个起点和一个终点,现要求,从起点走到终点,且从每个点走出时选择的那条边必须是以该点作为起点的边中费用最 ...

  6. [原创]win7环境下搭建eclipse+python+django开发环境

    一)工具下载 a)eclipse(最新版4.3.1)官网下载地址 http://www.eclipse.org/downloads/ b)python (2.X版本)官网下载地址 http://pyt ...

  7. LeetCode(10):正则表达式匹配

    Hard! 题目描述: 给定一个字符串 (s) 和一个字符模式 (p).实现支持 '.' 和 '*' 的正则表达式匹配. '.' 匹配任意单个字符. '*' 匹配零个或多个前面的元素. 匹配应该覆盖整 ...

  8. .NetCore下 Exceptionless 分布式日志的个性化处理

    Event Type 在Exceptionless中有 Exception .LogMessage.Broken Links .Feature Usages 接下来就这几种类型分别添加日志记录 Exc ...

  9. 【Atcoder】ARC102 题解

    C - Triangular Relationship 题解 枚举一个数%K的值然后统计另两个 代码 #include <bits/stdc++.h> #define enter putc ...

  10. 【LOJ】#2178. 「BJOI2017」机动训练

    题解 遇见平方和就转有序对呗 dp类似从很多点出发每次走一步的转移方式 然后我too naive的,枚举路径长度来决定更新次数,愉快TLE 改成记搜就过了 代码 #include <bits/s ...