Jdev11G发布WS部署Weblogic方案与实现

 

Oracle实践

Jdev11G发布WS部署Weblogic方案与实现

 

 

 

Author: lazy

Creation Date: 2016-Mar-14

Last Updated: 2016-Mar-14

Document Ref:

Version: 1.0

 

  1. Title, Subject, Last Updated Date, Reference Number, and Version are marked by a Word Bookmark so that they can be easily reproduced in the header and footer of documents.  When you change any of these values, be careful not to accidentally delete the bookmark.  You can make bookmarks visible by selecting Tools->Options…View and checking the Bookmarks option in the Show region.

 

 

Approvals:

<Approver 1>

顾焕

<Approver 2>

 

Copy No. _____

  1. To add additional approval lines, press [Tab] from the last cell in the table above.
  1. You can delete any elements of this cover page that you do not need for your document.  For example, Copy Number is only required if this is a controlled document and you need to track each copy that you distribute.

 

Document Control

 

Change Record

1

Date

Author

Version

Change Reference

 

 

 

 

14-Mar-16

Lazy

1.0

No Previous Document

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reviewers

 

Name

Position

 

 

 

 

 

 

 

 

 

 

 

 

Distribution

 

Copy No.

Name

Location

 

 

 

  1.  

Library Master

Project Library

  1.  

 

Project Manager

  1.  

 

 

  1.  

 

 

  1. The copy numbers referenced above should be written into the Copy Number space on the cover of each distributed copy.  If the document is not controlled, you can delete this table, the Note To Holders, and the Copy Number label from the cover page.

 

Note To Holders:

If you receive an electronic copy of this document and print it out, please write your name on the equivalent of the cover page, for document control purposes.

If you receive a hard copy of this document, please write your name on the front cover, for document control purposes.

Contents

Document Control ii

总体说明 1

文档目的 1

内容 1

环境介绍 1

(一)实现方案 2

(二)实现方式 3

(三)环境间迁移 20

(四)注意事项 21

(五)高级应用 39

(六)参考文档 40

Open and Closed Issues for this Deliverable 41

Open Issues 41

Closed Issues 41

 

  1. To update the table of contents, put the cursor anywhere in the table and press [F9].  To change the number of levels displayed, select the menu option Insert>Index and Tables, make sure the Table of Contents tab is active, and change the Number of Levels to a new value.

 

 

总体说明

 

文档目的

本文档针对目前项目上使用到的webservice开发方式进行一个方案和实现上的整理,涉及的相对比较浅显易懂的的实现方式。

适用于:

使用jdeveloper开发的发布于weblogic服务器上的webservice服务

 

内容

  1. Webservice简介
  2. 实现方案
  3. 实现方式
  4. 环境间迁移
  5. 注意事项
  6. 高级应用
  7. 参考文档

 

环境介绍

  1. JDeveloper Studio 11.1.1.2.0
  2. Oracle Weblogic 10.3.6

 

(一)Webservice简介

1.1   简介

Web Service技术, 能使得运行在不同机器上的不同应用无须借助附加的、专门的第三方软件或硬件, 就可相互交换数据或集成。

1.2   xml web service

1.3   主要支持技术

Web services要使用的主要支持技术有:

XML和XSD

可扩展的标记语言标准通用标记语言下的一个子集)是Web Service平台中表示数据的基本格式。除了易于建立和易于分析外,XML主要的优点在于它既与平台无关,又与厂商无关。XML是由万维网协会(W3C)创建,W3C制定的XML SchemaXSD 定义了一套标准的数据类型,并给出了一种语言来扩展这套数据类型

Web Service平台是用XSD来作为数据类型系统的。当你用某种语言如VB. NET或C# 来构造一个Web Service时,为了符合Web Service标准,所有你使用的数据类型都必须被转换为XSD类型。如想让它使用在不同平台和不同软件的不同组织间传递,还需要用某种东西将它包装起来。这种东西就是一种协议,如 SOAP。

SOAP

SOAP即简单对象访问协议(Simple Object Access Protocol),它是用于交换XML标准通用标记语言下的一个子集)编码信息的轻量级协议。它有三个主要方面:XML-envelope为描述信息内容和如何处理内容定义了框架,将程序对象编码成为XML对象的规则,执行远程过程调用(RPC)的约定。SOAP可以运行在任何其他传输协议上。例如,你可以使用 SMTP,即因特网电子邮件协议来传递SOAP消息,这可是很有诱惑力的。在传输层之间的头是不同的,但XML有效负载保持相同。

Web Service 希望实现不同的系统之间能够用“软件-软件对话”的方式相互调用,打破了软件应用、网站和各种设备之间的格格不入的状态,实现“基于Web无缝集成”的目标。

WSDL

Web Service描述语言WSDL 就是用机器能阅读的方式提供的一个正式描述文档而基于XML标准通用标记语言下的一个子集)的语言,用于描述Web Service及其函数、参数和返回值。因为是基于XML的,所以WSDL既是机器可阅读的,又是人可阅读的。

UDDI

UDDI 的目的是为电子商务建立标准;UDDI是一套基于Web的、分布式的、为Web Service提供的、信息注册中心的实现标准规范,同时也包含一组使企业能将自身提供的Web Service注册,以使别的企业能够发现的访问协议的实现标准。

调用RPC与消息传递

Web Service本身其实是在实现应用程序间的通信。我们有两种应用程序通信的方法:RPC远程过程调用 和消息传递。使用RPC的时候,客户端的概念是调用服务器上的远程过程,通常方式为实例化一个远程对象并调用其方法和属性。RPC系统试图达到一种位置上的透明性:服务器暴露出远程对象的接口,而客户端就好像在本地使用的这些对象的接口一样,这样就隐藏了底层的信息,客户端也就根本不需要知道对象是在哪台机器上。

 

1.4   数据传输样式

SOAP 规范中style与use这两个属性决定SOAP数据的编码样式。

style属性可是两个值中的一个: rpc 或 document 。当属性被设定为文档样式时,客户端使用 XML 模式调用约定;当属性设置成RPC,客户端使用远程过程调用约定。

1)RPC Stype指定包含Web服务调用的XML节点,该节点以Web服务调用方法命名,XML节点依次包含方法调用的各个参数。

2)Document Style指定内直接包含消息,该消息没有SOAP格式限制。服务器的应用层负责将XML文档映射成内存对象(参数、方法调用等等)。

Use属性值决定消息的编码方式:可以是encoded或者是 literal。

1)encoded值表示XML的消息使用类型属性引用抽象数据类型,使用Section 5编码(SOAP规范第五章定义的编码)进行xml的序列化和反序列化。

2) Literal值表示XML的消息使用类型属性或者Element元素引用具体的Schema定义,也就是说,根据具体的Schema将内存对象序列化成XML消息。

 

Style和Use的值进行组合,SOAP可以有四种编码样式,比较常用的如下:

1) RPC/Encoded编码,使用SOAP编码,也称为 Section 5 编码,它由 SOAP 1.1 规范定义。

2) Document/literal编码。

3) RPC/literal编码,它使用 RPC 方法进行调用但使用 XML 自制的方法编入数据。

第一种RPC/Encoded曾在JAVA开发中应用非常广泛;第二种编码样式是DOT NET开发社区使用的缺省编码方式;第三种编码样式是第一种和第二种编码方式的混合,使用RPC的方式传送文档型数据。

 

(一)实现方案

1.1   总体方案说明

对于SOA方式发布的Webservice,部署过程比较复杂,需要安装patch等配置,最终还是决定尝试使用Weblogic发布Webservice服务。

文档中约定如下:

  1. 对外提供服务的一方称为:服务方

2.调用其他系统提供服务的一方称为:消费方

1.2   服务方

通过Jdeveloper将PL/SQL程序发布在Oracle Weblogic服务器上对外提供服务。

使用的方式主要有如下几种:

  1. 通过特定参数条件向外围系统提供数据

实现的方案问题主要在出参上,通过何种方式返回需要的数据可以根据需要进行变通使用,主要通过PL/SQL编写Function,其中:

入参:独立字段

出参:CLOB对象,其中CLOB中可以与各系统约定具体使用何种方式,如:XML或者Json

  1. 接收外围系统传入的数据至接口表

实现的方案问题主要在入参方式上,出参可统一返回样式:只要返回统一格式的成功标识及错误原因,入参的方式上主要有如下几种:

方案一、入参:独立字段,每次只能接收一条数据

方案二、入参:CLOB,CLOB中可以使用约定的样式进行参数的解析

方案三、入参:table类型变量

  1. 传入特定参数返回特定消息

实现上根据实际情况传入相应的参数,程序中调用相应方法生成相应需要返回的信息

 

1.3   消费方

通过PL/SQL调用外围系统发布的Webservice服务。

 

(二)实现方式

2.1   PL/SQL程序

主要说明下入参是table类型变量和CLOB类型的使用。

Table类型

  1. 定义样例

1.1、单表样例

