Ebs [] EBS12.2.7 REST ISG configuration

1 ISG settings - basic settings

  1. Activate ASADMIN users:

a) to SYSADMIN user login EBS, enter the user management responsibilities.

b) enter the user menu, search ASADMIN user.

c) Click the Update button, enter the user interface update.

 

d) Empty effectively to the contents of the field, and click Save .

 

e) Click the Reset Password button, enter the new password and save the user status changes activation state.

The above steps Security> System Administrator responsibilities under the user FORM interface can operate, similar methods of operation .

Note: to complete the ISG After configuration, do not modify ASADMIN user password, or still need to be reconfigured.

  1. 2.      distribution Integration Administrator role:

a) Click on the allocation of responsibilities button, select the LOV search window, select the code and enter: UMX | FND_IREP_ADMIN

 

b) Check the check box, and click the select button.

c) the proof random typing field, click on the application .

2 ISG REST services configuration

  1. Configuration ISG_TEMP directory

  Create a folder on the EBS application server, for example:

mkdir $CUX_TOP/soa/

This folder as <ISG_TEMP>

Note : If you are a multi-node , then the folder needs to be a shared folder.

2. Modify $ INST_TOP / soa / isgagent.properties file

<SID> = .ISG_TEMP_DIRECTORY_LOCATION <ISG_TEMP>


Modify $ INST_TOP / soa / folder attributes isgagent.properties of ISG_TEMP_DIRECTORY_LOCATION

<SID> = File .ISG_LOGGER

<SID>.ISG_GLOBAL_LOG=true


At the same time need to add two properties to open the log function of ISG

After modifying the above configuration, log file generated after restart oafm and oacore server generates the configuration of <ISG_TEMP> folder.

 

Note: The multi-node case, we need to update the file on each node

  1. Execution txkISGConfigurator.xml

    Ant -f $ JAVA_TOP / oracle / apps / fnd / txk / util / txkISGConfigurator.xml ebsSetup -DforceStop = yes

    source /u01/install/VISION/EBSaps.env RUN

l Load environment variables

source <EBS_INSTALL_BASE>/EBSapps.env RUN

 

l run txkISGConfigurator.xml tool

Ant -f $ JAVA_TOP / oracle / apps / fnd / txk / util / txkISGConfigurator.xml ebsSetup -DforceStop = yes

 

During the execution of the script need to provide the following information:

  • Enter the password for user APPS:

       Enter the user's password APPS.

  • Enter the ASADMIN user name : [ASADMIN]
  • Enter the password for user ASADMIN :

       Enter the user's password ASADMIN

  • The script will forcefully stop the Oracle WebLogic Server now. Do you want to proceed (yes/no)? (yes, no)

       Enter yes to restart the service.

The results show

 

 

 

        Generating Authentication Provider

 

 

 

 

note:

        The above script creates a "OAEADatasource" of data source, and deploying to the WebLogic Admin Server and EBS 'oafm_cluster1' server. But also create a REST Authentication Provider services used "IsgAuthenticator", the final restart weblogic admin server.

        If OAEADatasource has been created over the script to increase the parameter "-DforceDataSourceExists = true" to replace the existing data source. Use "-DforceAuthenticationProviderExists = true" to re-create the Authentication Provider.

The above steps can be performed as long as the master node

3 Verify the configuration -ISG REST Services

This section describes the configuration to verify the ISG released REST Webservice reception by the user interface and back-end script way.

3.1 front interface verification

  1. ASADMIN user login to EBS, the other contains an integrated administratorUser roles can be.
  2. Into the integrated repository responsibilities integrated information library function, click on the search button;
  3. In the internal name field, enter ' FND_USER_PKG' and click on the start button to perform the search;
  4. Click User link, interface details display;

         

  1. Click REST Web Service tab and enter at the contents:

Service Alias: alias specified services [will be displayed inside the service URI, so take a relatively connotation, such as: FndUserPkgSrv];

