PL/SQL调用JAVA发布的Web Service示例

ORACLE存储过程调用Web Service 1概述 最近在ESB项目中,客户在各个系统之间的服务调用大多都是在oracle存储过程中进行的,本文就oracle存储过程调用web service来进行说明。其他主流数据库,比如mysql和sql service,调用web service的方法这里就不做介绍了,本文主要用来介绍oracle存储过程调用Web Service的方法。 众所周知,在Web Service通过HTTP协议发送请求 阅读详情

Java的web service核心代码如下:

package com.tw.webservice; 
import javax.jws.WebService;

@WebService(targetNamespace = “http://webservice.tw.com/“, endpointInterface = “com.tw.webservice.HelloWorld”, portName = “HelloWorldImplPort”, serviceName = “HelloWorldImplService”) 
public class HelloWorldImpl implements HelloWorld { 
@Override 
public String sayHello() { 
// TODO Auto-generated method stub 
return “Hello World !”; 
} 
@Override 
public String sayHi(String name) { 
// TODO Auto-generated method stub 
return “Hi ” + name; 
}

}
WSDL地址:http://172.20.8.77:8080/ClassicService/services/HelloWorldImplPort?wsdl

在PL/SQL新建function如下:

create or replace function classicService1(name in varchar2) return varchar2 is
   v_namespace        VARCHAR2(1000) := 'http://webservice.tw.com';
   v_service_qname    utl_dbws.qname := utl_dbws.to_qname(v_namespace,'HelloWorldImplService');
   v_port_qname       utl_dbws.qname := utl_dbws.to_qname(v_namespace,'HelloWorldImplPort');
   v_operation_qname  utl_dbws.qname := utl_dbws.to_qname(v_namespace,'sayHi');

   v_service           utl_dbws.service;
   v_call              utl_dbws.call;

   v_int_type          utl_dbws.qname;
   v_string_type       utl_dbws.qname;

   v_request_params    utl_dbws.anydata_list; -- RPC style only
   v_response_anydata  AnyData;               -- RPC style only

   v_request_xmltype   XmlType;               -- Document style only
begin
   v_service := utl_dbws.create_service(
   HttpUriType('http://172.20.8.77:8080/ClassicService/services/HelloWorldImplPort?wsdl'), v_service_qname);

   v_call := utl_dbws.create_call(v_service, NULL, v_operation_qname);

   utl_dbws.set_property(v_call, 'SOAPACTION_USE',    'TRUE');
   utl_dbws.set_property(v_call, 'SOAPACTION_URI',    'getName');
   utl_dbws.set_property(v_call, 'ENCODINGSTYLE_URI',
    'http://schemas.xmlsoap.org/soap/encoding/');  
   utl_dbws.set_property(v_call, 'OPERATION_STYLE',   'rpc');

   v_int_type    := utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'int');
   v_string_type := utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');

   utl_dbws.add_parameter(v_call, 'name',       v_string_type, 'ParameterMode.IN');
   utl_dbws.set_return_type(v_call, v_string_type);  

   v_request_params(0) := AnyData.ConvertVarchar2(name);

   v_response_anydata := utl_dbws.invoke(v_call, v_request_params);

   utl_dbws.release_call(v_call);
   utl_dbws.release_service(v_service);

  return(v_response_anydata.accessVarchar2);
EXCEPTION
      WHEN OTHERS THEN
        RETURN substr(sqlerrm,0,3000);
end classicService1;