TYPE type_pay_rec IS RECORD(

    source_code             VARCHAR2(50),

payment_number          VARCHAR2(240),

payment_created_person  VARCHAR2(240));

TYPE type_pay_tbl IS TABLE OF type_pay_rec INDEX BY BINARY_INTEGER;

 

1.2、头行表样例

行定义

TYPE inv_apply_lines_rec_type IS RECORD(

          organization_id    NUMBER,

          line_number        NUMBER,

          item_number        VARCHAR2(30),

item_desc          VARCHAR2(240));

TYPE inv_apply_lines_tbl_type IS TABLE OF inv_apply_lines_rec_type INDEX BY BINARY_INTEGER;

 

头定义

TYPE inv_apply_header_rec_type IS RECORD(

         organization_id          NUMBER,

         urgent_level             VARCHAR2(240),

doc_type_id              NUMBER,

line_tbl                 inv_apply_lines_tbl_type);

TYPE inv_apply_header_tbl_type IS TABLE OF inv_apply_header_rec_type INDEX BY BINARY_INTEGER;

 

  1. 入参样例

单表入参

FUNCTION import_data(p_pay_tbl IN type_pay_tbl) RETURN CLOB

 

头行表入参

PROCEDURE inv_oa_apply(p_header_tbl IN inv_apply_header_tbl_type,

 x_result            OUT CLOB);

 

CLOB类型

CLOB类型使用约定的XML结构便于解析,在传入后可以统一的将CLOB字段和XML字段插入到公用的table中,而后统一进行解析获取入参数据。

 

测试样例

测试样例只使用了简单的单个参数入参形式对整个发布过程做说明。

Package special内容如下:

create or replace package cux_testwz_ws_pkg is

  function get_info(p_user_name in varchar2) return varchar2;

end cux_testwz_ws_pkg;

 

Package body内容如下:

create or replace package body cux_testwz_ws_pkg is

function get_info(p_user_name in varchar2) return varchar2 is

    begin

       return p_user_name || 'hello world!';

    end;

end cux_testwz_ws_pkg;

 

2.2   Jdeveloper发布

Step1  创建Database

新建IDE Connections,如下图所示:

说明:

Connection Name:连接名称,自定义

Connection Type:连接类型,默认JDBC

Username:连接数据库的用户名

Password:连接数据库的密码

Driver:使用默认方式:thin

Host Name:数据库的ip

SID:数据库实例名

 

Step2  发布程序包

1.创建Generic Application

 

2.Next创建Project

 

3.切换至IDE Connection是页面,选择当前环境使用的database连接,展开Packages选项,找到需要发布的package,右键选择Publish as Web Service。

Target Project默认,点击Next

Deployment Platform,默认

 

按相应规范调整Web Service Name,Java Package默认,点击Next

 

SOAP Message Format默认RPC/Literal

 

选择需要发布的function或者procedure,点击Next

 

连接匹配信息界面直接全部默认,点击Next

 

后面可以直接finish,切换至Application Navigator界面,可以看到如下样式:

 

Step3  修改Data Source

找到weblogic服务使用的Data Sources名称,服务器上路径为:EBS_domain_DEV/Services/Data Sources

主要修改两个文件中使用的Data Source:

一、Base.java文件

修改前:

修改后:

、web.xml文件

修改前:

修改后:

 

Step4  war文件打包

选择project,右键选择Deploy,选择Webservices

 

这里我们选择Deploy to war

 

点击Next可以看到生成的war文件所在的路径与名称

 

点击Finish,日志显示成功即表示war文件创建成功

 

2.3   Weblogic发布服务

1.进入weblogic控制界面,选择Lock&Edit进行编辑,选择Deployments准备发布。

 

2.选择Install

 

3.点击upload your file(s),上传需要发布的war文件。

 

4.上传文件,点击Next。

 

5.后面一路Next就可以,直到最后的Finish。点击Activate Changes使设置生效。

 

6.切换至Deployments页面,可以看到刚创建的webservice应用,不过此时的状态是Prepared。

 

7.勾选上刚发布的webservice应用,启动服务:Start -> Servicing all requests

 

8.出现如下信息表示服务启动成功,同时看到State状态和Health状态分别为:Active和OK。

 

2.4   调用测试

1.获取发布的webservice的wsdl地址

1.1、展开发布的webservice服务,找到Type为Web Service

2.2、切换至Testing tab页面,展开Name,可以看到有个Test Point为?WSDL的,点击以后会出现wsdl对应的定义信息,其地址就是需要提供出去的wsdl地址。

 

2.使用Soap UI软件进行调用测试

2.1、进入Soap UI软件,选择SOAP新建一个SOAP Project,将获取的wsdl地址放置在对应的地址路径下。

创建后出现如下样式的界面

2.2、将参数中默认的?替换成真实需要传递的参数,点击“运行”按钮,测试返回结果。

至此一个简单的通过jdeveloper发布在weblogic上的webservice发布完成。

 

 

(三)环境间迁移

3.1   迁移事项

已经发布的webservice在不同环境间迁移的时候,为方便起见,可以通过修改部分信息,达到迁移的效果,主要的修改点有如下几种情况:

一、入参是单值和CLOB

这种方式比较简单,修改的也比较简单,从发布过程可以知道我们只需要做以下两个部分的修改

1、…base.java和web.xml文件中的两个Data Resource连接信息,替换成需要迁移的环境信息就可以了

2、重新Deploy生成新的war文件

二、入参为table类型

对于使用table类型变量作为参数的webservice在对database中的package进行发布的时候会自动创建一个Resources文件夹,其中有两个.sql的文件:

…_plsql_ wrapper.sql:该文件中包含了需要创建3个对象:

一、入参定义的record字段object对象定义;

二、基于object的table类型定义;

三、_plsql_wrapper的package定义;

…_plsql_dropper.sql:对wrapper中定义的3个对象进行drop的操作。

由于这两个文件是在数据库发布(不是weblogic发布war的时候)的时候自动创建的,迁移时如果只是直接修改data source而不是从database重新发布的,这两个.sql文件并不会自动创建需要的对象,因而在后续调用系统package时会出现invalid method(未找到wrapper中需要创建的的对象)的问题,这时需要手工创建wrapper.sql文件中的三个对象。而直接重新创建的并不会出现这个问题。

 

 

(四)注意事项

4.1   R12 Weblogic端口问题

R12系统的文件系统结构存在fs1和fs2两个,这也意味着在R12上的Weblogic Console存在两个端口对应的地址,这就导致了发布出去的webservice存在两个端口的情况。这种情况下我们可以创一个不受fs1和fs2切换影响的新的domain。

这里我们例子中创建一个如下信息的domain:

属性

Domain类型

Basic WebLogic Server Domain

Domain名称

DEV_Test_domain

Port

7090

Password

manager0

运行模式

生产模式

 

具体创建方式如下:

1.进入配置命令路径

[appldev@test ~]$ cd $FMW_HOME/wlserver_10.3/common/bin

[appldev@test bin]$ ls

commEnv.sh         config.sh  setPatchEnv.sh  startManagedWebLogic.sh  unpack.sh   wlscontrol.sh   wlst.sh

config_builder.sh  pack.sh    startDerby.sh   stopDerby.sh             upgrade.sh  wlsifconfig.sh

[appldev@test bin]$ ./config.sh

Unable to instantiate GUI, defaulting to console mode.

 

 

 

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Welcome:

--------

 

Choose between creating and extending a domain. Based on your selection,

the Configuration Wizard guides you through the steps to generate a new or

extend an existing domain.

 

 ->1|Create a new WebLogic domain

    |    Create a WebLogic domain in your projects directory.  

 

   2|Extend an existing WebLogic domain

    |    Use this option to add new components to an existing domain and modify     |configuration settings.

 

 

 

 

 

Enter index number to select OR [Exit][Next]> 1

 

2.创建新的domain

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Domain Source:

---------------------

 

Select the source from which the domain will be created. You can create the

domain by selecting from the required components or by selecting from a

list of existing domain templates.

 

 ->1|Choose Weblogic Platform components

    |    You can choose the Weblogic component(s) that you want supported in

    |your domain.

 

   2|Choose custom template

    |    Choose this option if you want to use an existing  template. This

    |could be a custom created template using the Template Builder.

 

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Application Template Selection:

-------------------------------

 

 

 

    Available Templates

    |_____Basic WebLogic Server Domain - 10.3.6.0 [wlserver_10.3]x

    |_____Oracle Enterprise Manager Plugin for EBS - 11.1.1.0 [Oracle_EBS-app1] [2]

    |_____Oracle Enterprise Manager - 11.1.1.0 [oracle_common] [3]

    |_____Oracle WSM Policy Manager - 11.1.1.0 [oracle_common] [4]

    |_____Oracle JRF WebServices Asynchronous services - 11.1.1.0 [oracle_common] [5]

    |_____Oracle E-Business Suite Applications - 11.1.1.0 [Oracle_EBS-app1] [6]

    |_____Oracle JRF - 11.1.1.0 [oracle_common] [7]

    |_____Basic WebLogic SIP Server Domain - 10.3.6.0 [wlserver_10.3] [8]

    |_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.6.0 [wlserver_10.3] [9]

    |_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.6.0 [wlserver_10.3] [10]

 

 

 

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |    Value    |

   _|________|_____________|

   1| *Name: | base_domain |

 

 

 

 