a) Service Operations in the table inside, a method for selecting at least REST service operation in a manner exposed.

  1. Click the deployment button to deploy the REST service, if deployed correctly, REST Service Status field displays have been deployed .

 

 

 

  1. Click Cancel to deploy button to cancel the service deployed, Rest Service Status field displays Not the Deployed .

 

3.2 Background verification script

For example, we want a PL / SQL type of interface  FND_USER_PK G (and exposed TESTUSERNAME this method) deployed as REST Service, then we can re-application on the server performs the following script:

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

 If this operation is successful deployment, which represents our configuration is correct.

 

 

The interface to see whether the configuration method

 

 

 

4 client interfaces - Configuration

 

4.1 Overview

Oracle EBS ISG supports custom interface development and can be published to Oracle Integation Repository. Support customized development interface types: XML Gateway Map, Business Event, PL / SQL, Concurrent Program, Business Service Object, Java APIs, Java Bean Services and BPEL Composite Service.

 

 

 

Customized development ISG web service process:

  1. According to Integration Repository annotation standard to customized API to add comments;
  2. IREP Parser perform annotation tools to verify the good document file generated Integration Repository loader (iLDT);
  3. ILDT upload files to Oracle Integration Repository;
  4. Integration Repository duties view customized interfaces for more information;
  5. Create a security authorization for the relevant method interfaces;
  6. Generating a web services;
  7. Deploy web services;

                             Note the different deployment in SOAP and REST two service modes in the figure below.

  

 

4.2  配置Integration Repository Parser(IREP Parser)

IREP parser is an independent design integration administrator to add custom interfaces to comment in accordance with standard annotation validation tool, generate iLDT file after verification is complete, the file is uploaded to the integrated library information, and then used to generate the service, publishing service.

1. Install Perl Module

a) establish operational environment by running a file system APPL_TOP EBSapps.env script.

b) positioning Perl configuration file and backup this file Config.pm

cd $FMW_HOME/webtier/perl/lib/5.10.0/x86_64-linux-thread-multi

cp Config.pm Config.pm_bak20200320

c) modify the file Config.pm

<FMW_HOME> is the absolute path of $ FMW_HOME.

archlibexp =>relocate_inc('<FMW_HOME>/webtier/perl/lib/5.10.0/sun4-solaris-thread-multi-64')

privlibexp =>relocate_inc('<FMW_HOME>/webtier/perl/lib/5.10.0')

sitearchexp =>relocate_inc('<FMW_HOME>/webtier/perl/lib/site_perl/5.10.0/sun4-solaris-thread-multi-64')

sitelibexp =>relocate_inc('<FMW_HOME>/webtier/perl/lib/site_perl/5.10.0')

 

 

 d) Create a Perl installation directory

mkdir $APPL_TOP_NE/perl

chmod 755 $APPL_TOP_NE/perl

e) Set the following environment variables environment APPL_TOP

export PERL5LIB=$FND_TOP/perl:$APPL_TOP_NE/perl:$PERL5LIB

export LIBPATH=$LIBPATH:$FMW_HOME/webtier/lib

export ORACLE_HOME=$FMW_HOME/webtier

LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:$LD_LIBRARY_PATH

export JAVA_HOME=/prod/EBS122/fs1/FMW_Home/jdk

Here JAVA_HOME can be obtained by run which java

f) Download the patch 13602850 (p13602850_R12_GENERIC.zip) and upload, extract

Patch 13602850 contains the following Perl modules:

Compress-Raw-Zlib-2.009

Compress-Zlib-2.009

Class-MethodMaker-1.12

Perl modules installed above order

Installation command:

cd $APPL_TOP_NE/perl

cp -r /temp/Compress-Raw-Zlib-2.009

cd Compress-Raw-Zlib-2.009

perl Makefile.PL

make

make install

2. Verify

If the above step is correct, execute the following script:

$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl

               If the result is the following message it means our success Integration Repository Parser Configuration:

 

 

 

