Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 296407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:32:45+00:00 2026-05-12T06:32:45+00:00

Background: We have a Webservice that is running under axis2 on a Tomcat. We

  • 0

Background:
We have a Webservice that is running under axis2 on a Tomcat. We would like our Oracle (10g Enterprise Edition Release 10.2.0.1.0) db to call our Webservice when a new row is entered into one of our tables. We’ve discovered we can use a trigger to call a Java Stored Procedure (JSP) or us PL/SQL and the UTL_DBWS utility. Neither is working for us however. Consuming the webservice from a standalone java class using either the axis javax.xml.rpc implementation or the oracle implementation does work outside of the db.

UTL_DBWS attempt:

unzipped contents of dbws-callout-utility-10131.zip to C:\oracle\product\10.2.0\db_5\sqlj\lib which was pulled down from http://www.oracle.com/technology/sample_code/tech/java/jsp/dbwebservices.html

ran loadjava command

loadjava -u <USER>/<PASSWORD>@<MACHINE>:1521:<INSTANCE> -r -v -f -genmissing -s -grant public C:\oracle\product\10.2.0\db_5\sqlj\lib\dbwsclientws.jar C:\oracle\product\10.2.0\db_5\sqlj\lib\dbwsclientdb102.jar

Added a bunch of permissions

execute dbms_java.grant_permission( '<<user>>', 'SYS:java.lang.RuntimePermission', 'getClassLoader', '' )
    execute dbms_java.grant_permission( '<<user>>', 'SYS:oracle.aurora.security.JServerPermission', 'Verifier', '' );
    execute dbms_java.grant_permission( '<<user>>', 'SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar', '' ) ;
    execute dbms_java.grant_permission( '<<user>>', 'SYS:java.net.SocketPermission', '<<machineName>>', 'resolve' );
    execute dbms_java.grant_permission( '<<user>>', 'SYS:java.net.SocketPermission', '<<machineIP>>', 'connect,resolve' );
    execute dbms_java.grant_permission( '<<user>>', 'SYS:java.lang.RuntimePermission', 'createClassLoader', '' );

Our pl/sql:

FUNCTION wsproxy_send_request
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;
boolean_type_qname   SYS.UTL_DBWS.QNAME;

begin

l_wsdl_url := 'http://<<host>>/axis2/services/<<serviceName>>?wsdl';
l_namespace := 'http://<<namespace>>';
l_service_qname := SYS.UTL_DBWS.to_qname(l_namespace, '<<serviceName>>');
l_port_qname := SYS.UTL_DBWS.to_qname(l_namespace, '<<myendpoint>>');
l_operation_qname := SYS.UTL_DBWS.to_qname(l_namespace, 'send');

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);

SYS.UTL_DBWS.SET_PROPERTY(l_call, 'OPERATION_STYLE', 'rpc');

l_input_params(0) := ANYDATA.ConvertNumber(1);
l_input_params(1) := ANYDATA.ConvertNumber(24387236726);
l_input_params(2) := ANYDATA.ConvertVarchar2('CTE');
l_input_params(3) := ANYDATA.ConvertVarchar2('STORE_RECORD_LOCATOR');
l_input_params(4) := ANYDATA.ConvertVarchar2('a');

boolean_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'boolean');
sys.utl_dbws.set_return_type(l_call, boolean_type_qname);

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;

When we execute:

select wsproxy_send_request from dual;

we get:

Error: ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException
ORA-06512: at "SYS.UTL_DBWS", line 568
ORA-06512: at "SYS.UTL_DBWS", line 492
ORA-06512: at "SYS.UTL_DBWS", line 380
ORA-06512: at "WSPROXY.WSPROXY_SEND_REQUEST", line 37

SQLState:  99999
ErrorCode: 29532
Position: 37