Enter value for "Name" OR [Exit][Previous][Next]> DEV_Test_domain

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |      Value      |

   _|________|_________________|

   1| *Name: | DEV_Test_domain |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select the target domain directory for this domain:

---------------------------------------------------

 

    "Target Location" = [Enter new value or use default

"/home/dev/app/fs1/FMW_Home/user_projects/domains"]

 

 

 

 

Enter new Target Location OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                                         |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*User password:" = []

 

 

 

 

Enter new *User password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*Confirm user password:" = []

 

 

 

 

Enter new *Confirm user password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                ********                 |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Domain Mode Configuration:

--------------------------

 

Enable Development or Production Mode for this domain.

 

 ->1|Development Mode

 

   2|Production Mode

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Java SDK Selection:

-------------------

 

 ->1|Sun SDK 1.7.0_25 @ /home/dev/app/fs1/EBSapps/comn/util/jdk64

   2|Other Java SDK

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [ ]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [x]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

 

 

 

Enter value for "Listen port" OR [Exit][Previous][Next]> 7090

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7090         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Creating Domain...

 

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

 

 

**** Domain Created Successfully! ****

 

 

[appldev@test bin]$

 

3.进入刚创建的domain,启动对应的服务

[appldev@test ~]$ cd $FMW_HOME/user_projects/domains/DEV_Test_domain/bin

[appldev@test bin]$ ls

nodemanager  server_migration  service_migration  setDomainEnv.sh  startManagedWebLogic.sh  startWebLogic.sh  stopManagedWebLogic.sh  stopWebLogic.sh

 

[appldev@test bin]$ vi startWebLogic.sh

在获取WLS_USER和PW的地方之前添加:

WLS_USER=weblogic

WLS_PW=manager0

[appldev@test bin]$ nohup startWebLogic.sh

加了nohup以后,关闭telnet窗口,也不会发送weblogic的停止信号,但相关启动信息也无法在屏幕上输出。

登录界面成功后,直接关闭Telnet界面。

 

4.创建Data Sources

4.1 使用Lock&Edit,New一个Generic Data Source

4.2 设置对应的名称

4.3 直接默认,在如下界面输入对应数据库信息

4.4 继续Next,选择需要连接的服务器

4.5 点击Activate changes使设置生效

4.6 进入刚创建的Data Sources属性界面,切换至Connection Pool页面,调整

Initial Capacity: 100

Maximum Capacity:1000

 

4.2   性能问题

使用Weblogic发布的webservice在性能上已知的问题只要有如下几个:

一、数据量

一般来说webservice只适合小数据量的传输,如果一定要使用webservice来进行较大数据量的传输时,需要注意提供和发布的两种webservice需要限定每次提供和接收的数据量,一般尽可能不要太大,太大会导致出现连接超时,例如可以设定每次传输200条数据。

 

二、TEMP表空间

TEMP表空间的大小限制了webservice在传输过程中的数据量和连接量,需要调整期大小以满足数据传输的需要。

 

三、jdbc连接数

从domain的数据源配置上可以看到,Weblogic服务器连接数据库使用的jdbc方式,在配置上默认了该Adminserver可以连接的最大连接量,修改方法见上节中的Connection Pool设置。

 

四、CLOB对象的Realease

具体方法可以见SR ID802897.1,其中使用到如下的方式

alter system set events '60025 trace name context forever';

 

4.3   发布问题

参数变更

对于参数变更的情况需要从IDE Connection那步开始重新发布,推荐将整个项目删掉重新发布一个新的,如果入参是table类型时,删除应用的时候要注意检查下Resources文件夹中的wrapper.sql文件中创建的对象在数据库是否已被删除,若未被删除重新新建一个应用名称一致的webservice会出现参数未改变过来的情况。

 

 

(五)高级应用

5.1   多namespace的合并

入参为table类型的webservice服务,生成的soap协议存在两层namespace:一层为.wsdl,用于最外层的值属性定义,另一层是.wsdl/types/,用于定义的table类型的字段的属性。

有项目需求是只要有一个namespace,那么就需要去除掉另一个namespace,这边选择去除掉/types的定义。

去除webservice服务中相应的http://dev/....wsdl/types/命名空间说明,替换成http://dev/....wsdl

主要修改文件有:…-java-wsdl-mapping.xml:

去除type的package-mapping标签,将下面使用到type的全部替换成http://dev/....wsdl

….wsdl:去除wsdl:definitions定义中的tns1定义,将后续使用到tns1的全部替换成引用tns

 

(六)参考文档

在实际应用中,环境和版本与本文可能不同,如果想了解更多的内容请参考以下文档:

文档名称

说明

How to Release the Temp LOB Space and Avoid Hitting ORA-1652 (文档 ID 802897.1)

 

 

  1. If the Functional Design included a Technical Overview section, duplicate that information here and add additional details.
  1. Add other components above as required
  1. Indicate the specific menu options added to access new forms.

Open and Closed Issues for this Deliverable

  1. Add open issues that you identify while writing or reviewing this document to the open issues section.  As you resolve issues, move them to the closed issues section and keep the issue ID the same.  Include an explanation of the resolution.

    When this deliverable is complete, any open issues should be transferred to the project- or process-level Risk and Issue Log (PJM.CR.040) and managed using a project level Risk and Issue Form (PJM.CR.040).  In addition, the open items should remain in the open issues section of this deliverable, but flagged in the resolution column as being transferred.

 

Open Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

Oracle实践

Jdev11G发布WS部署Weblogic方案与实现

 

 

 

Author: lazy

Creation Date: 2016-Mar-14

Last Updated: 2016-Mar-14

Document Ref:

Version: 1.0

 

  1. Title, Subject, Last Updated Date, Reference Number, and Version are marked by a Word Bookmark so that they can be easily reproduced in the header and footer of documents.  When you change any of these values, be careful not to accidentally delete the bookmark.  You can make bookmarks visible by selecting Tools->Options…View and checking the Bookmarks option in the Show region.

 

 

Approvals:

<Approver 1>

顾焕

<Approver 2>

 

Copy No. _____

  1. To add additional approval lines, press [Tab] from the last cell in the table above.
  1. You can delete any elements of this cover page that you do not need for your document.  For example, Copy Number is only required if this is a controlled document and you need to track each copy that you distribute.

 

Document Control

 

Change Record

1

Date

Author

Version

Change Reference

 

 

 

 

14-Mar-16

Lazy

1.0

No Previous Document

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reviewers

 

Name

Position

 

 

 

 

 

 

 

 

 

 

 

 

Distribution

 

Copy No.

Name

Location

 

 

 

  1.  

Library Master

Project Library

  1.  

 

Project Manager

  1.  

 

 

  1.  

 

 

  1. The copy numbers referenced above should be written into the Copy Number space on the cover of each distributed copy.  If the document is not controlled, you can delete this table, the Note To Holders, and the Copy Number label from the cover page.

 

Note To Holders:

If you receive an electronic copy of this document and print it out, please write your name on the equivalent of the cover page, for document control purposes.

If you receive a hard copy of this document, please write your name on the front cover, for document control purposes.

Contents

Document Control ii

总体说明 1

文档目的 1

内容 1

环境介绍 1

(一)实现方案 2

(二)实现方式 3

(三)环境间迁移 20

(四)注意事项 21

(五)高级应用 39

(六)参考文档 40

Open and Closed Issues for this Deliverable 41

Open Issues 41

Closed Issues 41

 

  1. To update the table of contents, put the cursor anywhere in the table and press [F9].  To change the number of levels displayed, select the menu option Insert>Index and Tables, make sure the Table of Contents tab is active, and change the Number of Levels to a new value.

 

 

总体说明

 

文档目的

本文档针对目前项目上使用到的webservice开发方式进行一个方案和实现上的整理,涉及的相对比较浅显易懂的的实现方式。

适用于:

使用jdeveloper开发的发布于weblogic服务器上的webservice服务

 

内容

  1. Webservice简介
  2. 实现方案
  3. 实现方式
  4. 环境间迁移
  5. 注意事项
  6. 高级应用
  7. 参考文档

 

环境介绍

  1. JDeveloper Studio 11.1.1.2.0
  2. Oracle Weblogic 10.3.6

 

(一)Webservice简介

1.1   简介

Web Service技术, 能使得运行在不同机器上的不同应用无须借助附加的、专门的第三方软件或硬件, 就可相互交换数据或集成。

1.2   xml web service

1.3   主要支持技术

Web services要使用的主要支持技术有:

XML和XSD

