在oracle10.1.2中用function调用webservcie出现如下错误:
"ORA-29541: class SYS.oracle/jpub/runtime/dbws/DbwsProxy could not be resolved"
这是因为需要导入一些包(详情可参考http://www.oracle-base.com/articles/10g/utl_dbws10g.php)
First, download the latest copy of the dbwsclient.jar file:
Extract the jar file from the zip file into the $ORACLE_HOME/sqlj/lib directory.
# Load into the SYS schema.
export PATH=/u01/app/oracle/product/10.2.0/db_1/bin:$PATH
cd /u01/app/oracle/product/10.2.0/db_1/sqlj/lib
# 10gR2
loadjava -u sys/password -r -v -f -genmissing -s -grant public dbwsclientws.jar
# 11g
loadjava -u sys/password -r -v -f -genmissing -s -grant public dbwsclientws.jar
原文中提到也可以导入单个的schema,但是我导入后还是有问题。In Oracle 10g the UTL_DBWS
package is loaded by default,所以我就用sys.UTL_DBWS.
我下载的是第二个包。
在导入的过程中正常情况下没有错误,那就要恭喜你了。可是事与愿违,经常会产生错误,所以当运行webservice代码时还会报上面的错误!!!
解决如下:
解压dbwsclientws.jar 找到oracle下的jpub/runtime/dbws整个目录,拷贝出来,重新打包,再重新单独导入这个包即可。将我重新打包的jar上传一下(看附件)
loadjava -u sys/password -r -v -f -genmissing -s -grant public dbwsproxy.jar
示例:
以下是我的wsdl:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://192.168.88.126:8400/axis/BCWebService.jws" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://192.168.88.126:8400/axis/BCWebService.jws" xmlns:intf="http://192.168.88.126:8400/axis/BCWebService.jws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
--> <script></script>
- <schema targetNamespace="http://192.168.88.126:8400/axis/BCWebService.jws" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="ArrayOf_xsd_string">
- <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="mainRequest">
<wsdl:part name="args" type="impl:ArrayOf_xsd_string" />
</wsdl:message>
- <wsdl:message name="validateXMLResponse">
<wsdl:part name="validateXMLReturn" type="xsd:string" />
</wsdl:message>
<wsdl:message name="mainResponse" />
- <wsdl:message name="validateXMLRequest">
<wsdl:part name="medicalGroup" type="xsd:string" />
<wsdl:part name="requestTicket" type="xsd:string" />
<wsdl:part name="userID" type="xsd:string" />
<wsdl:part name="password" type="xsd:string" />
<wsdl:part name="claimDate" type="xsd:string" />
<wsdl:part name="memberKey1" type="xsd:string" />
<wsdl:part name="memberKey2" type="xsd:string" />
<wsdl:part name="doctorCode" type="xsd:string" />
</wsdl:message>
- <wsdl:portType name="BCWebService">
- <wsdl:operation name="validateXML" parameterOrder="medicalGroup requestTicket userID password claimDate memberKey1 memberKey2 doctorCode">
<wsdl:input message="impl:validateXMLRequest" name="validateXMLRequest" />
<wsdl:output message="impl:validateXMLResponse" name="validateXMLResponse" />
</wsdl:operation>
- <wsdl:operation name="main" parameterOrder="args">
<wsdl:input message="impl:mainRequest" name="mainRequest" />
<wsdl:output message="impl:mainResponse" name="mainResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="BCWebServiceSoapBinding" type="impl:BCWebService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="validateXML">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="validateXMLRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="validateXMLResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.88.126:8400/axis/BCWebService.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="main">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="mainRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="mainResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.88.126:8400/axis/BCWebService.jws" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="BCWebServiceService">
- <wsdl:port binding="impl:BCWebServiceSoapBinding" name="BCWebService">
<wsdlsoap:address location="http://192.168.88.126:8400/axis/BCWebService.jws" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
下面是oracle function:
-------------------------------------------------------------------------------------
create or replace
FUNCTION get_city_from_zipcode (p_zipcode IN VARCHAR2)
RETURN VARCHAR2
AS
l_service sys.UTL_DBWS.service;
l_call sys.UTL_DBWS.call;
l_result ANYDATA;
l_wsdl_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_service_qname sys.UTL_DBWS.qname;
l_port_qname sys.UTL_DBWS.qname;
l_operation_qname sys.UTL_DBWS.qname;
l_input_params sys.UTL_DBWS.anydata_list;
BEGIN
l_wsdl_url := 'http://192.168.88.126:8400/axis/BCWebService.jws?wsdl';
l_namespace := 'http://192.168.88.126:8400/axis/BCWebService.jws';
l_service_qname := sys.UTL_DBWS.to_qname(l_namespace, 'BCWebServiceService');
l_port_qname := sys.UTL_DBWS.to_qname(l_namespace, 'BCWebService');
l_operation_qname := sys.UTL_DBWS.to_qname(l_namespace, 'validateXML');
l_service := sys.UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
l_call := sys.UTL_DBWS.create_call (
service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname);
l_input_params(0) := ANYDATA.ConvertVarchar2('55555');
l_input_params(1) := ANYDATA.ConvertVarchar2('11111111');
l_input_params(2) := ANYDATA.ConvertVarchar2('11111111');
l_input_params(3) := ANYDATA.ConvertVarchar2('11111111');
l_input_params(4) := ANYDATA.ConvertVarchar2('20091103');
l_input_params(5) := ANYDATA.ConvertVarchar2('11111111');
l_input_params(6) := ANYDATA.ConvertVarchar2('11111111');
l_input_params(7) := ANYDATA.ConvertVarchar2('55555');
l_result := sys.UTL_DBWS.invoke (
call_handle => l_call,
input_params => l_input_params);
sys.UTL_DBWS.release_call (call_handle => l_call);
sys.UTL_DBWS.release_service (service_handle => l_service);
RETURN ANYDATA.AccessVarchar2(l_result);
END;
---------------------------------------------------------------------------------------------------------------------
执行成功!
分享到:
相关推荐
在Oracle数据库系统中,"ORA-01036:非法的变量名/编号"是一个常见的错误,通常出现在PL/SQL代码或者SQL查询语句中,当你尝试使用一个不正确或者未定义的变量时,Oracle数据库会抛出这个错误。这个错误可能是由于...
http://tomcat.apache.org/download-70.cgi http://tomcat.apache.org/download-70.cgi
### ora-01033: Oracle Initialization or Shutdown in Progress 解决方法 #### 一、问题背景及原因 **标题**: “ora-01033: Oracle initialization or shutdown in progress 解决方法” **描述**: “ora-01033: ...
在Oracle数据库管理中,"ORA-00990: 权限缺失或无效"是一个常见的错误代码,它表示用户尝试执行的操作没有足够的权限。这个错误通常发生在试图访问、修改或者管理数据库对象(如表、视图、索引等)时。在本篇文章中...
在Oracle数据库中,"ORA-00904"是一个常见的错误代码,它表示尝试引用一个不存在或无效的标识符。在这个场景下,错误信息提到的是"WM_CONCAT"函数,这表明在Oracle 19c数据库环境中,用户尝试使用WM_CONCAT函数,但...
NULL 博文链接:https://springlin.iteye.com/blog/1520668
oracle12c程序连接时异常: ORA-01017: 用户名/口令无效; 登录被拒绝 的解决方案。
### 如何处理错误ORA-29275:部分多字节字符 #### 问题背景与描述 在Oracle数据库操作过程中,用户可能会遇到一个特定的错误提示——ORA-29275:部分多字节字符。这一错误通常出现在执行查询`SELECT * FROM V$...
ORA-32001:write to spfile requested but no spfile is in use请求写入spfile,但没有使用spfile的解决方法 在输入以下语句中报了这样的错误: SQL>alter system set control_files=’/u01/app/oracle/oradata/prod/...
ORA-00604: 递归SQL层1出现错误 ORA-03106: 致命的双工通信协议错误 ORA-02063: 紧接着line(源于dblink) 以及 ORA-04052: 在查找远程对象时出错 ORA-00604: 递归SQL层1出现错误 ORA-03120: 双工转换例行程序:整数...
#### ORA-00120: Oracle Client Not Installed Oracle客户端未安装。这可能是由于缺少必要的客户端组件或配置错误。 #### ORA-00121: DISPATCHERS Parameter Not Set 未设置DISPATCHERS参数。这可能是由于配置错误...
ORA-06592: CASE_NOT_FOUND ORA-06592 是一个常见的错误信息,通常发生在 CASE 语句格式有误时。这种错误通常是由于开发者在编写 CASE 语句时,忘记了某个分支语句,导致 Oracle 无法执行 CASE 语句。解决这个错误...
### Oracle 12c ORA-01017 错误详解及解决方案 #### 错误概述 在Oracle数据库管理过程中,用户可能会遇到ORA-01017错误:“用户名/口令无效;登录被拒绝”。这一错误通常出现在尝试连接数据库时,提示提供的用户名...
oracle网络配置(listener_ora-sqlnet_ora-tnsnames_ora).mht
ORA-12154: TNS: 无法解析指定的连接标识符的解决方法
在oracle里面运行一下,解决Exception java.sql.SQLException ORA-00600 内部错误代码
最近在工作中遇到了一个问题,错误是Oracle dbca时报错:ORA-12547: TNS:lost contact,通过查找相关的资料终于找到了解决的方法,下面分享给大家,话不多说了,来一起看看详细的介绍吧。 环境: OS:RHEL6.5 x86-...
解决方法是在两个节点都做 $ su root's Password:# mkdir /var/opt/oracle# chown oracle:dba /var/opt/oracle# chmod -R 777 /var/opt/oracle# ln -sf /etc/srvConfig.loc /var/opt/oracle/srvConfig.loc# ls -l /...