Using utl_dbws to call web service

We're calling a web service using utl_dbws and getting a response but the problem is the parameters. I haven't been able to find much documentation about how to use the utl_dbws package and have only one example to work from so could do with some expert help.
The following code calls the webservice:
procedure call_web_service(p_application_key in number,
out_success_message out varchar2)
is
v_service utl_dbws.service;
v_call utl_dbws.call;
v_service_qname utl_dbws.qname;
v_port_qname utl_dbws.qname;
v_operation_qname utl_dbws.qname;
v_string_type_qname utl_dbws.qname;
v_return anydata;
v_send_data anydata;
v_return_string varchar2 (100);
v_return_length number;
v_parameter_string varchar2(32767);
v_params utl_dbws.anydata_list;
v_interview_xml xmltype;
v_policy_number varchar2(14);
-- return parameters
v_interviewId varchar2(1000);
v_statusType varchar2(1000);
v_error_reason varchar2(1000);
begin
message_handler.set_module_name('ostp_to_xpb.call_web_service');
message_handler.set_current_process('retrieve generated xml');
begin
     select upload_xml, extractvalue(upload_xml, '/interview/externalReferenceNumber') policy_number
     into v_interview_xml, v_policy_number
          from xpb_upload_data
     where application_key = p_application_key
          and extractvalue(upload_xml, '/interview/externalReferenceNumber') is not null;
--dbms_output.put_line('xml retrieved');
     exception
     when no_data_found then     
          v_success_message := 'No xml found for application_key = '||p_application_key;
          raise v_procedure_error;
     end;
     message_handler.set_current_process('call web service');