可扩展的标记语言标准通用标记语言下的一个子集)是Web Service平台中表示数据的基本格式。除了易于建立和易于分析外,XML主要的优点在于它既与平台无关,又与厂商无关。XML是由万维网协会(W3C)创建,W3C制定的XML SchemaXSD 定义了一套标准的数据类型,并给出了一种语言来扩展这套数据类型

Web Service平台是用XSD来作为数据类型系统的。当你用某种语言如VB. NET或C# 来构造一个Web Service时,为了符合Web Service标准,所有你使用的数据类型都必须被转换为XSD类型。如想让它使用在不同平台和不同软件的不同组织间传递,还需要用某种东西将它包装起来。这种东西就是一种协议,如 SOAP。

SOAP

SOAP即简单对象访问协议(Simple Object Access Protocol),它是用于交换XML标准通用标记语言下的一个子集)编码信息的轻量级协议。它有三个主要方面:XML-envelope为描述信息内容和如何处理内容定义了框架,将程序对象编码成为XML对象的规则,执行远程过程调用(RPC)的约定。SOAP可以运行在任何其他传输协议上。例如,你可以使用 SMTP,即因特网电子邮件协议来传递SOAP消息,这可是很有诱惑力的。在传输层之间的头是不同的,但XML有效负载保持相同。

Web Service 希望实现不同的系统之间能够用“软件-软件对话”的方式相互调用,打破了软件应用、网站和各种设备之间的格格不入的状态,实现“基于Web无缝集成”的目标。

WSDL

Web Service描述语言WSDL 就是用机器能阅读的方式提供的一个正式描述文档而基于XML标准通用标记语言下的一个子集)的语言,用于描述Web Service及其函数、参数和返回值。因为是基于XML的,所以WSDL既是机器可阅读的,又是人可阅读的。

UDDI

UDDI 的目的是为电子商务建立标准;UDDI是一套基于Web的、分布式的、为Web Service提供的、信息注册中心的实现标准规范,同时也包含一组使企业能将自身提供的Web Service注册,以使别的企业能够发现的访问协议的实现标准。

调用RPC与消息传递

Web Service本身其实是在实现应用程序间的通信。我们有两种应用程序通信的方法:RPC远程过程调用 和消息传递。使用RPC的时候,客户端的概念是调用服务器上的远程过程,通常方式为实例化一个远程对象并调用其方法和属性。RPC系统试图达到一种位置上的透明性:服务器暴露出远程对象的接口,而客户端就好像在本地使用的这些对象的接口一样,这样就隐藏了底层的信息,客户端也就根本不需要知道对象是在哪台机器上。

 

1.4   数据传输样式

SOAP 规范中style与use这两个属性决定SOAP数据的编码样式。

style属性可是两个值中的一个: rpc 或 document 。当属性被设定为文档样式时,客户端使用 XML 模式调用约定;当属性设置成RPC,客户端使用远程过程调用约定。

1)RPC Stype指定包含Web服务调用的XML节点,该节点以Web服务调用方法命名,XML节点依次包含方法调用的各个参数。

2)Document Style指定内直接包含消息,该消息没有SOAP格式限制。服务器的应用层负责将XML文档映射成内存对象(参数、方法调用等等)。

Use属性值决定消息的编码方式:可以是encoded或者是 literal。

1)encoded值表示XML的消息使用类型属性引用抽象数据类型,使用Section 5编码(SOAP规范第五章定义的编码)进行xml的序列化和反序列化。

2) Literal值表示XML的消息使用类型属性或者Element元素引用具体的Schema定义,也就是说,根据具体的Schema将内存对象序列化成XML消息。

 

Style和Use的值进行组合,SOAP可以有四种编码样式,比较常用的如下:

1) RPC/Encoded编码,使用SOAP编码,也称为 Section 5 编码,它由 SOAP 1.1 规范定义。

2) Document/literal编码。

3) RPC/literal编码,它使用 RPC 方法进行调用但使用 XML 自制的方法编入数据。

第一种RPC/Encoded曾在JAVA开发中应用非常广泛;第二种编码样式是DOT NET开发社区使用的缺省编码方式;第三种编码样式是第一种和第二种编码方式的混合,使用RPC的方式传送文档型数据。

 

(一)实现方案

1.1   总体方案说明

对于SOA方式发布的Webservice,部署过程比较复杂,需要安装patch等配置,最终还是决定尝试使用Weblogic发布Webservice服务。

文档中约定如下:

  1. 对外提供服务的一方称为:服务方

2.调用其他系统提供服务的一方称为:消费方

1.2   服务方

通过Jdeveloper将PL/SQL程序发布在Oracle Weblogic服务器上对外提供服务。

使用的方式主要有如下几种:

  1. 通过特定参数条件向外围系统提供数据

实现的方案问题主要在出参上,通过何种方式返回需要的数据可以根据需要进行变通使用,主要通过PL/SQL编写Function,其中:

入参:独立字段

出参:CLOB对象,其中CLOB中可以与各系统约定具体使用何种方式,如:XML或者Json

  1. 接收外围系统传入的数据至接口表

实现的方案问题主要在入参方式上,出参可统一返回样式:只要返回统一格式的成功标识及错误原因,入参的方式上主要有如下几种:

方案一、入参:独立字段,每次只能接收一条数据

方案二、入参:CLOB,CLOB中可以使用约定的样式进行参数的解析

方案三、入参:table类型变量

  1. 传入特定参数返回特定消息

实现上根据实际情况传入相应的参数,程序中调用相应方法生成相应需要返回的信息

 

1.3   消费方

通过PL/SQL调用外围系统发布的Webservice服务。

 

(二)实现方式

2.1   PL/SQL程序

主要说明下入参是table类型变量和CLOB类型的使用。

Table类型

  1. 定义样例

1.1、单表样例

TYPE type_pay_rec IS RECORD(

    source_code             VARCHAR2(50),

payment_number          VARCHAR2(240),

payment_created_person  VARCHAR2(240));

TYPE type_pay_tbl IS TABLE OF type_pay_rec INDEX BY BINARY_INTEGER;

 

1.2、头行表样例

行定义

TYPE inv_apply_lines_rec_type IS RECORD(

          organization_id    NUMBER,

          line_number        NUMBER,

          item_number        VARCHAR2(30),

item_desc          VARCHAR2(240));

TYPE inv_apply_lines_tbl_type IS TABLE OF inv_apply_lines_rec_type INDEX BY BINARY_INTEGER;

 

头定义

TYPE inv_apply_header_rec_type IS RECORD(

         organization_id          NUMBER,

         urgent_level             VARCHAR2(240),

doc_type_id              NUMBER,

line_tbl                 inv_apply_lines_tbl_type);

TYPE inv_apply_header_tbl_type IS TABLE OF inv_apply_header_rec_type INDEX BY BINARY_INTEGER;

 

  1. 入参样例

单表入参

FUNCTION import_data(p_pay_tbl IN type_pay_tbl) RETURN CLOB

 

头行表入参

PROCEDURE inv_oa_apply(p_header_tbl IN inv_apply_header_tbl_type,

 x_result            OUT CLOB);

 

CLOB类型

CLOB类型使用约定的XML结构便于解析,在传入后可以统一的将CLOB字段和XML字段插入到公用的table中,而后统一进行解析获取入参数据。

 

测试样例

测试样例只使用了简单的单个参数入参形式对整个发布过程做说明。

Package special内容如下:

create or replace package cux_testwz_ws_pkg is

  function get_info(p_user_name in varchar2) return varchar2;

end cux_testwz_ws_pkg;

 

Package body内容如下:

create or replace package body cux_testwz_ws_pkg is

function get_info(p_user_name in varchar2) return varchar2 is

    begin

       return p_user_name || 'hello world!';

    end;

end cux_testwz_ws_pkg;

 

2.2   Jdeveloper发布

Step1  创建Database

新建IDE Connections,如下图所示:

说明:

Connection Name:连接名称,自定义

Connection Type:连接类型,默认JDBC

Username:连接数据库的用户名

Password:连接数据库的密码

Driver:使用默认方式:thin

Host Name:数据库的ip

SID:数据库实例名

 

Step2  发布程序包

1.创建Generic Application

 

2.Next创建Project

 

3.切换至IDE Connection是页面,选择当前环境使用的database连接,展开Packages选项,找到需要发布的package,右键选择Publish as Web Service。

Target Project默认,点击Next

Deployment Platform,默认

 

按相应规范调整Web Service Name,Java Package默认,点击Next

 

SOAP Message Format默认RPC/Literal

 

选择需要发布的function或者procedure,点击Next

 

连接匹配信息界面直接全部默认,点击Next

 

后面可以直接finish,切换至Application Navigator界面,可以看到如下样式:

 

Step3  修改Data Source

找到weblogic服务使用的Data Sources名称,服务器上路径为:EBS_domain_DEV/Services/Data Sources

主要修改两个文件中使用的Data Source:

一、Base.java文件

修改前:

修改后:

、web.xml文件

修改前:

修改后:

 

Step4  war文件打包

选择project,右键选择Deploy,选择Webservices

 

这里我们选择Deploy to war

 

点击Next可以看到生成的war文件所在的路径与名称

 

点击Finish,日志显示成功即表示war文件创建成功

 

2.3   Weblogic发布服务

1.进入weblogic控制界面,选择Lock&Edit进行编辑,选择Deployments准备发布。

 

2.选择Install

 

3.点击upload your file(s),上传需要发布的war文件。

 

4.上传文件,点击Next。

 

5.后面一路Next就可以,直到最后的Finish。点击Activate Changes使设置生效。

 

6.切换至Deployments页面,可以看到刚创建的webservice应用,不过此时的状态是Prepared。

 

7.勾选上刚发布的webservice应用,启动服务:Start -> Servicing all requests

 

8.出现如下信息表示服务启动成功,同时看到State状态和Health状态分别为:Active和OK。

 

2.4   调用测试

1.获取发布的webservice的wsdl地址

1.1、展开发布的webservice服务,找到Type为Web Service

2.2、切换至Testing tab页面,展开Name,可以看到有个Test Point为?WSDL的,点击以后会出现wsdl对应的定义信息,其地址就是需要提供出去的wsdl地址。

 

2.使用Soap UI软件进行调用测试

2.1、进入Soap UI软件,选择SOAP新建一个SOAP Project,将获取的wsdl地址放置在对应的地址路径下。

创建后出现如下样式的界面

2.2、将参数中默认的?替换成真实需要传递的参数,点击“运行”按钮,测试返回结果。

至此一个简单的通过jdeveloper发布在weblogic上的webservice发布完成。

 

 

(三)环境间迁移

3.1   迁移事项

已经发布的webservice在不同环境间迁移的时候,为方便起见,可以通过修改部分信息,达到迁移的效果,主要的修改点有如下几种情况:

一、入参是单值和CLOB

这种方式比较简单,修改的也比较简单,从发布过程可以知道我们只需要做以下两个部分的修改

1、…base.java和web.xml文件中的两个Data Resource连接信息,替换成需要迁移的环境信息就可以了

2、重新Deploy生成新的war文件

二、入参为table类型

对于使用table类型变量作为参数的webservice在对database中的package进行发布的时候会自动创建一个Resources文件夹,其中有两个.sql的文件:

…_plsql_ wrapper.sql:该文件中包含了需要创建3个对象:

一、入参定义的record字段object对象定义;

二、基于object的table类型定义;

三、_plsql_wrapper的package定义;

…_plsql_dropper.sql:对wrapper中定义的3个对象进行drop的操作。

由于这两个文件是在数据库发布(不是weblogic发布war的时候)的时候自动创建的,迁移时如果只是直接修改data source而不是从database重新发布的,这两个.sql文件并不会自动创建需要的对象,因而在后续调用系统package时会出现invalid method(未找到wrapper中需要创建的的对象)的问题,这时需要手工创建wrapper.sql文件中的三个对象。而直接重新创建的并不会出现这个问题。

 

 

(四)注意事项

4.1   R12 Weblogic端口问题

R12系统的文件系统结构存在fs1和fs2两个,这也意味着在R12上的Weblogic Console存在两个端口对应的地址,这就导致了发布出去的webservice存在两个端口的情况。这种情况下我们可以创一个不受fs1和fs2切换影响的新的domain。

这里我们例子中创建一个如下信息的domain:

属性

Domain类型

Basic WebLogic Server Domain

Domain名称

DEV_Test_domain

Port

7090

Password

manager0

运行模式

生产模式

 

具体创建方式如下:

1.进入配置命令路径

[appldev@test ~]$ cd $FMW_HOME/wlserver_10.3/common/bin

[appldev@test bin]$ ls

commEnv.sh         config.sh  setPatchEnv.sh  startManagedWebLogic.sh  unpack.sh   wlscontrol.sh   wlst.sh

config_builder.sh  pack.sh    startDerby.sh   stopDerby.sh             upgrade.sh  wlsifconfig.sh

[appldev@test bin]$ ./config.sh

Unable to instantiate GUI, defaulting to console mode.

 

 

 

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Welcome:

--------

 

Choose between creating and extending a domain. Based on your selection,

the Configuration Wizard guides you through the steps to generate a new or

extend an existing domain.

 

 ->1|Create a new WebLogic domain

    |    Create a WebLogic domain in your projects directory.  

 

   2|Extend an existing WebLogic domain

    |    Use this option to add new components to an existing domain and modify     |configuration settings.

 

 

 

 

 

Enter index number to select OR [Exit][Next]> 1

 

2.创建新的domain

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Domain Source:

---------------------

 

Select the source from which the domain will be created. You can create the

domain by selecting from the required components or by selecting from a

list of existing domain templates.

 

 ->1|Choose Weblogic Platform components

    |    You can choose the Weblogic component(s) that you want supported in

    |your domain.

 

   2|Choose custom template

    |    Choose this option if you want to use an existing  template. This

    |could be a custom created template using the Template Builder.

 

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Application Template Selection:

-------------------------------

 

 

 

    Available Templates

    |_____Basic WebLogic Server Domain - 10.3.6.0 [wlserver_10.3]x

    |_____Oracle Enterprise Manager Plugin for EBS - 11.1.1.0 [Oracle_EBS-app1] [2]

    |_____Oracle Enterprise Manager - 11.1.1.0 [oracle_common] [3]

    |_____Oracle WSM Policy Manager - 11.1.1.0 [oracle_common] [4]

    |_____Oracle JRF WebServices Asynchronous services - 11.1.1.0 [oracle_common] [5]

    |_____Oracle E-Business Suite Applications - 11.1.1.0 [Oracle_EBS-app1] [6]

    |_____Oracle JRF - 11.1.1.0 [oracle_common] [7]

    |_____Basic WebLogic SIP Server Domain - 10.3.6.0 [wlserver_10.3] [8]

    |_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.6.0 [wlserver_10.3] [9]

    |_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.6.0 [wlserver_10.3] [10]

 

 

 

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |    Value    |

   _|________|_____________|

   1| *Name: | base_domain |

 

 

 

 

Enter value for "Name" OR [Exit][Previous][Next]> DEV_Test_domain

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |      Value      |

   _|________|_________________|

   1| *Name: | DEV_Test_domain |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select the target domain directory for this domain:

---------------------------------------------------

 

    "Target Location" = [Enter new value or use default

"/home/dev/app/fs1/FMW_Home/user_projects/domains"]

 

 

 

 

Enter new Target Location OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                                         |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*User password:" = []

 

 

 

 

Enter new *User password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*Confirm user password:" = []

 

 

 

 

Enter new *Confirm user password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                ********                 |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Domain Mode Configuration:

--------------------------

 

Enable Development or Production Mode for this domain.

 

 ->1|Development Mode

 

   2|Production Mode

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Java SDK Selection:

-------------------

 

 ->1|Sun SDK 1.7.0_25 @ /home/dev/app/fs1/EBSapps/comn/util/jdk64

   2|Other Java SDK

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [ ]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [x]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

 

 

 

Enter value for "Listen port" OR [Exit][Previous][Next]> 7090

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7090         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Creating Domain...

 

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

 

 

**** Domain Created Successfully! ****

 

 

[appldev@test bin]$

 

3.进入刚创建的domain,启动对应的服务

[appldev@test ~]$ cd $FMW_HOME/user_projects/domains/DEV_Test_domain/bin

[appldev@test bin]$ ls

nodemanager  server_migration  service_migration  setDomainEnv.sh  startManagedWebLogic.sh  startWebLogic.sh  stopManagedWebLogic.sh  stopWebLogic.sh

 

[appldev@test bin]$ vi startWebLogic.sh

在获取WLS_USER和PW的地方之前添加:

WLS_USER=weblogic

WLS_PW=manager0

[appldev@test bin]$ nohup startWebLogic.sh

加了nohup以后,关闭telnet窗口,也不会发送weblogic的停止信号,但相关启动信息也无法在屏幕上输出。

登录界面成功后,直接关闭Telnet界面。

 

4.创建Data Sources

4.1 使用Lock&Edit,New一个Generic Data Source

4.2 设置对应的名称

4.3 直接默认,在如下界面输入对应数据库信息

4.4 继续Next,选择需要连接的服务器

4.5 点击Activate changes使设置生效

4.6 进入刚创建的Data Sources属性界面,切换至Connection Pool页面,调整

Initial Capacity: 100

Maximum Capacity:1000

 

4.2   性能问题

使用Weblogic发布的webservice在性能上已知的问题只要有如下几个:

一、数据量

一般来说webservice只适合小数据量的传输,如果一定要使用webservice来进行较大数据量的传输时,需要注意提供和发布的两种webservice需要限定每次提供和接收的数据量,一般尽可能不要太大,太大会导致出现连接超时,例如可以设定每次传输200条数据。

 

二、TEMP表空间

TEMP表空间的大小限制了webservice在传输过程中的数据量和连接量,需要调整期大小以满足数据传输的需要。

 

三、jdbc连接数

从domain的数据源配置上可以看到,Weblogic服务器连接数据库使用的jdbc方式,在配置上默认了该Adminserver可以连接的最大连接量,修改方法见上节中的Connection Pool设置。

 

四、CLOB对象的Realease

具体方法可以见SR ID802897.1,其中使用到如下的方式

alter system set events '60025 trace name context forever';

 

4.3   发布问题

参数变更

对于参数变更的情况需要从IDE Connection那步开始重新发布,推荐将整个项目删掉重新发布一个新的,如果入参是table类型时,删除应用的时候要注意检查下Resources文件夹中的wrapper.sql文件中创建的对象在数据库是否已被删除,若未被删除重新新建一个应用名称一致的webservice会出现参数未改变过来的情况。

 

 

(五)高级应用

5.1   多namespace的合并

入参为table类型的webservice服务,生成的soap协议存在两层namespace:一层为.wsdl,用于最外层的值属性定义,另一层是.wsdl/types/,用于定义的table类型的字段的属性。

有项目需求是只要有一个namespace,那么就需要去除掉另一个namespace,这边选择去除掉/types的定义。

去除webservice服务中相应的http://dev/....wsdl/types/命名空间说明,替换成http://dev/....wsdl

主要修改文件有:…-java-wsdl-mapping.xml:

去除type的package-mapping标签,将下面使用到type的全部替换成http://dev/....wsdl

….wsdl:去除wsdl:definitions定义中的tns1定义,将后续使用到tns1的全部替换成引用tns

 

(六)参考文档

在实际应用中,环境和版本与本文可能不同,如果想了解更多的内容请参考以下文档:

文档名称

说明

How to Release the Temp LOB Space and Avoid Hitting ORA-1652 (文档 ID 802897.1)

 

 

  1. If the Functional Design included a Technical Overview section, duplicate that information here and add additional details.
  1. Add other components above as required
  1. Indicate the specific menu options added to access new forms.

Open and Closed Issues for this Deliverable

  1. Add open issues that you identify while writing or reviewing this document to the open issues section.  As you resolve issues, move them to the closed issues section and keep the issue ID the same.  Include an explanation of the resolution.

    When this deliverable is complete, any open issues should be transferred to the project- or process-level Risk and Issue Log (PJM.CR.040) and managed using a project level Risk and Issue Form (PJM.CR.040).  In addition, the open items should remain in the open issues section of this deliverable, but flagged in the resolution column as being transferred.

 

Open Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Closed Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Oracle实践

Jdev11G发布WS部署Weblogic方案与实现

 

 

 

Author: lazy

Creation Date: 2016-Mar-14

Last Updated: 2016-Mar-14

Document Ref:

Version: 1.0

 

  1. Title, Subject, Last Updated Date, Reference Number, and Version are marked by a Word Bookmark so that they can be easily reproduced in the header and footer of documents.  When you change any of these values, be careful not to accidentally delete the bookmark.  You can make bookmarks visible by selecting Tools->Options…View and checking the Bookmarks option in the Show region.

 

 

Approvals:

<Approver 1>

顾焕

<Approver 2>

 

Copy No. _____

  1. To add additional approval lines, press [Tab] from the last cell in the table above.
  1. You can delete any elements of this cover page that you do not need for your document.  For example, Copy Number is only required if this is a controlled document and you need to track each copy that you distribute.

 

Document Control

 

Change Record

1

Date

Author

Version

Change Reference

 

 

 

 

14-Mar-16

Lazy

1.0

No Previous Document

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reviewers

 

Name

Position

 

 

 

 

 

 

 

 

 

 

 

 

Distribution

 

Copy No.

Name

Location

 

 

 

  1.  

Library Master

Project Library

  1.  

 

Project Manager

  1.  

 

 

  1.  

 

 

  1. The copy numbers referenced above should be written into the Copy Number space on the cover of each distributed copy.  If the document is not controlled, you can delete this table, the Note To Holders, and the Copy Number label from the cover page.

 

Note To Holders:

If you receive an electronic copy of this document and print it out, please write your name on the equivalent of the cover page, for document control purposes.

If you receive a hard copy of this document, please write your name on the front cover, for document control purposes.

Contents

Document Control ii

总体说明 1

文档目的 1

内容 1

环境介绍 1

(一)实现方案 2

(二)实现方式 3

(三)环境间迁移 20

(四)注意事项 21

(五)高级应用 39

(六)参考文档 40

Open and Closed Issues for this Deliverable 41

Open Issues 41

Closed Issues 41

 

  1. To update the table of contents, put the cursor anywhere in the table and press [F9].  To change the number of levels displayed, select the menu option Insert>Index and Tables, make sure the Table of Contents tab is active, and change the Number of Levels to a new value.

 

 

总体说明

 

文档目的

本文档针对目前项目上使用到的webservice开发方式进行一个方案和实现上的整理,涉及的相对比较浅显易懂的的实现方式。

适用于:

使用jdeveloper开发的发布于weblogic服务器上的webservice服务

 

内容

  1. Webservice简介
  2. 实现方案
  3. 实现方式
  4. 环境间迁移
  5. 注意事项
  6. 高级应用
  7. 参考文档

 

环境介绍

  1. JDeveloper Studio 11.1.1.2.0
  2. Oracle Weblogic 10.3.6

 

(一)Webservice简介

1.1   简介

Web Service技术, 能使得运行在不同机器上的不同应用无须借助附加的、专门的第三方软件或硬件, 就可相互交换数据或集成。

1.2   xml web service

1.3   主要支持技术

Web services要使用的主要支持技术有:

XML和XSD

可扩展的标记语言标准通用标记语言下的一个子集)是Web Service平台中表示数据的基本格式。除了易于建立和易于分析外,XML主要的优点在于它既与平台无关,又与厂商无关。XML是由万维网协会(W3C)创建,W3C制定的XML SchemaXSD 定义了一套标准的数据类型,并给出了一种语言来扩展这套数据类型

Web Service平台是用XSD来作为数据类型系统的。当你用某种语言如VB. NET或C# 来构造一个Web Service时,为了符合Web Service标准,所有你使用的数据类型都必须被转换为XSD类型。如想让它使用在不同平台和不同软件的不同组织间传递,还需要用某种东西将它包装起来。这种东西就是一种协议,如 SOAP。

SOAP

SOAP即简单对象访问协议(Simple Object Access Protocol),它是用于交换XML标准通用标记语言下的一个子集)编码信息的轻量级协议。它有三个主要方面:XML-envelope为描述信息内容和如何处理内容定义了框架,将程序对象编码成为XML对象的规则,执行远程过程调用(RPC)的约定。SOAP可以运行在任何其他传输协议上。例如,你可以使用 SMTP,即因特网电子邮件协议来传递SOAP消息,这可是很有诱惑力的。在传输层之间的头是不同的,但XML有效负载保持相同。

Web Service 希望实现不同的系统之间能够用“软件-软件对话”的方式相互调用,打破了软件应用、网站和各种设备之间的格格不入的状态,实现“基于Web无缝集成”的目标。

WSDL

Web Service描述语言WSDL 就是用机器能阅读的方式提供的一个正式描述文档而基于XML标准通用标记语言下的一个子集)的语言,用于描述Web Service及其函数、参数和返回值。因为是基于XML的,所以WSDL既是机器可阅读的,又是人可阅读的。

UDDI

UDDI 的目的是为电子商务建立标准;UDDI是一套基于Web的、分布式的、为Web Service提供的、信息注册中心的实现标准规范,同时也包含一组使企业能将自身提供的Web Service注册,以使别的企业能够发现的访问协议的实现标准。

调用RPC与消息传递

Web Service本身其实是在实现应用程序间的通信。我们有两种应用程序通信的方法:RPC远程过程调用 和消息传递。使用RPC的时候,客户端的概念是调用服务器上的远程过程,通常方式为实例化一个远程对象并调用其方法和属性。RPC系统试图达到一种位置上的透明性:服务器暴露出远程对象的接口,而客户端就好像在本地使用的这些对象的接口一样,这样就隐藏了底层的信息,客户端也就根本不需要知道对象是在哪台机器上。

 

1.4   数据传输样式

SOAP 规范中style与use这两个属性决定SOAP数据的编码样式。

style属性可是两个值中的一个: rpc 或 document 。当属性被设定为文档样式时,客户端使用 XML 模式调用约定;当属性设置成RPC,客户端使用远程过程调用约定。

1)RPC Stype指定包含Web服务调用的XML节点,该节点以Web服务调用方法命名,XML节点依次包含方法调用的各个参数。

2)Document Style指定内直接包含消息,该消息没有SOAP格式限制。服务器的应用层负责将XML文档映射成内存对象(参数、方法调用等等)。

Use属性值决定消息的编码方式:可以是encoded或者是 literal。

1)encoded值表示XML的消息使用类型属性引用抽象数据类型,使用Section 5编码(SOAP规范第五章定义的编码)进行xml的序列化和反序列化。

2) Literal值表示XML的消息使用类型属性或者Element元素引用具体的Schema定义,也就是说,根据具体的Schema将内存对象序列化成XML消息。

 

Style和Use的值进行组合,SOAP可以有四种编码样式,比较常用的如下:

1) RPC/Encoded编码,使用SOAP编码,也称为 Section 5 编码,它由 SOAP 1.1 规范定义。

2) Document/literal编码。

3) RPC/literal编码,它使用 RPC 方法进行调用但使用 XML 自制的方法编入数据。

第一种RPC/Encoded曾在JAVA开发中应用非常广泛;第二种编码样式是DOT NET开发社区使用的缺省编码方式;第三种编码样式是第一种和第二种编码方式的混合,使用RPC的方式传送文档型数据。

 

(一)实现方案

1.1   总体方案说明

对于SOA方式发布的Webservice,部署过程比较复杂,需要安装patch等配置,最终还是决定尝试使用Weblogic发布Webservice服务。

文档中约定如下:

  1. 对外提供服务的一方称为:服务方

2.调用其他系统提供服务的一方称为:消费方

1.2   服务方

通过Jdeveloper将PL/SQL程序发布在Oracle Weblogic服务器上对外提供服务。

使用的方式主要有如下几种:

  1. 通过特定参数条件向外围系统提供数据

实现的方案问题主要在出参上,通过何种方式返回需要的数据可以根据需要进行变通使用,主要通过PL/SQL编写Function,其中:

入参:独立字段

出参:CLOB对象,其中CLOB中可以与各系统约定具体使用何种方式,如:XML或者Json

  1. 接收外围系统传入的数据至接口表

实现的方案问题主要在入参方式上,出参可统一返回样式:只要返回统一格式的成功标识及错误原因,入参的方式上主要有如下几种:

方案一、入参:独立字段,每次只能接收一条数据

方案二、入参:CLOB,CLOB中可以使用约定的样式进行参数的解析

方案三、入参:table类型变量

  1. 传入特定参数返回特定消息

实现上根据实际情况传入相应的参数,程序中调用相应方法生成相应需要返回的信息

 

1.3   消费方

通过PL/SQL调用外围系统发布的Webservice服务。

 

(二)实现方式

2.1   PL/SQL程序

主要说明下入参是table类型变量和CLOB类型的使用。

Table类型

  1. 定义样例

1.1、单表样例

TYPE type_pay_rec IS RECORD(

    source_code             VARCHAR2(50),

payment_number          VARCHAR2(240),

payment_created_person  VARCHAR2(240));

TYPE type_pay_tbl IS TABLE OF type_pay_rec INDEX BY BINARY_INTEGER;

 

1.2、头行表样例

行定义

TYPE inv_apply_lines_rec_type IS RECORD(

          organization_id    NUMBER,

          line_number        NUMBER,

          item_number        VARCHAR2(30),

item_desc          VARCHAR2(240));

TYPE inv_apply_lines_tbl_type IS TABLE OF inv_apply_lines_rec_type INDEX BY BINARY_INTEGER;

 

头定义

TYPE inv_apply_header_rec_type IS RECORD(

         organization_id          NUMBER,

         urgent_level             VARCHAR2(240),

doc_type_id              NUMBER,

line_tbl                 inv_apply_lines_tbl_type);

TYPE inv_apply_header_tbl_type IS TABLE OF inv_apply_header_rec_type INDEX BY BINARY_INTEGER;

 

  1. 入参样例

单表入参

FUNCTION import_data(p_pay_tbl IN type_pay_tbl) RETURN CLOB

 

头行表入参

PROCEDURE inv_oa_apply(p_header_tbl IN inv_apply_header_tbl_type,

 x_result            OUT CLOB);

 

CLOB类型

CLOB类型使用约定的XML结构便于解析,在传入后可以统一的将CLOB字段和XML字段插入到公用的table中,而后统一进行解析获取入参数据。

 

测试样例

测试样例只使用了简单的单个参数入参形式对整个发布过程做说明。

Package special内容如下:

create or replace package cux_testwz_ws_pkg is

  function get_info(p_user_name in varchar2) return varchar2;

end cux_testwz_ws_pkg;

 

Package body内容如下:

create or replace package body cux_testwz_ws_pkg is

function get_info(p_user_name in varchar2) return varchar2 is

    begin

       return p_user_name || 'hello world!';

    end;

end cux_testwz_ws_pkg;

 

2.2   Jdeveloper发布

Step1  创建Database

新建IDE Connections,如下图所示:

说明:

Connection Name:连接名称,自定义

Connection Type:连接类型,默认JDBC

Username:连接数据库的用户名

Password:连接数据库的密码

Driver:使用默认方式:thin

Host Name:数据库的ip

SID:数据库实例名

 

Step2  发布程序包

1.创建Generic Application

 

2.Next创建Project

 

3.切换至IDE Connection是页面,选择当前环境使用的database连接,展开Packages选项,找到需要发布的package,右键选择Publish as Web Service。

Target Project默认,点击Next

Deployment Platform,默认

 

按相应规范调整Web Service Name,Java Package默认,点击Next

 

SOAP Message Format默认RPC/Literal

 

选择需要发布的function或者procedure,点击Next

 

连接匹配信息界面直接全部默认,点击Next

 

后面可以直接finish,切换至Application Navigator界面,可以看到如下样式:

 

Step3  修改Data Source

找到weblogic服务使用的Data Sources名称,服务器上路径为:EBS_domain_DEV/Services/Data Sources

主要修改两个文件中使用的Data Source:

一、Base.java文件

修改前:

修改后:

、web.xml文件

修改前:

修改后:

 

Step4  war文件打包

选择project,右键选择Deploy,选择Webservices

 

这里我们选择Deploy to war

 

点击Next可以看到生成的war文件所在的路径与名称

 

点击Finish,日志显示成功即表示war文件创建成功

 

2.3   Weblogic发布服务

1.进入weblogic控制界面,选择Lock&Edit进行编辑,选择Deployments准备发布。

 

2.选择Install

 

3.点击upload your file(s),上传需要发布的war文件。

 

4.上传文件,点击Next。

 

5.后面一路Next就可以,直到最后的Finish。点击Activate Changes使设置生效。

 

6.切换至Deployments页面,可以看到刚创建的webservice应用,不过此时的状态是Prepared。

 

7.勾选上刚发布的webservice应用,启动服务:Start -> Servicing all requests

 

8.出现如下信息表示服务启动成功,同时看到State状态和Health状态分别为:Active和OK。

 

2.4   调用测试

1.获取发布的webservice的wsdl地址

1.1、展开发布的webservice服务,找到Type为Web Service

2.2、切换至Testing tab页面,展开Name,可以看到有个Test Point为?WSDL的,点击以后会出现wsdl对应的定义信息,其地址就是需要提供出去的wsdl地址。

 

2.使用Soap UI软件进行调用测试

2.1、进入Soap UI软件,选择SOAP新建一个SOAP Project,将获取的wsdl地址放置在对应的地址路径下。

创建后出现如下样式的界面

2.2、将参数中默认的?替换成真实需要传递的参数,点击“运行”按钮,测试返回结果。

至此一个简单的通过jdeveloper发布在weblogic上的webservice发布完成。

 

 

(三)环境间迁移

3.1   迁移事项

已经发布的webservice在不同环境间迁移的时候,为方便起见,可以通过修改部分信息,达到迁移的效果,主要的修改点有如下几种情况:

一、入参是单值和CLOB

这种方式比较简单,修改的也比较简单,从发布过程可以知道我们只需要做以下两个部分的修改

1、…base.java和web.xml文件中的两个Data Resource连接信息,替换成需要迁移的环境信息就可以了

2、重新Deploy生成新的war文件

二、入参为table类型

对于使用table类型变量作为参数的webservice在对database中的package进行发布的时候会自动创建一个Resources文件夹,其中有两个.sql的文件:

…_plsql_ wrapper.sql:该文件中包含了需要创建3个对象:

一、入参定义的record字段object对象定义;

二、基于object的table类型定义;

三、_plsql_wrapper的package定义;

…_plsql_dropper.sql:对wrapper中定义的3个对象进行drop的操作。

由于这两个文件是在数据库发布(不是weblogic发布war的时候)的时候自动创建的,迁移时如果只是直接修改data source而不是从database重新发布的,这两个.sql文件并不会自动创建需要的对象,因而在后续调用系统package时会出现invalid method(未找到wrapper中需要创建的的对象)的问题,这时需要手工创建wrapper.sql文件中的三个对象。而直接重新创建的并不会出现这个问题。

 

 

(四)注意事项

4.1   R12 Weblogic端口问题