经测试
1.service_qname、port_qname、operation_qname可以只定义成varchar2类型也能运行,但还是建议定义成utl_dbws.qname和底层保持一致。
2.utl_dbws.set_property必须要设置,否则报错:
ORA-29532: Java 调用被未捕获的 Java 异常错误终止: javax.xml.rpc.soap.SOAPFaultException: Message part name was not recognized. (Does it exist in service WSDL?)
3.这部分也是必须指定的,否则报 javax.xml.rpc.soap.SOAPFaultException或者参数异常
v_string_type := utl_dbws.to_qname(‘http://www.w3.org/2001/XMLSchema‘, ‘string’);

utl_dbws.add_parameter(v_call, ‘name’, v_string_type, ‘ParameterMode.IN’);
utl_dbws.set_return_type(v_call, v_string_type);

此外,还没想到方法调用无参数的函数,如这里的sayHello方法。

Oracle E-Business Suite R12 中,业务单据(如发票、采购订单、工单、付款等)的创建、更新、过账、冲销等操作,99 % 以上都通过“标准 API / 公共包装 API(Publ 本文系统介绍了Oracle EBS R12中各业务单据的标准API调用方式,重点梳理了财务、供应链、制造、项目、人事和主数据六大领域常用API清单。标准API分为PL/SQL和Java/Web-Service两种形态,覆盖发票、订单、付款、物料移动等核心业务操作。文章详细说明各API的关键参数、调用方式及注意事项,并提供了供应商发票创建的PL/SQL示例,同时推荐通过Integration Repository和eTRM查询API完整定义。文中四张分类表格可直接作为API调用参考手册使用,特别适用于系统集成 阅读详情

相关推荐

告别上位机!用MCGS触摸屏+FTP服务器,5分钟搞定工控机文件自动同步

本文介绍了一种工业自动化领域的高效解决方案,通过MCGS触摸屏结合FTP服务器实现工控机文件的自动同步,无需开发上位机软件。该方案特别适用于图像采集、参数同步、数据备份等场景,具有成本低、可靠性高、维护简便等优势。详细配置指南和实战案例帮助用户快速实现零代码文件同步。

weixin_30872499的博客 564

PLSQL调用webservice

  1.   用途简介 为什么要在Oracle中访问WebService?在系统实现中,有时会有直接在数据库端利用触发器、存储过程等方式进行数据传递、分发的业务,而其中可能会涉及一些业务逻辑,为了处理这些业务逻辑,并简单起见,可以直接在触发器或存储过程中调用一些java类或WebService。 2.   准备工作 1、首先保证Oracle为完全安装(本文均以10.2g); 2、下载...

weixin_33895516的博客 680

射频工程师必须了解的S参数四项要点

本文围绕单端 6 英寸走线的 S 参数展开深入分析,核心包含四项关键要点:低频下导线电学长度远小于信号波长,S11 呈大负分贝值、S21 接近 0 分贝;端口与走线的阻抗不匹配引发反射叠加,形成 S11 首个峰值(对应传输线四分之一波长频率);S21 相位可作为一致性检查依据,其 90° 相位差与 S11 峰值吻合;理想建模中 S11 峰值随频率上升因损耗下降,实际测量因连接器等阻抗不连续性,S11 会出现振荡上升。分析依托 Keysight ADS 工具与电磁求解器原理,为 S 参数解读提供科学支撑。

一只豌豆象的博客 1294

PLSQL 调用form-data格式的Webservice接口

PLSQL 调用form-data格式的Webservice接口

qq_43649830的博客 796

时间同步中 TOD 与GPRMC和IRIG-B的区别

时间同步中 TOD 与GPRMC和IRIG-B的区别

ftdlk的博客 1741

数控弯管机xyz转换ybc的算法_数控弯管机技术的更新和应用.pdf

您所在位置:网站首页 > 海量文档&nbsp>&nbsp汽车/机械/制造&nbsp>&nbsp机械/模具设计数控弯管机技术的更新和应用.pdf3页本文档一共被下载:次,您可全文免费在线阅读后下载本文档。 下载提示1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。2.该文档所...

weixin_31493101的博客 1536

plsql调用webservice(https协议基于soap数据协议)

本文章使用plsql的utl_http包调用webservice接口。本人入门级水平 写的不好 勿喷。调用 https接口 首先需设置oracle wallet钱包, 首先需要把网站证书添加到wallet钱包。1.下载网站证书(具体如何下载请百度)2.创建wallet    (1)创建钱包位置文件夹    $ mkdir -p /u01/app/oracle/admin/DB11G/wallet ...

kevin_virus的博客 5227

基于单目视觉的四旋翼定点降落——如何通过mavros控制pixhawk(二)

    一直拖了这么久没有更新,怪我太懒啦~~~ 今天要特别感谢舒仔仔同学,我的好队友帮我写了这篇博文。这篇文章主要讲了如何通过mavros来控制pixhawk。硬件逻辑是这样子,我们先搞一个odroid(土豪上TX2),再用usb线将odroid与pixhawk连接。所以,odroid发送控制指令来控制pixhawk飞行。pixhawk与外界的通信协议是mavlink。ROS下面有个包叫mavr...

zhengyuxin0507的博客 1万+

oracle plsql调用webservice 实例

1、WSDL描述文件 2、plsql过程 3、结果

风子杨的博客中心 1900

【0000】PostgreSQL V17.4 内核源码剖析专栏(2017 ~ 2025.11.28 更新)

本专栏将会持续更新,直到将PostgreSQL V13.2源码涉及的所有原理、技术剖析完成为止。每一篇文章都是经过多次的源码阅读 + 调试,得以验证之后才梳理成文章形式。最终该专栏的文章数量应该在一万篇或以下,这也是文章序号从【0000】开始的缘故。通过本专栏的学习,能够让你掌握PostgreSQL数据库中的每个技术背后,底层的实现原理。

Postgres 数据库内核开发工程师 1万+

中科大大数据学院2023年保研夏令营机试题目【无offer,直接放题了~】(2023.07.22下午14:35-17:35考试)

给定一串数字,最后一个数是0表示结尾,表示数字串的终止,为无效数字。将该数字串存储在双向链表中,判断是否为回文串,若是,则输出Yes,否则输出No.

m0_51339444的博客 1927

从PL/SQL调用web services实例

web services是目前比较流行的系统之间信息交互的一种方式,近段研究了下通过Oracle数据库utl_http包调用web services,以下为例子,基于Oracle 11gr2测试。 此两种方式基本相似,只是在写法、调用上有些出入。涉及的web services服务器端代码较简单,采用axis2(v1.5.4)实现,可直接利用axis官方提供的例子。 附:web services

yehangchuan11的专栏 3704

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

PL/SQL 作为Web Service客户端

详细的文章见 http://www.oracle-base.com/articles/10g/utl_dbws-10g.php 如果执行loadjar没有sys用户的密码,可以用 登录操作系统,使用sqlplus / as sysdba登录数据库,然后执行 CALL dbms_java.loadjava(' -r -v -definer -g public  /u01/oracle/11g

linjinxiao的专栏 966

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

PL/SQL语言的网络编程

PL/SQL(Procedural Language/Structured Query Language)是Oracle公司推出的一种过程化编程语言,专门与SQL语言结合使用,提供了强大的数据处理能力。随着互联网的发展,编程和数据处理的需求不断增加,PL/SQL在网络编程方面也展现出了其独特的优势。凭借其强大的数据处理能力、简洁的语法结构和与SQL的紧密结合,PL/SQL可以帮助开发者构建高效的网络应用。随着技术的不断进步,PL/SQL的应用前景将更加广阔,期待未来在网络编程中能够发挥更大的作用。

2501_90485731的博客 445

oracle直接调用web services

在oracle中直接调用web services怎么操作,在网上查了很久,相关资料,比较少。 在这里整理一下,给需要的童鞋们做参考。。 Window下oracle开发web services 1,  去oracle官网上下载dbws-callout-utility-10131.zip 地址:http://www.oracle-base.com/articles/10g/utl_dbws...

百纳百川 148

Using PL/SQL APIs as Web Services

Overview Oracle E-Business Suite Integrated SOA Gateway allows you to use PL/SQL application programming interfaces (APIs) to insert or update data in Oracle E-Business Suite. APIs are sto...

weixin_30379531的博客 214

在Oracle AS 10g 上发布pl/sql webservice.

Common:1. Config.xml    Global eOffice Web Service    Global eOffice Web Service    ./geows.ear    ./tmp    /geows                  asp01/inet21         jdbc:oracle:thin:@192.168.0.71:1521:ORCL

Alex Zhang's Blog 2143

pl/sql调用webservice说明

1.             用途简介 为什么要在Oracle中访问WebService?在系统实现中,有时会有直接在数据库端利用触发器、存储过程等方式进行数据传递、分发的业务,而其中可能会涉及一些业务逻辑,为了处理这些业务逻辑,并简单起见,可以直接在触发器或存储过程中调用一些java类或WebService。 2.             准备工作 1、首先保证Oracle为完全安装(

慢慢求索 2789

使用PL/SQL来创建RESTful Web Services

Reference: https://docs.oracle.com/cd/E56351_01/doc.30/e87809/installing-REST-data-services.htm#AELIG7217 ...

cpuku88442的专栏 299

oracle函数调用webservices

1,  去oracle官网上下载dbws-callout-utility-10131.zip http://www.oracle-base.com/articles/10g/utl_dbws-10g.php 地址:http://hi.baidu.com/love_lidx/item/ce779042995612a261d7b99f 2,  解压后放到oracle安装目录下的/sqlj/lib

ling384827360的专栏 797

Using UTL_DBWS to Make a Database 11g Callout to a Document Style Web Service

In this Document Purpose Scope Details APPLIES TO: Oracle Database - Enterprise Edition - Version 11.1.0.6 and later Web Services - ...

aofan9566的博客 157
上一篇: kill掉锁表和锁进程
下一篇: python应用小例子
小德
博客等级 码龄18年 37粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值