4.3 registered customers products

  1. Create a custom prodcut family

    BEGIN

      -- create the custom product family

      ad_pa_insert_package.insert_ad_pm_product_info(x_product_abbreviation        => 'cux_pf'

                                                    ,x_pseudo_product_flag         => 'N'

                                                    ,x_product_family_flag         => 'Y'

                                                    ,x_application_short_name      => NULL

                                                    ,x_product_name                => 'CUX Product Family'

                                                    ,x_product_family_abbreviation => NULL

                                                    ,x_product_family_name         => NULL

                                                    ,x_aru_update_date             => to_char(SYSDATE,'YYYY-MM-DD')

                                                    ,x_currdate                    => to_char(SYSDATE,'YYYY-MM-DD')                                 ,x_last_updated_by             => -1

                                                    ,x_created_by                  => -1);

      COMMIT;

    END;

     



  1. Create a custom product

BEGIN

  -- create the custom product

  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                => 'CUX Product'

                                                ,x_product_family_abbreviation => NULL

                                                ,x_product_family_name         => NULL

                                                ,x_aru_update_date             => to_char(SYSDATE,'YYYY-MM-DD')

                                                ,x_currdate                    => to_char(SYSDATE,'YYYY-MM-DD')

                                                ,x_last_updated_by             => -1

                                                ,x_created_by                  => -1);

  COMMIT;

END;


  1. 创建family与product的联系

    BEGIN

      -- create the relationship between family and product

      ad_pa_insert_package.insert_ad_pm_prod_family_map(x_product_abbreviation        => 'cux'

                                                       ,x_product_family_abbreviation => 'cux_pf'

                                                       ,x_aru_update_date             => to_char(SYSDATE,'YYYY-MM-DD')

                                                       ,x_currdate                    => to_char(SYSDATE,'YYYY-MM-DD')                                                   ,x_last_updated_by             => -1

                                                       ,x_created_by                  => -1);

      COMMIT;

    END;



  1. 增加客户化BUSINESS_ENTITY:
    在LOOKUP_TYPE=BUSINESS_ENTITY中增加一个CODE:CUX_SERVICE

 

 

 

 

4.4 编写并注释PL/SQL接口代码(服务端代码)

CREATE OR REPLACE PACKAGE cux_fnd_ws_test_pkg AS

  /* $Header: cux_fnd_ws_test_pkg.pls 12.0.1 $ */

  /*#

  * This package using provide import po receive service

  * @rep:scope public

  * @rep:product cux

  * @rep:lifecycle active

  * @rep:displayname   cux_fnd_ws_test_pkg

  * @rep:compatibility S

  * @rep:category BUSINESS_ENTITY CUX_SERVICE

  */

  /*===============================================================

         Copyright (C) xxx Co., Ltd.   All Rights Reserved

  ===============================================================*/

 

  /*===================================================================

  --  Program Name  : cux_fnd_ws_test_pkg

  --  Purpose       : webservice测试包

  --  Reference     :

  --  Scope         :

  --*******************************************************************

  --  Date         Version      Author           Description

  --  2020-03-26   1.00         lingchao.sun     Initial Version

  ===================================================================*/

  --===================================================================

  --Procedure Name  : process

  --Description     : 处理流程

  --Note            :

  --Parameters      : p_id    : id 

  --                  p_name : name

  --                  p_age :age

  --                  p_birth_date :birth_date

  --                  esb_flag : ESB标识

  --                  esb_return_code : ESB返回代码

  --                  esb_return_message : 系统返回消息

  --History         : 1.00 2020-03-26 lingchao.sun Creation

  --====================================================================

  /*#

  * process

  * @param p_id  id

  * @param p_name  name

  * @param p_age  age

  * @param p_birth_date  birth_date

  * @param esb_flag esb flag

  * @param esb_return_code esb return code

  * @param esb_return_message esb return message

  * @rep:scope public

  * @rep:lifecycle active

  * @rep:displayname process

  */

  PROCEDURE process(p_id               IN VARCHAR2,

                    p_name             IN VARCHAR2,

                    p_age              IN NUMBER,

                    p_birth_date       IN VARCHAR2,

                    esb_flag           OUT VARCHAR2,

                    esb_return_code    OUT VARCHAR2,

                    esb_return_message OUT VARCHAR2);