R12系统的文件系统结构存在fs1和fs2两个,这也意味着在R12上的Weblogic Console存在两个端口对应的地址,这就导致了发布出去的webservice存在两个端口的情况。这种情况下我们可以创一个不受fs1和fs2切换影响的新的domain。

这里我们例子中创建一个如下信息的domain:

属性

Domain类型

Basic WebLogic Server Domain

Domain名称

DEV_Test_domain

Port

7090

Password

manager0

运行模式

生产模式

 

具体创建方式如下:

1.进入配置命令路径

[appldev@test ~]$ cd $FMW_HOME/wlserver_10.3/common/bin

[appldev@test bin]$ ls

commEnv.sh         config.sh  setPatchEnv.sh  startManagedWebLogic.sh  unpack.sh   wlscontrol.sh   wlst.sh

config_builder.sh  pack.sh    startDerby.sh   stopDerby.sh             upgrade.sh  wlsifconfig.sh

[appldev@test bin]$ ./config.sh

Unable to instantiate GUI, defaulting to console mode.

 

 

 

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Welcome:

--------

 

Choose between creating and extending a domain. Based on your selection,

the Configuration Wizard guides you through the steps to generate a new or

extend an existing domain.

 

 ->1|Create a new WebLogic domain

    |    Create a WebLogic domain in your projects directory.  

 

   2|Extend an existing WebLogic domain

    |    Use this option to add new components to an existing domain and modify     |configuration settings.

 

 

 

 

 

Enter index number to select OR [Exit][Next]> 1

 

2.创建新的domain

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Domain Source:

---------------------

 

Select the source from which the domain will be created. You can create the

domain by selecting from the required components or by selecting from a

list of existing domain templates.

 

 ->1|Choose Weblogic Platform components

    |    You can choose the Weblogic component(s) that you want supported in

    |your domain.

 

   2|Choose custom template

    |    Choose this option if you want to use an existing  template. This

    |could be a custom created template using the Template Builder.

 

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Application Template Selection:

-------------------------------

 

 

 

    Available Templates

    |_____Basic WebLogic Server Domain - 10.3.6.0 [wlserver_10.3]x

    |_____Oracle Enterprise Manager Plugin for EBS - 11.1.1.0 [Oracle_EBS-app1] [2]

    |_____Oracle Enterprise Manager - 11.1.1.0 [oracle_common] [3]

    |_____Oracle WSM Policy Manager - 11.1.1.0 [oracle_common] [4]

    |_____Oracle JRF WebServices Asynchronous services - 11.1.1.0 [oracle_common] [5]

    |_____Oracle E-Business Suite Applications - 11.1.1.0 [Oracle_EBS-app1] [6]

    |_____Oracle JRF - 11.1.1.0 [oracle_common] [7]

    |_____Basic WebLogic SIP Server Domain - 10.3.6.0 [wlserver_10.3] [8]

    |_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.6.0 [wlserver_10.3] [9]

    |_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.6.0 [wlserver_10.3] [10]

 

 

 

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |    Value    |

   _|________|_____________|

   1| *Name: | base_domain |

 

 

 

 

Enter value for "Name" OR [Exit][Previous][Next]> DEV_Test_domain

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Edit Domain Information:

------------------------

 

    |  Name  |      Value      |

   _|________|_________________|

   1| *Name: | DEV_Test_domain |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select the target domain directory for this domain:

---------------------------------------------------

 

    "Target Location" = [Enter new value or use default

"/home/dev/app/fs1/FMW_Home/user_projects/domains"]

 

 

 

 

Enter new Target Location OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                                         |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*User password:" = []

 

 

 

 

Enter new *User password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*Confirm user password:" = []

 

 

 

 

Enter new *Confirm user password: OR [Exit][Reset][Accept]> manager0

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                ********                 |

   3| *Confirm user password: |                ********                 |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Domain Mode Configuration:

--------------------------

 

Enable Development or Production Mode for this domain.

 

 ->1|Development Mode

 

   2|Production Mode

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 2

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Java SDK Selection:

-------------------

 

 ->1|Sun SDK 1.7.0_25 @ /home/dev/app/fs1/EBSapps/comn/util/jdk64

   2|Other Java SDK

 

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [ ]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]> 1

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [x]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

 

 

Enter index number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]> 3

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

 

 

 

Enter value for "Listen port" OR [Exit][Previous][Next]> 7090

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure the Administration Server:

------------------------------------

 

Each WebLogic Server domain must have one Administration Server. The

Administration Server is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7090         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

    5 - Discard Changes

 

 

 

 

Enter option number to select OR [Exit][Previous][Next]>

 

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Creating Domain...

 

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

 

 

**** Domain Created Successfully! ****

 

 

[appldev@test bin]$

 

3.进入刚创建的domain,启动对应的服务

[appldev@test ~]$ cd $FMW_HOME/user_projects/domains/DEV_Test_domain/bin

[appldev@test bin]$ ls

nodemanager  server_migration  service_migration  setDomainEnv.sh  startManagedWebLogic.sh  startWebLogic.sh  stopManagedWebLogic.sh  stopWebLogic.sh

 

[appldev@test bin]$ vi startWebLogic.sh

在获取WLS_USER和PW的地方之前添加:

WLS_USER=weblogic

WLS_PW=manager0

[appldev@test bin]$ nohup startWebLogic.sh

加了nohup以后,关闭telnet窗口,也不会发送weblogic的停止信号,但相关启动信息也无法在屏幕上输出。

登录界面成功后,直接关闭Telnet界面。

 

4.创建Data Sources

4.1 使用Lock&Edit,New一个Generic Data Source

4.2 设置对应的名称

4.3 直接默认,在如下界面输入对应数据库信息

4.4 继续Next,选择需要连接的服务器

4.5 点击Activate changes使设置生效

4.6 进入刚创建的Data Sources属性界面,切换至Connection Pool页面,调整

Initial Capacity: 100

Maximum Capacity:1000

 

4.2   性能问题

使用Weblogic发布的webservice在性能上已知的问题只要有如下几个:

一、数据量

一般来说webservice只适合小数据量的传输,如果一定要使用webservice来进行较大数据量的传输时,需要注意提供和发布的两种webservice需要限定每次提供和接收的数据量,一般尽可能不要太大,太大会导致出现连接超时,例如可以设定每次传输200条数据。

 

二、TEMP表空间

TEMP表空间的大小限制了webservice在传输过程中的数据量和连接量,需要调整期大小以满足数据传输的需要。

 

三、jdbc连接数

从domain的数据源配置上可以看到,Weblogic服务器连接数据库使用的jdbc方式,在配置上默认了该Adminserver可以连接的最大连接量,修改方法见上节中的Connection Pool设置。

 

四、CLOB对象的Realease

具体方法可以见SR ID802897.1,其中使用到如下的方式

alter system set events '60025 trace name context forever';

 

4.3   发布问题

参数变更

对于参数变更的情况需要从IDE Connection那步开始重新发布,推荐将整个项目删掉重新发布一个新的,如果入参是table类型时,删除应用的时候要注意检查下Resources文件夹中的wrapper.sql文件中创建的对象在数据库是否已被删除,若未被删除重新新建一个应用名称一致的webservice会出现参数未改变过来的情况。

 

 

(五)高级应用

5.1   多namespace的合并

入参为table类型的webservice服务,生成的soap协议存在两层namespace:一层为.wsdl,用于最外层的值属性定义,另一层是.wsdl/types/,用于定义的table类型的字段的属性。

有项目需求是只要有一个namespace,那么就需要去除掉另一个namespace,这边选择去除掉/types的定义。

去除webservice服务中相应的http://dev/....wsdl/types/命名空间说明,替换成http://dev/....wsdl

主要修改文件有:…-java-wsdl-mapping.xml:

去除type的package-mapping标签,将下面使用到type的全部替换成http://dev/....wsdl

….wsdl:去除wsdl:definitions定义中的tns1定义,将后续使用到tns1的全部替换成引用tns

 

(六)参考文档

在实际应用中,环境和版本与本文可能不同,如果想了解更多的内容请参考以下文档:

文档名称

说明

How to Release the Temp LOB Space and Avoid Hitting ORA-1652 (文档 ID 802897.1)

 

 

  1. If the Functional Design included a Technical Overview section, duplicate that information here and add additional details.
  1. Add other components above as required
  1. Indicate the specific menu options added to access new forms.

Open and Closed Issues for this Deliverable

  1. Add open issues that you identify while writing or reviewing this document to the open issues section.  As you resolve issues, move them to the closed issues section and keep the issue ID the same.  Include an explanation of the resolution.

    When this deliverable is complete, any open issues should be transferred to the project- or process-level Risk and Issue Log (PJM.CR.040) and managed using a project level Risk and Issue Form (PJM.CR.040).  In addition, the open items should remain in the open issues section of this deliverable, but flagged in the resolution column as being transferred.

 

Open Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Closed Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Closed Issues

 

ID

Issue

Resolution

Responsibility

Target Date

Impact Date

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值