(Position 37 is the invoke call)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:32:46+00:00Added an answer on May 12, 2026 at 6:32 am

    The trick was to add the parameter types/names… I haven’t found the UTL_DBWS.add_parameter method documented anywhere, but I should of guessed it’s existence since you have to do the same in a java implementation.

    Anyway here is what I added

    string_type_qname := SYS.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    long_type_qname := SYS.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'long');
    
    SYS.UTL_DBWS.add_parameter(l_call, 'args0', long_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args1', long_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args2', string_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args3', string_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args4', string_type_qname, 'ParameterMode.IN');
    

    So the whole thing now is:

    CREATE OR REPLACE
    FUNCTION wsproxy_send_request
    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;
    boolean_type_qname      SYS.UTL_DBWS.QNAME;
    string_type_qname       SYS.UTL_DBWS.QNAME;
    long_type_qname         SYS.UTL_DBWS.QNAME;
    
    begin
    
    l_wsdl_url := 'http://<<host>>/axis2/services/<<serviceName>>?wsdl';
    l_namespace := 'http://<<namespace>>';
    l_service_qname := SYS.UTL_DBWS.to_qname(l_namespace, '<<serviceName>>');
    l_port_qname := SYS.UTL_DBWS.to_qname(l_namespace, '<<endPoint>>');
    l_operation_qname := SYS.UTL_DBWS.to_qname(l_namespace, 'send');
    
    l_service := SYS.UTL_DBWS.create_service (URIFACTORY.getURI(l_wsdl_url), l_service_qname);
    l_call := SYS.UTL_DBWS.create_call (l_service, l_port_qname, l_operation_qname);
    
    boolean_type_qname := SYS.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'boolean');
    string_type_qname := SYS.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    long_type_qname := SYS.UTL_DBWS.to_qname('http://www.w3.org/2001/XMLSchema', 'long');
    
    SYS.UTL_DBWS.add_parameter(l_call, 'args0', long_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args1', long_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args2', string_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args3', string_type_qname, 'ParameterMode.IN');
    SYS.UTL_DBWS.add_parameter(l_call, 'args4', string_type_qname, 'ParameterMode.IN');
    
    SYS.UTL_DBWS.SET_PROPERTY(l_call, 'SOAPACTION_USE', 'TRUE');
    SYS.UTL_DBWS.SET_PROPERTY(l_call, 'SOAPACTION_URI', '');
    SYS.UTL_DBWS.SET_PROPERTY(l_call, 'ENCODINGSTYLE_URI', '');
    SYS.UTL_DBWS.SET_PROPERTY(l_call, 'OPERATION_STYLE', 'rpc');
    
    l_input_params(0) := ANYDATA.ConvertNumber(1);
    l_input_params(1) := ANYDATA.ConvertNumber(24387236726);
    l_input_params(2) := ANYDATA.ConvertVarchar2('CTE');
    l_input_params(3) := ANYDATA.ConvertVarchar2('STORE_RECORD_LOCATOR');
    l_input_params(4) := ANYDATA.ConvertVarchar2('a');
    
    sys.utl_dbws.set_return_type(l_call, boolean_type_qname);
    
    l_result := SYS.UTL_DBWS.invoke(l_call, l_input_params);   
    
    SYS.UTL_DBWS.release_call (l_call);
    SYS.UTL_DBWS.release_service(l_service);
    
    RETURN ANYDATA.AccessVarchar2(l_result);
    END;
    /
    

    I finally saw this after paying closer attention to the guide posted in the oracle forums
    http://forums.oracle.com/forums/thread.jspa?threadID=633268&tstart=0

    I’m getting null for my response now, but the parameter issue has been solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the background, I have a webservice from a vendor/partner that returns a large
Background: I have a winform application written in VB.NET that uses a WebService to
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may
I have an application that needs to poll a webservice to see if the
Background We have a Windows .NET application used by our field employees who travel
Background I have a web app that will create an image from user input.
I'd like to create an AsyncTask that sits in the background and calls a
Background I have made a Web Service in Visual Studio, and I'm trying to
Background: I have a little video playing app with a UI inspired by the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.