oracle webservice

Oracle stored procedure调用web service

 

create or replace FUNCTION TESTBCWEBSERVICE 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_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;

 

以下是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>
- < wsdl:types >
- < 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 ">
- < complexContent >
- < 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 =" userID " type =" xsd:string " />
  < wsdl:part name =" password " type =" xsd:string " />
     </ wsdl:message >
- < wsdl:portType name =" BCWebService ">
- < wsdl:operation name =" main " parameterOrder =" args ">
  < wsdl:input message =" impl:mainRequest " name =" mainRequest " />
  < wsdl:output message =" impl:mainResponse " name =" mainResponse " />
  </ wsdl:operation >
- < 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:portType >
- < wsdl:binding name =" BCWebServiceSoapBinding " type =" impl:BCWebService ">
  < wsdlsoap:binding style =" rpc " transport =" http://schemas.xmlsoap.org/soap/http " />
- < 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: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: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 >
注意其中蓝色字的对应
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值