-- create service
v_service_qname := utl_dbws.to_qname (null, 'xpertBridge');
v_service := utl_dbws.create_service (v_service_qname);
-- create call
v_port_qname := utl_dbws.to_qname (null, 'xpertBridgePort');
v_operation_qname :=
utl_dbws.to_qname
('http://m0154ukdox1/xpertBridgeEDSLV/services/xpertBridge',
'orcaAppUpload'
v_call := utl_dbws.create_call (v_service, v_port_qname, v_operation_qname);
-- set endpoint
utl_dbws.set_target_endpoint_address
(v_call,
'http://m0154ukdox1/xpertBridgeEDSLV/services/xpertBridge'
-- set type of input and output parameters
v_string_type_qname :=
utl_dbws.to_qname ('http://www.w3.org/2001/XMLSchema', 'string');
utl_dbws.add_parameter (v_call,
'orcaXml',
v_string_type_qname,
'ParameterMode.IN'
utl_dbws.add_parameter (v_call,
'interviewId',
v_string_type_qname,
'ParameterMode.OUT'
utl_dbws.add_parameter (v_call,
'status',
v_string_type_qname,
'ParameterMode.OUT'
utl_dbws.add_parameter (v_call,
'errorReason',
v_string_type_qname,
'ParameterMode.OUT'
utl_dbws.set_return_type (v_call, v_string_type_qname);
-- convert xmltype to string for call
select xmlserialize(document v_interview_xml)
into v_parameter_string
from dual;
v_params (1) := anydata.convertvarchar(v_parameter_string);
-- call
v_return := utl_dbws.invoke (v_call, v_params);
-- values which can be returned are Success / MessageError / ApplicationError
v_return_string := v_return.accessvarchar2;
dbms_output.put_line ('Message returned is: ' || nvl(v_return_string, 'No success message returned'));
-- retrieve out parameters
v_interviewId := v_params(2).accessvarchar2;
dbms_output.put_line ('Message returned is: ' || nvl(v_interviewId, 'No interviewId returned'));
v_statusType := v_params(3).accessvarchar2;
dbms_output.put_line ('Message returned is: ' || nvl(v_statusType, 'No status type returned'));
v_error_reason := v_params(4).accessvarchar2;
dbms_output.put_line ('Message returned is: ' || nvl(v_error_reason, 'No error reason returned'));
-- release call
utl_dbws.release_call ( v_call );
-- release services
utl_dbws.release_service ( v_service );
message_handler.set_module_finish;
exception
when others then
out_success_message := message_handler.formatted_error_message;
end call_web_service;
Here is an excerpt from the WSDL relating to the call being made:
     <xs:element name="orcaAppUpload">
                    <xs:annotation>
                         <xs:documentation xml:lang="en">Message payload XML</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                         <xs:sequence>
                              <xs:element name="orcaXml" type="xs:string"/>
                         </xs:sequence>
                    </xs:complexType>
               </xs:element>
               <xs:element name="orcaAppUploadResponse">
                    <xs:complexType>
                         <xs:sequence>
                              <xs:element name="interviewId" type="xs:string">
                                   <xs:annotation>
                                        <xs:documentation xml:lang="en">Interview identifier used to access the interview from UI</xs:documentation>
                                   </xs:annotation>
                              </xs:element>
                              <xs:element name="status" type="tns:StatusType"/>
                              <xs:element name="errorReason" type="xs:string" minOccurs="0">
                                   <xs:annotation>
                                        <xs:documentation xml:lang="en">Only included if an error has occured </xs:documentation>
                                   </xs:annotation>
                              </xs:element>
                         </xs:sequence>
                    </xs:complexType>
               </xs:element>
               <xs:simpleType name="StatusType">
                    <xs:restriction base="xs:string">
                         <xs:enumeration value="Success"/>
                         <xs:enumeration value="MessageError">
                              <xs:annotation>
                                   <xs:documentation xml:lang="en">MessageError arises if the request payload was
rejected by xpertBridge. This might be because it does not validate against the
expected schema. Alternatively, a business rule is not satisfied.</xs:documentation>
                              </xs:annotation>
                         </xs:enumeration>
                         <xs:enumeration value="ApplicationError">
                              <xs:annotation>
                                   <xs:documentation xml:lang="en">ApplicationError would indicate application or system
error or exception occured in xpertBridge while processing the request.</xs:documentation>
                              </xs:annotation>
                         </xs:enumeration>
                    </xs:restriction>
               </xs:simpleType>
          </xs:schema>
     <wsdl:message name="orcaAppUploadReq">
          <wsdl:part name="orcaAppUpload" element="tns:orcaAppUpload"/>
     </wsdl:message>
     <wsdl:message name="orcaAppUploadResp">
          <wsdl:part name="orcaAppUploadResponse" element="tns:orcaAppUploadResponse"/>
     </wsdl:message>
     <wsdl:portType name="xpertBridgePort">
          <wsdl:operation name="orcaAppUpload">
               <wsdl:documentation>Upload (typically paper) application from ORCA/Ingenium</wsdl:documentation>
               <wsdl:input message="tns:orcaAppUploadReq"/>
               <wsdl:output message="tns:orcaAppUploadResp"/>
          </wsdl:operation>
     </wsdl:portType>
etc.
The error being returned is the following:
ostp_to_xpb.call_web_service.call web service.ORA-29532: Java call terminated by uncaught Java exception: unexpected element name: expected=interviewId, actual=status
Initially I started the params at params(0) but when I received the response above I thought it might solve the problem by starting at 1 - try anything :-) but still had the same response.
I'm now out of ideas!

UTL_DBWS is not part of XDB, XDB is more about being the web service, rather than calling a web service. Here's an example of using UTL_HTTP to test a XML DB Database Native Web Service which may help
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 17 08:23:14 2009
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> spool password.log
SQL> --
SQL> connect sys/oracle as sysdba
Connected.
SQL> --
SQL> def USERNAME=DBNWS
SQL> --
SQL> def PASSWORD=DBNWS
SQL> --
SQL> def HOSTNAME=&1
SQL> --
SQL> DROP USER &USERNAME CASCADE
  2  /
old   1: DROP USER &USERNAME CASCADE
new   1: DROP USER DBNWS CASCADE
User dropped.
SQL> grant connect, resource to &USERNAME identified by &PASSWORD
  2  /
old   1: grant connect, resource to &USERNAME identified by &PASSWORD
new   1: grant connect, resource to DBNWS identified by DBNWS
Grant succeeded.
SQL> begin
  2    dbms_network_acl_admin.drop_acl('localhost.xml');
  3  end;
  4  /
PL/SQL procedure successfully completed.
SQL> begin
  2    dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for &HOSTNAME', '&USERNAME', true, 'connect');
  3    dbms_network_acl_admin.assign_acl('localhost.xml', '&HOSTNAME');
  4  end;
  5  /
old   2:   dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for &HOSTNAME', '&USERNAME', true, 'connect');
new   2:   dbms_network_acl_admin.create_acl('localhost.xml', 'ACL for localhost', 'DBNWS', true, 'connect');
old   3:   dbms_network_acl_admin.assign_acl('localhost.xml', '&HOSTNAME');
new   3:   dbms_network_acl_admin.assign_acl('localhost.xml', 'localhost');
PL/SQL procedure successfully completed.
SQL> COMMIT
  2  /
Commit complete.
SQL> GRANT XDB_WEBSERVICES TO &USERNAME
  2  /
old   1: GRANT XDB_WEBSERVICES TO &USERNAME
new   1: GRANT XDB_WEBSERVICES TO DBNWS
Grant succeeded.
SQL> GRANT XDB_WEBSERVICES_OVER_HTTP TO &USERNAME
  2  /
old   1: GRANT XDB_WEBSERVICES_OVER_HTTP TO &USERNAME
new   1: GRANT XDB_WEBSERVICES_OVER_HTTP TO DBNWS
Grant succeeded.
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> create or replace function GET_SQRT (INPUT_VALUE number) return number
  2  as
  3  begin
  4    return SQRT(2);
  5  end;
  6  /
Function created.
SQL> select GET_SQRT(2)
  2    from dual
  3  /
GET_SQRT(2)
1.41421356
SQL> VAR URL VARCHAR2(4000)
SQL> --
SQL> BEGIN
  2    :url :=   'http://&USERNAME:&PASSWORD@&HOSTNAME:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/GET_SQRT';
  3  end;
  4  /
old   2:   :url :=   'http://&USERNAME:&PASSWORD@&HOSTNAME:' || dbms_xdb.getHttpPort() || '/orawsv/&USERNAME/GET_SQRT';
new   2:   :url :=   'http://DBNWS:DBNWS@localhost:' || dbms_xdb.getHttpPort() || '/orawsv/DBNWS/GET_SQRT';
PL/SQL procedure successfully completed.
SQL> print url
URL
http://DBNWS:DBNWS@localhost:80/orawsv/DBNWS/GET_SQRT
SQL> --
SQL> set long 100000 pages 0 lines 256
SQL> --
SQL> select     httpuritype( :url || '?wsdl' ).getXML() from dual
  2  /
<definitions name="GET_SQRT" targetNamespace="http://xmlns.oracle.com/orawsv/DBNWS/GET_SQRT" xmlns="http://schemas.xmlsoap.org/wsdl/
" xmlns:tns="http://xmlns.oracle.com/orawsv/DBNWS/GET_SQRT" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://
schemas.xmlsoap.org/wsdl/soap/">
  <types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/DBNWS/GET_SQRT" elementFormDefault="qualified">
      <xsd:element name="SNUMBER-GET_SQRTInput">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="INPUT_VALUE-NUMBER-IN" type="xsd:double"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="GET_SQRTOutput">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="RETURN" type="xsd:double"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </types>
  <message name="GET_SQRTInputMessage">
    <part name="parameters" element="tns:SNUMBER-GET_SQRTInput"/>
  </message>
  <message name="GET_SQRTOutputMessage">
    <part name="parameters" element="tns:GET_SQRTOutput"/>
  </message>
  <portType name="GET_SQRTPortType">
    <operation name="GET_SQRT">
      <input message="tns:GET_SQRTInputMessage"/>
      <output message="tns:GET_SQRTOutputMessage"/>
    </operation>
  </portType>
  <binding name="GET_SQRTBinding" type="tns:GET_SQRTPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="GET_SQRT">
      <soap:operation soapAction="GET_SQRT"/>
      <input>
        <soap:body parts="parameters" use="literal"/>
      </input>
      <output>
        <soap:body parts="parameters" use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="GET_SQRTService">
    <documentation>Oracle Web Service</documentation>
    <port name="GET_SQRTPort" binding="tns:GET_SQRTBinding">
      <soap:address location="http://localhost:80/orawsv/DBNWS/GET_SQRT"/>
    </port>
  </service>
</definitions>
SQL> set serveroutput on
SQL> --
SQL> DECLARE
  2    V_SOAP_REQUEST      XMLTYPE := XMLTYPE(
  3  '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  4          <SOAP-ENV:Body>
  5                  <m:SNUMBER-GET_SQRTInput xmlns:m="http://xmlns.oracle.com/orawsv/&USERNAME/GET_SQRT">
  6                          <m:INPUT_VALUE-NUMBER-IN>2</m:INPUT_VALUE-NUMBER-IN>
  7                  </m:SNUMBER-GET_SQRTInput>
  8          </SOAP-ENV:Body>
  9  </SOAP-ENV:Envelope>');
10    V_SOAP_REQUEST_TEXT CLOB := V_SOAP_REQUEST.getClobVal();
11    V_REQUEST           UTL_HTTP.REQ;
12    V_RESPONSE          UTL_HTTP.RESP;
13    V_BUFFER            VARCHAR2(1024);
14  BEGIN
15
16    V_REQUEST := UTL_HTTP.BEGIN_REQUEST(URL => :URL, METHOD => 'POST');
17    UTL_HTTP.SET_HEADER(V_REQUEST, 'User-Agent', 'Mozilla/4.0');
18    V_REQUEST.METHOD := 'POST';
19    UTL_HTTP.SET_HEADER (R => V_REQUEST, NAME => 'Content-Length', VALUE => DBMS_LOB.GETLENGTH(V_SOAP_REQUEST_TEXT));
20    UTL_HTTP.WRITE_TEXT (R => V_REQUEST, DATA => V_SOAP_REQUEST_TEXT);
21
22    V_RESPONSE := UTL_HTTP.GET_RESPONSE(V_REQUEST);
23    LOOP
24      UTL_HTTP.READ_LINE(V_RESPONSE, V_BUFFER, TRUE);
25      DBMS_OUTPUT.PUT_LINE(V_BUFFER);
26    END LOOP;
27    UTL_HTTP.END_RESPONSE(V_RESPONSE);
28  EXCEPTION
29    WHEN UTL_HTTP.END_OF_BODY THEN
30      UTL_HTTP.END_RESPONSE(V_RESPONSE);
31  END;
32  /
old   5:                <m:SNUMBER-GET_SQRTInput xmlns:m="http://xmlns.oracle.com/orawsv/&USERNAME/GET_SQRT">
new   5:                <m:SNUMBER-GET_SQRTInput xmlns:m="http://xmlns.oracle.com/orawsv/DBNWS/GET_SQRT">
<?xml version="1.0" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GET_SQRTOutput xmlns="http://xmlns.oracle.com/orawsv/DBNWS/GET_SQRT">
<RETURN>1.41421356237309504880168872420969807857</RETURN>
</GET_SQRTOutput>
</soap:Body>
</soap:Envelope>
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> --
SQL>
SQL>

Similar Messages

  • Calling web service via utl_dbws with unbounded return values

    Hello, everyone.
    I'm trying to use utl_dbws to call web service from Oracle DB 10 g.
    WS has unbounded return value:
    <xs:element maxOccurs='unbounded' minOccurs='0' name='return' type='xs:string'/>
    I'm setting return paramter in web service call handler like this:
    sys.UTL_DBWS.set_return_type(l_h_service_call, cs_qname_type_string);
    and when I'm trying to call it from PL/SQL function I'm getting an error:
    ORA-29532: Java call terminated by uncaught Java exception:
    deserialization error: XML reader error: unexpected character content: "s2"
    ORA-06512: at "SYS.UTL_DBWS", line 388
    ORA-06512: at "SYS.UTL_DBWS", line 385
    ORA-06512: at line 38
    I've tried to return values by out parameters and got the same exception.
    It looks like utl_dbws needs to know parameters count before calling.
    Have anyone succeded in getting arrays from Web Service call?
    This is a part of wsdl:
    <xs:complexType name='getProcessList'>
    <xs:sequence>
    <xs:element minOccurs='0' name='nameMask' type='xs:string'/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name='getProcessListResponse'>
    <xs:sequence>
    <xs:element maxOccurs='unbounded' minOccurs='0' name='return' type='xs:string'/>
    </xs:sequence>
    </xs:complexType>
    Throught SoapUI I can produce such kind of request:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://processmanager.argustelecom.ru/">
    <soapenv:Header/>
    <soapenv:Body>
    <proc:getProcessList>
    <processNameMask>*</processNameMask>
    </proc:getProcessList>
    </soapenv:Body>
    </soapenv:Envelope>
    and get a response:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <ns2:getProcessListResponse xmlns:ns2="http://processmanager.argustelecom.ru/">
    <return>s1</return>
    <return>s2</return>
    <return>s3</return>
    <return>s4</return>
    </ns2:getProcessListResponse>
    </env:Body>
    </env:Envelope>
    PL/SQL function:
    DECLARE
    cs_qname_type_string CONSTANT sys.UTL_DBWS.qname
    := sys.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'string') ;
    cs_qname_type_int CONSTANT sys.UTL_DBWS.qname := sys.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'int');
    cs_qname_type_any CONSTANT sys.UTL_DBWS.qname
    := sys.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'anyType') ;
    cs_endpoint CONSTANT VARCHAR2(256) := 'http://server:8080/process-manager/ProcessManager';
    l_service sys.UTL_DBWS.service;
    l_service_qname sys.UTL_DBWS.qname;
    l_port_qname sys.UTL_DBWS.qname;
    l_operation_qname sys.UTL_DBWS.qname;
    l_h_service_call sys.UTL_DBWS.call;
    l_params sys.UTL_DBWS.anydata_list;
    l_ret_val SYS.ANYDATA;
    BEGIN
    l_service_qname := sys.UTL_DBWS.to_qname(NULL, 'ProcessManagerService');
    l_service := sys.UTL_DBWS.create_service(l_service_qname);
    l_port_qname := sys.UTL_DBWS.to_qname(NULL, 'ProcessListServiceBinding');
    l_operation_qname := sys.UTL_DBWS.to_qname('http://processmanager.argustelecom.ru/', 'getProcessList');
    l_h_service_call := sys.UTL_DBWS.create_call(l_service, l_port_qname, l_operation_qname);
    sys.UTL_DBWS.set_target_endpoint_address(l_h_service_call, cs_endpoint);
    -- return type
    sys.UTL_DBWS.set_return_type(l_h_service_call, cs_qname_type_any);
    -- param type
    sys.UTL_DBWS.ADD_PARAMETER(l_h_service_call, 'processNameMask', cs_qname_type_string, 'ParameterMode.IN');
    l_params(1) := anydata.convertvarchar2('*');
    l_ret_val := sys.UTL_DBWS.invoke(l_h_service_call, l_params);
    IF l_ret_val IS NULL THEN
    DBMS_OUTPUT.put_line('l_ret_val is null');
    ELSE
    DBMS_OUTPUT.put_line('l_ret_val is not null');
    END IF;
    sys.UTL_DBWS.release_call(l_h_service_call);
    END;
    Edited by: Ilya on 03.12.2008 3:50

    Hi Tony
    I'm not sure if you would have solved your problem by now, but with my recent experience with the utl_dbws package, for doc lits with complex data types, you have to call the service with an XML request, as opposed to passing the param array.
    If you still need details, reply accordingly.
    Ta
    cT

  • Sys.UTL_DBWS issue when calling web service .......

    Hi,
    Background Details :
    Linux : 2.6.18-164.10.1.0.1.el5 #1 SMP Fri Jan 8 02:34:10 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
    Web Server : Apache Tomcat 6.0.20
    Database : Oracle 10.2.0.4
    Utility that we use to consume the Web Service from PL/SQL : JPublisher 10g Release 2 (10.2)
    Load Balancer : Citrix Netscaler
    We are using the Oracle built in package called UTL_DBWS to invoke the Java web service. The web service is been called through a Load Balancer called Citrix Netscaler.
    Load balancer has been configured to use the Source IP mechanism to route the request to the appropriate web service.
    Problem :
    When invoking the web service from Pl/SQL (with the below piece of code) there are multiple times the web servers are been called which is supposed to be only once. The number of times the call varies is about to 2 or 3.
    Query :
    Hence we need to understand in general how the UTL_DBWS works ? Are there any issues when the call being made through the LoadBalancer ?
    The default time out value while connecting ? If we want to override the default timeout how we can do that ?
    Code for reference :
    BEGIN
    l_service := sys.UTL_DBWS.create_service (
    wsdl_document_location => sys.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) := sys.ANYDATA.ConvertVarchar2(p_dayend_date);
    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);
    EXCEPTION WHEN OTHERS THEN
    PKG_IRIS_SH.PRC_ins_spm('WEB','9999', 'Web Service', TO_DATE(p_dayend_date ,'DD/MM/YYYY HH24:MI:SS') ,'Error Description:' ||SQLERRM , '0');
    End ;
    Can any body advise on this issue.
    thanks,
    Ram

    Cross posted to APEX support forum, PLEASE CLOSE THIS THREAD..
    Thank you,
    Tony Miller
    Webster, TX
    Never Surrender Dreams!
    JMS
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Calling Web Service from CRM using proxy

    Hi all,
    I'm facing a problem trying to call a web service from CRM (WAS 620) via XI 3.0. The response that XI recieves from the web service contains SOAP Envelope, and the mapping fails because of it. I built the proxy manually, because if I load WSDL the proxy generation in CRM generates error that sais that external definition coudn't be used.
    Is there any way to remove SOAP envelope from the response while mapping?
    Is it possible to call web service from WAS 620?
    Thanks!!!!
    Anya.

    Hi Manish,
    SOAP adapter does pass the message to XI (this message contains SOAP envelope although XI expects to get message without it), and during the mapping step i get "Runtime Exception in Message-Mapping transformatio~".
    I suppose it's because i created proxy manually. I did so because when i imported WSDL, and tried to generate proxy in CRM, i got an error message that said that proxy couldn't be generated because external definitions are only allowed in XI 3. But my XI version is 3.0! And when I generate the same proxy in my R/3 system that is installed on WAS 640, it works.
    What can I do?
    Cheers,
    Anya.

  • How to call web service using J2SE 1.3?

    Dear All,
    i have developed a web service by jdev 10.1.3 (JAX-RPC with web service security
    enabled).
    i generate the ws proxy (jdev 10.1.3) and run it with wsclient_extended.jar (required JDK 1.4.1 or above??).
    but one of my client say he has to use J2SE 1.3.x (as OS=AIX 4.3 that without J2SE
    1.4.x ), could anyone tell me how can generate ws proxy (with supporting
    library) for jdk 1.3.x?
    if oracle don't have such library / tools, any third party tools / library available?
    thank you.
    lsp

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Error 504 DNS look up failed while calling web services using XML

    Hi, I am trying to call web service from Oracle using XML.
    Everything seems to be in place but im getting an error "The webserver for <My End URL> reported that an error occurred while trying to access the website. Please click here to return to the previous page."
    If I directly access the end url from my browser its accessible and seems to work fine.
    The http response receiveed is mentioned below:
    Status code: 403
    Reason phrase: Forbidden
    <html>
    <head>
    <title>504 DNS look up failed</title>
    </head>
    <body>
    <font size=2><table width="100%"><tr><td bgcolor=#3300cc align="center" colspan=2>504 DNS look up failed</td></tr></table><br><br>The webserver for 'My End URL' reported that an error occurred while trying to access the website. Please click <u>here</u> to return to the previous page.<br><br><hr></font></body>
    </html>
    Im using Oracle 9i
    Please help
    Edited by: 927814 on Apr 15, 2012 11:41 PM
    Edited by: 927814 on Apr 15, 2012 11:46 PM

    Without far greater details as to what you are doing, what you have installed, and what you have tried, not much can be offered. All that I can gather from the information you provided is that the server name you are trying to contact either is not responding or is invalid. If you have Forms installed on your local machine (for example using Developer Suite), try using localhost rather than the hostname. For example, http://localhost:port/forms/frmservlet?form=yourform
    http://www.checkupdown.com/status/E504.html

  • Call web service using code.

    we want to call a web service from ADF JSP form.
    We used web service data control. But deployment failed.
    we applied Patch 5878326 to JDeveloper 10.1.3.3.0 and OAS.
    But problem is not solved.
    So we need a new way to call web services.
    is there any other way to call web services from Jdev.
    any code sample will be appreciated.
    Thanks.

    Workaround for the Connection Failure
    In JDeveloper, locate the .deploy file in the Resources folder of your web application project.
    Double-click the file to open the WAR Deployment Profile Properties dialog.
    Expand File Groups - WEB-INF/classes - Contributors.
    In the Contributors panel, click Add and use the Browse dialog to locate the .adf folder in the root for your application (for example, /jdev/mywork//.adf path.)
    Select the .adf folder and add it as a contributor to the deployment profile.
    Note that the .adf folder does not become part of the deployable archive. This merely ensures that the contents of the META-INF get placed in an appropriate location in the archive that will permit the web container to find it when the application loads.
    The failure to get the connection to Webservice is beacuse the "connections.xml" is not available in the deployed archive.
    This has been release note'd as in
    http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.0.3/10.1.3_addendum.html under "Deployment issues"

  • Calling Web Service using utl_http; Parameters not being recognized by ws

    Hi All,
    I have set-up appropriate function & packages based on this article:
    Calling Web Services from PL/SQL in the Oracle9i Database -
    http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
    I am able to consume my sample web service using the above, but my web service doesn't see any parameters that I'm passing.
    Any ideas? I'm using Oracle 10g calling a .Net 1.1 web service
    Thanks,
    Robert

    Hello,
    I am not able to access the link you posted about calling a web service. Could please share your code again ?
    Thanks in advance for your help...
    Lionel

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • What stub code does APEX uses when making a web service call ?

    What stub code does APEX uses when making a web service call (manual web service reference)
    I am using APEX (which was part of the 11g installation).

    Hi Steve,
    Some options for the same issue:
    web service time out
    How to check for Web Srvice Timeout in ABAP Proxy call
    Regards
    Vijaya

  • Calling Web services using SOAP

    Hi,
    I am trying to execute a function through a webservice using a SOAP
    package and am getting the following error:ORA-30625: method dispatch
    on NULL SELF argument is disallowed. I think this is to do with one of
    the parameters being null but dont know how to fix this. Following is
    the function:
    CREATE OR REPLACE FUNCTION ILACPMSPRC.GET_GREETING_fnc (p_name IN
    VARCHAR2
    --, p_date VARCHAR2
    , p_age VARCHAR2 )
    RETURN NUMBER
    AS
    l_request soap_api_pkg.t_request;
    l_response soap_api_pkg.t_response;
    l_price NUMBER;
    -- DBMS_OUTPUT.ENABLE(20000);
    BEGIN
    DBMS_OUTPUT.ENABLE(20000);
    DBMS_OUTPUT.PUT_LINE('BEGIN');
    -- Set proxy details if no direct net connection.
    --UTL_HTTP.set_proxy('myproxy:4480', NULL);
    --UTL_HTTP.set_persistent_conn_support(TRUE);
    -- Set proxy authentication if necessary.
    --soap_api.set_proxy_authentication(p_username => 'myusername',
    -- p_password => 'mypassword');
    l_request := soap_api_pkg.new_request(p_method => 'ns1:validate',
    p_namespace => 'xmlns:ns1="http://
    impl.webservice.validation.workmgt.cb.irishlife.ie/xsd"');
    -- parameter 1 is name
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workType',
    p_type => 'xsd:string',
    p_value => p_name);
    -- parameter 2 is date
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workItemNo',
    p_type => 'xsd:string',
    p_value => 'ABC');
    --p_value   => '2007-01-01T00:00:00Z');
    -- parameter 3 is age
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'indexName',
    p_type => 'xsd:string',
    p_value => p_age);
    l_response := soap_api_pkg.invoke(p_request => l_request,
    p_url => 'http://
    10.253.55.139:7400/axis2/services/ValidationService',
    p_action => 'http://
    10.253.55.139:7400/axis2/services/ValidationService/validate');
    if l_response.doc is not null then
    dbms_output.put_line('the doc is not null');
    end if;
    DBMS_OUTPUT.PUT_LINE ( 'p_name = ' || p_name );
    HERE l_price := soap_api_pkg.get_return_value(p_response =>
    l_response,
    p_name =>
    'validateResponse',
    p_namespace =>
    'xmlns:ns1="http://impl.webservice.validation.workmgt.cb.irishlife.ie/
    xsd"');
    if l_price is null then
    dbms_output.put_line('opps, the price is null');
    end if;
    DBMS_OUTPUT.PUT_LINE('PRICE:'||l_price);
    RETURN l_price;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE || ', ' || SQLERRM);
    RETURN NULL;
    END GET_GREETING_fnc;
    Where HERE is marked is where the problem lies...the package body is
    here:
    CREATE OR REPLACE PACKAGE BODY SOAP_API_PKG AS
    -- Name : http://www.oracle-base.com/dba/miscellaneous/soap_api
    -- Author : DR Timothy S Hall
    -- Description : SOAP related functions for consuming web services.
    -- Ammedments :
    -- When Who What
    -- =========== ========
    =================================================
    -- 04-OCT-2003 Tim Hall Initial Creation
    -- 23-FEB-2006 Tim Hall Parameterized the "soap" envelope tags.
    -- 08-JUN-2006 Tim Hall Add proxy authentication functionality.
    g_proxy_username VARCHAR2(50) := NULL;
    g_proxy_password VARCHAR2(50) := NULL;
    PROCEDURE set_proxy_authentication(p_username IN VARCHAR2,
    p_password IN VARCHAR2) AS
    BEGIN
    g_proxy_username := p_username;
    g_proxy_password := p_password;
    END;
    FUNCTION new_request(p_method IN VARCHAR2,
    p_namespace IN VARCHAR2,
    p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
    RETURN t_request AS
    l_request t_request;
    BEGIN
    l_request.method := p_method;
    l_request.namespace := p_namespace;
    l_request.envelope_tag := p_envelope_tag;
    RETURN l_request;
    END;
    PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
    p_name IN VARCHAR2,
    p_type IN VARCHAR2,
    p_value IN VARCHAR2) AS
    BEGIN
    p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    DBMS_OUTPUT.PUT_LINE ( 'p_request.body = ' || p_request.body );
    END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN DATE,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN INTEGER,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    PROCEDURE generate_envelope(p_request IN OUT NOCOPY t_request,
    p_env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    p_env := '<'||p_request.envelope_tag||':Envelope xmlns:'||
    p_request.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"
    ' ||
    'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
    '<'||p_request.envelope_tag||':Body>' ||
    '<'||p_request.method||' '||p_request.namespace||' '||
    p_request.envelope_tag||':encodingStyle="http://schemas.xmlsoap.org/
    soap/encoding/">' ||
    p_request.body ||
    '</'||p_request.method||'>' ||
    '</'||p_request.envelope_tag||':Body>' ||
    '</'||p_request.envelope_tag||':Envelope>';
    END;
    PROCEDURE show_envelope(p_env IN VARCHAR2) AS
    i PLS_INTEGER;
    l_len PLS_INTEGER;
    BEGIN
    i := 1; l_len := LENGTH(p_env);
    WHILE (i <= l_len) LOOP
    DBMS_OUTPUT.put_line(SUBSTR(p_env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(p_response IN OUT NOCOPY t_response) AS
    l_fault_node XMLTYPE;
    l_fault_code VARCHAR2(256);
    l_fault_string VARCHAR2(32767);
    BEGIN
    dbms_output.put_line('midas8-1');
    l_fault_node := p_response.doc.extract('/'||
    p_response.envelope_tag||':Fault',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/');
    dbms_output.put_line('midas8-2');
    IF (l_fault_node IS NOT NULL) THEN
    dbms_output.put_line('midas8-3');
    l_fault_code := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultcode/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-4');
    l_fault_string := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultstring/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-5');
    --RAISE_APPLICATION_ERROR(-20000, l_fault_code || ' - ' ||
    l_fault_string);
    END IF;
    END;
    FUNCTION invoke(p_request IN OUT NOCOPY t_request,
    p_url IN VARCHAR2,
    p_action IN VARCHAR2)
    RETURN t_response AS
    l_envelope VARCHAR2(32767);
    l_http_request UTL_HTTP.req;
    l_http_response UTL_HTTP.resp;
    l_response t_response;
    BEGIN
    dbms_output.put_line('Invoking request');
    dbms_output.put_line('url :'||p_url);
    dbms_output.put_line('action :'|| p_action);
    generate_envelope(p_request, l_envelope);
    show_envelope(l_envelope);
    l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
    dbms_output.put_line('midas1');
    IF g_proxy_username IS NOT NULL THEN
    DBMS_OUTPUT.PUT_LINE('PROXY USERNAME IS NOT NULL');
    UTL_HTTP.set_authentication(r => l_http_request,
    username => g_proxy_username,
    password => g_proxy_password,
    scheme => 'Basic',
    for_proxy => TRUE);
    END IF;
    UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(l_http_request, 'Content-Length',
    LENGTH(l_envelope));
    UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
    UTL_HTTP.write_text(l_http_request, l_envelope);
    dbms_output.put_line('midas2');
    l_http_response := UTL_HTTP.get_response(l_http_request);
    dbms_output.put_line('midas3');
    UTL_HTTP.read_text(l_http_response, l_envelope);
    dbms_output.put_line('midas4');
    UTL_HTTP.end_response(l_http_response);
    dbms_output.put_line('midas5');
    l_response.doc := XMLTYPE.createxml(l_envelope);
    dbms_output.put_line('midas6');
    l_response.envelope_tag := p_request.envelope_tag;
    dbms_output.put_line('midas7');
    l_response.doc := l_response.doc.extract('/'||
    l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/
    child::node()',
    'xmlns:'||
    l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/"');
    -- show_envelope(l_response.doc.getstringval());
    dbms_output.put_line('midas8');
    check_fault(l_response);
    dbms_output.put_line('midas9');
    RETURN l_response;
    END;
    FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
    p_name IN VARCHAR2,
    p_namespace IN VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    -- RETURN p_response.doc.extract('//'||p_name||'/
    child::text()',p_namespace).getstringval();
    dbms_output.put_line('function');
    dbms_output.put_line(p_name);
    DBMS_OUTPUT.PUT_LINE (p_response.doc.extract('//'||p_name||'/
    child::text()', p_namespace).getstringval());
    RETURN p_response.doc.extract('//'||p_name||'/child::text()',
    p_namespace).getstringval();
    END;
    END SOAP_API_PKG;
    Any help greatly appreciated!!

    Hello,
    I have not looked in detail to you code but I would like to point out that Oracle provides utilities to call Web Services from the database, using a DB package and/or Java in the DB.
    Have you looked to the documentation about:
    - Developing a Web Service Client in the Database
    regards
    Tugdual Grall

  • Calling web service request from PL/SQL

    I am trying to create Apex page with stock quote ticker - like what Yahoo has on their page. I have the right web service and have put together a page which works when you submit (created by the wizard). Instead of clicking submit to refresh the page I want to use Ajax to do this but for this purpose I need to know how to call web service from PL/SQL so I can do this in my on demand process. Any ideas?

    George,
    The documented way to call a web service using PL/SQL is to use UTL_DBWS package.
    Here are a couple of links that may be useful:
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    http://www.oracle.com/technology/sample_code/tech/java/jsp/callout_users_guide.htm
    There is also an APEX package wwv_flow_web_services, but I couldn't find any documentation on it.
    Sima

  • Calling web service from oracle forms 10g

    Problem Description:
    I'm following the steps as per the doc:
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
    to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
    WSDL for external web service used is http://gend:83/DesignService.svc?wsdl
    The service was developed by us.
    Calling the web service using JDeveloper works fine but when I complie in Oracle Forms it returns wrong number of types of arguments in call SENDHELLO.
    The code from oracle form to call web service is as below:
    DECLARE
    jo ora_java.jobject;
    xo ora_java.jobject;
    rv varchar2(2000);
    ex ora_java.jobject;
    str varchar2(100);
    BEGIN
    jo := GendServiceClient.new;
    rv := GendServiceClient.sendHello('Nora');
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    message(Exception_.toString(ex));
    END;
    Any help/ideas on this is greatly appreciated. Thanks.
    Edited by: KE Nora Loera on Jun 1, 2012 1:24 PM

    My primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
    I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
    Thanks

  • Calling web service from oracle forms fails with ORA_JAVA.JAVA_ERROR

    Problem Description:
    I'm following the steps as per the doc:
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
    to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
    WSDL for external web service used is http://www.webservicex.net/CurrencyConverter.asmx?wsdl
    Calling the web service using JDeveloper works fine but from Oracle Forms returns ORA_JAVA.JAVA_ERROR; Unable to call out to Java, Invalid object type for argument 1
    The code from oracle form to call web service is as below:
    DECLARE
    jo ora_java.jobject;
    rv ora_java.jobject;
    ex ora_java.jobject;
    outString varchar2(2000);
    BEGIN
    jo:= CurrencyConvertorStub.new;
    --This will get the exchange rate from US Dollars to UK Sterling.
    rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD');
    message (float_.floatValue(RV));
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    outString := Exception_.toString(ex);
    message(outString);
    END;
    Any help/ideas on this is greatly appreciated. Thanks.

    Yes, it is the message line - so basically this call fails => rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD'); and control goes in the exception block
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    Below is the code from java stub that was generated using JDeveloper by using web services stub/skeleton and associating the WSDL
    public Double ConversionRate(String FromCurrency, String ToCurrency) throws Exception
    URL endpointURL = new URL(endpoint);
    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();
    String wrappingName = "ConversionRate";
    String targetNamespace = "http://www.webserviceX.NET/";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"FromCurrency", FromCurrency});
    requestData.add(new Object[] {"ToCurrency", ToCurrency});
    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);
    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://www.webserviceX.NET/ConversionRate", requestEnv);
    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();
    return (Double)fromElement((Element)responseData.elementAt(0), java.lang.Double.class);
    }

Maybe you are looking for

  • ESI calculation for employee leaving on a mid of month

    Hi, Employee left org on 12 th  of month. When i am calculating ESI it deducted on the basis of Actual ESI i mean Gross of full month, though it should be on gross of only those days when employee served the orgnisation, for 12 days in my case. I mad

  • Lost Ipod summary page after 7.3.1 upgrade

    I can see the folder list but I can't see the ipod summary page for my Nano. I can't re-install or uninstall itunes. I removed quicktime, but I don't have windows utility clean up, and I keep getting itunes.msi path not found message when I try to re

  • Differences between 8i and 9.2

    I use 9.2 at work now and I am wanting to learn more about Oracle databases. I came across Oracle 8i and could install it at home to play with, but are there major differences between the two. Message was edited by: jamesH

  • Adobe Reader 9.1 and Internet Explorer 8.0 pdf link crash

    I have three PC's running XP Pro SP3, with Adobe Reader 9.1. On one of these systems, pdf files can be loaded, but when I click on pdf links in web pages, the browser crashes. If someone could please help me by defining what further information might

  • BPEL not started until time out

    Hi, In my BPEL Process,I have flowN activity, each branch(each flow) has HumanTask activity which sends mail & get response from the assignee. When I invoke the process, it gets started but not send any mail until the timeout. If the process timed ou