END cux_fnd_ws_test_pkg;



 

4.5  解析、上传

  1. 上传cux_fnd_ws_test_pkg.pls文件至’$CUX_TOP/soa/’目录下;
  2. 进入目录’ $CUX_TOP/ soa/’;
  3. 运行irep_parser.pl工具来解析并验证pls文件是否声明正确:

命令的格式如下:

$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v -username=<a fnd username> <product>:<relative path from product top>:<fileName>:<version>=<Complete File Path, if not in currect directory>

  本例中实际执行如下命令:

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

结果如下(看到‘Done all files’表示验证成功):

 

 

 

成功后,会在当前目录下生成一个ildt文件:cux_fnd_ws_test_pkg_pls.ildt

 

 

 

 

 

  1. 上传cux_fnd_ws_test_pkg_pls.ildt至Integration Repository;

执行upload命令上传iLDT文件,命令格式如下

$FND_TOP/bin/FNDLOAD <APPS username>/<ORACLE Password> 0 Y UPLOAD $fnd/patch/115/import/wfirep.lct <ildt file>

 

 

 UPLOAD脚本执行完成后,检查当前目录下的log文件,看到“Concurrent request completed successfully”表示上传成功:

 

 

 

 

4.6  授权、部署

4.6.1        授权

创建授权即对接口中的methods的执行权限分配给某一个特定的用户/用户组/所有用户,以保证服务的访问安全性;在授权 TAB页,勾选要创建授权的method,点击创建授权;反之撤销授权则是回收权限。

 

 

 

4.6.2        部署

 

l  进入REST Web 服务 TAB页;

l  勾选需要部署的methods;

l  在服务别名处填写服务别名;

l  点击部署按钮;

 

 

 

部署成功之后,REST 服务状态变为已部署,同时出现查看WADL取消部署按钮

 

 

 

同时服务器上<ISG_TEMP>目录中也会生成REST文件夹

 

 

 

 

4.7  版本升级

当我们更改了包头中的参数时,需要重新发布服务做版本升级。

需要注意的是:生成iLDT文件的IREP命令版本号要升版,同时需要清除高速缓存、重启OAFM

l   $ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh stop oafm_server1

l   $ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh start oafm_server1

 

 

 

5      客户化接口服务-客户端调用

 

5.1  通过WADL获取请求报文的程序包

 

 

DECLARE

  x_request     VARCHAR2(32767);

  l_url         VARCHAR2(1000);

  l_method_code VARCHAR2(100);

  l_mode_type   VARCHAR2(30);

  l_length      NUMBER;

BEGIN

  l_url         := 'http://cheng.erptest.com:8000/webservices/rest/CuxWsTestSrv?WADL';

  l_method_code := 'process';--method方法

  l_mode_type   := 'XML';--XML/JSON

  cux_fnd_isg122_utl.get_model(p_wadl_url       => l_url,

                               p_method_code    => l_method_code,

                               p_model_type     => l_mode_type,

                               x_req_model_data => x_request);

  SELECT lengthb(x_request)

    INTO l_length

    FROM dual;

  --dbms_output.put_line(l_length);

  --dbms_output.put_line(substr(x_request, 1, 500));

  --dbms_output.put_line(substr(x_request, 501, 1000));

  --dbms_output.put_line(substr(x_request, 1000, l_length));

END;


 

5.2  调用REST Service – Soap UI

6.1.1 方式1:XML

  1.  新建WADL项目

 

 

 

 

  1. 获取服务的WADL,并导入WADL

输入请求编码:UTF-8

输入方法授权的用户名和密码

指定报文的格式为XML或者JSON

输入请求报文

 

 

 

  1. 发送报文获取相应报文

XML类型报文

 

 

JSON类型报文

 

 

 

 

5.3  调用REST Service – PLSQL

6.2.1 方式1:XML

 REQUEST:

DECLARE

  l_url      VARCHAR2(100) := 'http://cheng.erptest.com:8000/webservices/rest/CuxWsTestSrv/process/';

  l_request  utl_http.req;

  l_response utl_http.resp;

 

  l_req_data VARCHAR2(32767) := '<?xml version="1.0" encoding="UTF-8" ?>

<PROCESS_Input xmlns="http://xmlns.oracle.com/apps/cux/rest/CuxWsTestSrv/process/">

<RESTHeader xmlns="http://xmlns.oracle.com/apps/fnd/rest/header">

<Responsibility></Responsibility>

<RespApplication></RespApplication>

<SecurityGroup></SecurityGroup>

<NLSLanguage>SIMPLIFIED CHINESE</NLSLanguage>

<Org_Id>0</Org_Id>

</RESTHeader>

<InputParameters><P_ID>5</P_ID><P_NAME>plsql</P_NAME><P_AGE>33</P_AGE><P_BIRTH_DATE>2020-02-01</P_BIRTH_DATE></InputParameters>

</PROCESS_Input>

 ';

 

  l_resp_data         VARCHAR2(32767);

  l_http_auth_encoded VARCHAR2(100);

BEGIN

  l_request := utl_http.begin_request(l_url, 'POST', utl_http.http_version_1_1);

  utl_http.set_header(l_request,

                      'Content-Type',

                      'application/xml; charset=utf-8');

  l_http_auth_encoded := utl_raw.cast_to_varchar2(utl_encode.base64_encode(r => utl_raw.cast_to_raw('SYSADMIN:sysadmin')));

  utl_http.set_header(l_request,

                      'Authorization',

                      'Basic ' || l_http_auth_encoded);

  utl_http.set_header(l_request,

                      'Content-Length',

                      to_char(lengthb(l_req_data)));

  utl_http.write_text(l_request, l_req_data);

  l_response := utl_http.get_response(l_request);

  utl_http.read_text(l_response, l_resp_data);

  dbms_output.put_line(l_resp_data);

  utl_http.end_response(l_response);

END;

 

 

6.2.2 方式2:JSON

REQUEST:

DECLARE

  l_url      VARCHAR2(100) := 'http://cheng.erptest.com:8000/webservices/rest/CuxWsTestSrv/process/';

  l_request  utl_http.req;

  l_response utl_http.resp;

 

  l_req_data          VARCHAR2(32767) := '{

    "PROCESS_Input": {

        "@xmlns": "http://xmlns.oracle.com/apps/cux/rest/CuxWsTestSrv/process/",

        "RESTHeader": {

            "@xmlns": "http://xmlns.oracle.com/apps/fnd/rest/header",

            "Responsibility": "",

            "RespApplication": "",

            "SecurityGroup": "",

            "NLSLanguage": "SIMPLIFIED CHINESE",

            "Org_Id": "0"

        },

        "InputParameters": {"P_ID":"5","P_NAME":"json","P_AGE":"22","P_BIRTH_DATE":"2020-01-02"

        }

    }

}';

  l_resp_data         VARCHAR2(32767);

  l_http_auth_encoded VARCHAR2(100);

BEGIN

  l_request := utl_http.begin_request(l_url, 'POST', utl_http.http_version_1_1);

  utl_http.set_header(l_request,

                      'Content-Type',

                      'application/json; charset=utf-8');

  l_http_auth_encoded := utl_raw.cast_to_varchar2(utl_encode.base64_encode(r => utl_raw.cast_to_raw('SYSADMIN:sysadmin')));

  utl_http.set_header(l_request,

                      'Authorization',

                      'Basic ' || l_http_auth_encoded);

  utl_http.set_header(l_request,

                      'Content-Length',

                      to_char(lengthb(l_req_data)));

  utl_http.write_text(l_request, l_req_data);

  l_response := utl_http.get_response(l_request);

  utl_http.read_text(l_response, l_resp_data);

  dbms_output.put_line(l_resp_data);

  utl_http.end_response(l_response);

END;

 



 

5.4  分析webservice调用报错的方法

cd $EBS_DOMAIN_HOME/servers/oafm_server1/logs

tail -f oafm_server1.out

然后调用服务,看日志的内容。

Guess you like

Origin www.cnblogs.com/sunlingC/p/12591462.html