您的位置:首页 > 数据库 > Oracle

发布PL/SQL API成Webservice,并注册到IR(Oracle Integration Repositoy)中

2016-10-13 14:07 330 查看
转自:http://blog.csdn.net/pan_tian/article/details/11257993

1.创建Product Family

Product Family用于管理几个功能相近的Product(也可以立即为模块),统一管理客户化的Webservice接口

BEGIN

  -- Call the procedure

  AD_PA_INSERT_PACKAGE.INSERT_AD_PM_PRODUCT_INFO(X_PRODUCT_ABBREVIATION        => 'pc_pf',

                                                 X_PSEUDO_PRODUCT_FLAG         => 'N',

                                                 X_PRODUCT_FAMILY_FLAG         => 'Y',

                                                 X_APPLICATION_SHORT_NAME      => NULL,

                                                 X_PRODUCT_NAME                => 'Paul Custom Application Product Family',

                                                 X_PRODUCT_FAMILY_ABBREVIATION => NULL,

                                                 X_PRODUCT_FAMILY_NAME         => NULL,

                                                 X_ARU_UPDATE_DATE             => to_char(SYSDATE,'yyyy-mm-dd hh24:mi:ss'),

                                                 X_CURRDATE                    => to_char(SYSDATE,'yyyy-mm-dd hh24:mi:ss'),

                                                 X_LAST_UPDATED_BY             => -1,

                                                 X_CREATED_BY                  => -1);

  COMMIT;

END;

2.注册Product

BEGIN

  -- Call the procedure

  AD_PA_INSERT_PACKAGE.INSERT_AD_PM_PRODUCT_INFO(X_PRODUCT_ABBREVIATION        => 'cux',

                                                 X_PSEUDO_PRODUCT_FLAG         => 'N',

                                                 X_PRODUCT_FAMILY_FLAG         => 'N',

                                                 X_APPLICATION_SHORT_NAME      => 'CUX',

                                                 X_PRODUCT_NAME                => 'My Custom Application',

                                                 X_PRODUCT_FAMILY_ABBREVIATION => NULL,

                                                 X_PRODUCT_FAMILY_NAME         => NULL,

                                                 X_ARU_UPDATE_DATE             => TO_CHAR(SYSDATE,

                                                                                          'yyyy-mm-dd hh24:mi:ss'),

                                                 X_CURRDATE                    => TO_CHAR(SYSDATE,

                                                                                          'yyyy-mm-dd hh24:mi:ss'),

                                                 X_LAST_UPDATED_BY             => -1,

                                                 X_CREATED_BY                  => -1);

  COMMIT;

END;

3.关联Product:cux到Product Family:pc_pf

BEGIN

  -- Call the procedure

  AD_PA_INSERT_PACKAGE.INSERT_AD_PM_PROD_FAMILY_MAP(X_PRODUCT_ABBREVIATION        => 'cux',

                                                    X_PRODUCT_FAMILY_ABBREVIATION => 'pc_pf',

                                                    X_ARU_UPDATE_DATE             => TO_CHAR(SYSDATE,

                                                                                             'yyyy-mm-dd hh24:mi:ss'),

                                                    X_CURRDATE                    => TO_CHAR(SYSDATE,

                                                                                             'yyyy-mm-dd hh24:mi:ss'),

                                                    X_LAST_UPDATED_BY             => -1,

                                                    X_CREATED_BY                  => -1);

  COMMIT;

END;

4.增加一个BUSINESS_ENTITY的lookup code(应用开发员职责->应用产品 -> 代码->Oracle Application Object),这个Lookup会用在下一步的API中的@rep:category BUSINESS_ENTITY 



5.编写PL/SQL API Specification,这里以一个物料服务为例

CREATE OR REPLACE PACKAGE PAUL_ITEM_PKG AS

  /* $Header: $ */

  /*#

  * This package using create the item information

  * @rep:scope public

  * @rep:product CUX

  * @rep:lifecycle active

  * @rep:displayname Paul Item Maintainance Service

  * @rep:compatibility S

  * @rep:category BUSINESS_ENTITY PAUL_BUSINESS_ENTITY

  */

  /*#

  * Create an Item

  * @param p_itemno Item Number

  * @param p_itemdesc Item Descripiton

  * @param p_itemqty Item Quantity

  * @rep:scope public

  * @rep:lifecycle active

  * @rep:displayname Create Item Webservice

  */

  PROCEDURE CREATE_ITEM(P_ITEMNO   VARCHAR2,

                        P_ITEMDESC VARCHAR2,

                        P_ITEMQTY  VARCHAR2);

END PAUL_ITEM_PKG;

需要注意Package中的注释并不是随便填写的,每一个注释都会对应到Oracle Integration Repositoy接口的说明上去,对于要注册成Webservice的PL/SQL API必须按照要求来填写。注释标签具体的含义需要参考《Oracle
E-Business Suite Integrated SOA Gateway Developer's Guide》

Required Class-level Annotations

must begin with description sentence(s)

rep:scope

rep:product

rep:displayname

rep:category

Use BUSINESS_ENTITY at the class level only if all underlying methods have the same business entity. In those cases, you do not need to repeat the annotation at the method level.

rep:businessevent (if an event is raised)

Optional Class-level Annotations

link

see

rep:lifecycle

rep:compatibility

rep:ihelp

rep:metalink

rep:doccd

Required Method-level Annotations

must begin with description sentence(s)

param

Use only when applicable and when other tags such as @see and @rep:metalink do not provide parameter explanations.

return (if applicable)

rep:displayname

rep:paraminfo

rep:businessevent (if an event is raised)

Optional Method-level Annotations

link

see

rep:scope

rep:lifecycle

rep:compatibility

rep:category

Use BUSINESS_ENTITY at the method level only when a class methods have heterogeneous business entities.

rep:ihelp

rep:metalink

rep:doccd

rep:appscontext

rep:primaryinstance

6.验证PLSQL接口文件,并生成ildt文件

将编写好的PLSQL声明定义保存为.pls文件(PAUL_ITEM_PKG.pls),并将其上传到服务器应用$CUX_TOP/patch/115/sql目录下,然后执行下边的命令生成ildt文件

[plain] view
plain copy

 print?

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

  

# Interface Repository Annotation Processor, 12.0.0  

  

#  

# Generating annotation output.  

# Processing file 'PAUL_ITEM_PKG.pls'.  

# Using YAPP-based parser.  

#  Found a package-level annotation for 'PAUL_ITEM_PKG'.  

#  Found a detail-level annotation...  

# Found a procedure named 'CREATE_ITEM'.  

# Done all files.  

7.将iLDT文件上传到Oracle Integration Repositoy

[plain] view
plain copy

 print?

FNDLOAD apps/password 0 Y UPLOAD $FND_TOP/patch/115/import/wfirep.lct PAUL_ITEM_PKG_pls.ildt  

Log filename : L5750778.log  

  

  

Report filename : O5750778.out  

8.在对应的Product Family和Product下就能看到你的接口



接下来如果和其他系统集成的话,可以参见另外一篇文章

Reference:http://docs.oracle.com/cd/E18727_01/doc.121/e12065/T511473T545912.htm#5466320

https://blogs.oracle.com/integration_repository_customization/entry/integration_repository_customization
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: