"ORA-29532: Java call terminated by uncaught Java exception

Dear Oracle:
I am trying to establish an HTTPS connection from a Java stored
procedure that is wrapped in a PL/SQL procedure and loaded into a
Package. We are running on Oracle 8.1.7.
My Java code compiles and runs fine when run stand-alone outside
Oracle; I can establish the connection to a secure server and talk to
the server. However when I load this Java class (using the loadjava
utility) this class can no longer run and I get a the following
exception:
"ORA-29532: Java call terminated by uncaught Java exception:
javax.net.ssl.SSLException: SSL handshake failed:
X509CertChainIncompleteErr"
I have tried loading the JSSE from Sun and I still get the same error.
Searching in the Discussing Forums I found the following link (which
describes a procedure that logs into the UPS secure server site and
grabs some XML) http://osi.oracle.com/~mbpierma/SSL_Java_DB.html .
This code works ok if we try to connect to UPS server. However this
code doesn't work if we try to log in to a different server (such as
???). If I modify this code slightly and try to log to any other
sever server I get the same error as the one above. Investigation
lead us to understand that the certificate at the UPS web site is a
self-signed certificate -- not one generated by a major 'recognized'
authority such as Verisign or Thawte.
Further research pointed me to the following URL
http://www.znow.com/sales/oracle/network.816/a76932/appf_ora.htm#619367
This URL has the documentation for JAVA SSL for 8.1.6 which I figure
I could read and try to make it work in 8.1.7.
I looked at your Secure Hello World example, however the code is
missing the most critical parts of the whole example, it does not
specify where the certificate or any of the security settings come
from (see the attached JavaCertExample.txt file).
So, my questions are the following:
1) What should I do to avoid the error mentioned above?
2) Do you have a sample piece of code that describes how to make a
HTTPS connection using a Java stored procedure?
3) Can I make the HTTPS connection using a URL class and not using
sockets directly?
4) Do I need to load the JSEE provided by Sun?
5) Will the solution be different for Oracle 9i?
// SecureHelloClient.java
import java.net.*;
import java.io.*;
import java.util.*;
import javax.net.ssl.*;
import javax.security.cert.X509Certificate;
import oracle.security.ssl.OracleSSLCredential;
import oracle.security.ssl.OracleSSLSocketFactory;
import oracle.security.ssl.OracleSSLProtocolVersion;
import oracle.security.ssl.OracleSSLSession;
public class SecureHelloClient
public static void main(String argv[])
String hostName = "localhost";
if(argv.length != 0)
String hostName = argv[0];
// Set the SSLSocketFactoryImpl class as follows:
java.util.Properties prop = System.getProperties();
prop.put("SSLSocketFactoryImplClass",
"oracle.security.ssl.OracleSSLSocketFactoryImpl");
try
// Get the default socket factory
OracleSSLSocketFactory sSocFactory
= (OracleSSLSocketFactory)SSLSocketFactory.getDefault();
sSocFactory.setSSLProtocolVersion(OracleSSLProtocolVersion.SSL_Version_3_0);
OracleSSLCredential sslCredObj = new OracleSSLCredential();
// Where did these values come from? caCert, userCert, trustedCert,
// Set the certificate chain and private key if the
// server requires client authentication
sslCredObj.addCertChain(caCert)
sslCredObj.addCertchain(userCert)
sslCredObj.setPrivateKey(userPvtKey, userPassword)
// Populate credential object
sslCredObj.addTrustedCert(trustedCert);
sSocFactory.setSSLCredentials(sslCredObj);
// Create the socket using factory
SSLSocket jsslSoc =
(SSLSocket)sSocFactory.createSocket(hostName, 8443);
String [] ciphers = jsslSoc.getSupportedCipherSuites() ;
// Select the ciphers you want and put them.
// Here we will put all availabel ciphers
jsslSoc.setEnabledCipherSuites(ciphers);
// We are creating socket in client mode
jsslSoc.setUseClientMode(true);
// Do SSL handshake
jsslSoc.startHandshake();
// Print negotiated cipher
System.out.println("Negotiated Cipher Suite: "
+jsslSoc.getSession().getCipherSuite());
System.out.println("");
X509Certificate[] peerCerts
= ((javax.net.ssl.SSLSocket)jsslSoc).getSession().getPeerCertificateChain();
if (peerCerts != null)
System.out.println("Printing server information:");
for(int i =0; i ? peerCerts.length; i++)
System.out.println("Peer Certificate ["+i+"] Information:");
System.out.println("- Subject: " + peerCerts.getSubjectDN().getName());
System.out.println("- Issuer: " + peerCerts[i].getIssuerDN().getName());
System.out.println("- Version: " + peerCerts[i].getVersion());
System.out.println("- Start Time: " + peerCerts[i].getNotBefore().toString());
System.out.println("- End Time: " + peerCerts[i].getNotAfter().toString());
System.out.println("- Signature Algorithm: " + peerCerts[i].getSigAlgName());
System.out.println("- Serial Number: " + peerCerts[i].getSerialNumber());
else
System.out.println("Failed to get peer certificates");
// Now do data exchange with client
OutputStream out = jsslSoc.getOutputStream();
InputStream in = jsslSoc.getInputStream();
String inputLine, outputLine;
byte [] msg = new byte[1024];
outputLine = "HELLO";
out.write(outputLine.getBytes());
int readLen = in.read(msg, 0, msg.length);
if(readLen > 0)
inputLine = new String(msg, 0, readLen);
System.out.println("");
System.out.println("Server Message:");
System.out.println(inputLine );
else
System.out.println("Can't read data from client");
// Close all sockets and streams
out.close();
in.close();
jsslSoc.close();
catch(SSLException e)
System.out.println("SSL exception caught:");
e.printStackTrace();
catch(IOException e)
System.out.println("IO exception caught:");
e.printStackTrace();
catch(Exception e)
System.out.println("Exception caught:");
e.printStackTrace();

Hi,
I have the same problem.
Is some ORACLE guru that can help us ?
We need to communicate with some servlet
via POST method of https (SSL3)
and with using private certificate on the client site.
We need furthermore allow using of some proxy.
Client site is realized as set of stored procedures within ORACLE 8.1.7
In this time I am able to communicate with server without SSL and certificate
using package utl_tcp
(but with this solution without certificate is our customer not satisfied -:))
ORACLE help us please !
Pavel Pospisil
[email protected]

Similar Messages

  • Oracle BI 11.1.1.7.1: Calling BI webservices from Plsql Procedure: ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError

    Hi,
         I have a requirement of calling BI webservices from Plsql stored procedure. I generated all my wsdl java classes and loaded them into the database. However, when I tried to call one of my java class using stored procedure, it is giving me"ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError".
    *Cause:    A Java exception or error was signaled and could not be
               resolved by the Java code.
    *Action:   Modify Java code, if this behavior is not intended.
    But all my dependency classes are present in database as java class objects and are valid. Can some one help me out of this?

    Stiphane,
    You can look in USER_ERRORS to see if there's anything more specific reported by the compiler. But, it could also be the case that everything's OK (oddly enough). I loaded the JavaMail API in an 8.1.6 database and also got bytecode verifier errors, but it ran fine. Here are the errors I got when loading Sun's activation.jar, which ended up not being a problem:
    ORA-29552: verification warning: at offset 12 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):12 by a throw at offset 18 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):18 by a throw at offset 30 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):30 by a throw
    Hope this helps,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

  • Error: ORA-29532: Java call terminated by uncaught Java exception:

    Anyone have this similar problem of
    ORA-29532: Java call terminated by uncaught Java exception:
    javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request:
    deserialization error: XML reader error: unexpected character content:
    "A"
    The service is running fine in a browser and returns the date. When I run it using the PL/SQL it has the error mentioned above.
    I am running the following:
    CREATE OR REPLACE FUNCTION GetDate_wb( p_dummy IN VARCHAR2 )
    RETURN DATE
    AS
    l_service sys.UTL_DBWS.service;
    l_call sys.UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url VARCHAR2(1024);
    l_service_name VARCHAR2(200);
    l_operation_name VARCHAR2(200);
    l_input_params sys.UTL_DBWS.anydata_list;
    l_port sys.UTL_DBWS.qname := 8988;
    BEGIN
    l_wsdl_url := 'http://org-lblakisa1:8988/BPEL_OD-LoginWS-context-root/getDate1SoapHttpPort?WSDL';
    l_service_name := 'getDate1';
    l_operation_name := 'getDate';
    l_service := sys.UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_name);
    l_call := sys.UTL_DBWS.create_call (
    service_handle => l_service,
    port_name => NULL,
    operation_name => l_operation_name);
    l_input_params(1) := ANYDATA.ConvertVarchar2(p_dummy);
    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.AccessDate(l_result);
    END;
    /

    Problem is resolved... We had a version issue in that 10.1.3 web service is not compatible. 10.1.2 worked.

  • Java call terminated by uncaught Java exception: java.lang.NullPointerExcep

    i have written this program of adding file items using wwsbr_api.add_item but,
    1 declare
    2 l_new_item_master_id number;
    3 l_caid number := 53;
    4 l_folder_id number := 50279;
    5 begin
    6 select c.id, f.id
    7 into l_caid, l_folder_id
    8 from portal.wwsbr_all_content_areas c,
    9 portal.wwsbr_all_folders f
    10 where c.id = f.caid and c.name = 'S_T_PAGE'
    11 and f.name = 'S_PAGE';
    12 --portal.wwctx_api_private.set_context('PORTAL');
    13 l_new_item_master_id := portal.wwsbr_api.add_item(
    14 p_caid => l_caid,
    15 p_folder_id => l_folder_id,
    16 p_display_name => 'simple file item',
    17 p_type_id => portal.wwsbr_api.ITEM_TYPE_FILE,
    18 p_type_caid => portal.wwsbr_api.SHARED_OBJECTS,
    19 p_region_id => 4571,
    20 p_file_filename => 'D:\ora\training\html\frame.html'
    21 );
    22 -- process cache invalidation messages
    23 portal. wwpro_api_invalidation.execute_cache_invalidation;
    24* end;
    SQL> /
    this program is showing the following exception. kindly give the solution urgently..........
    declare
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException
    ORA-06512: at "PORTAL.WWSBR_API", line 37
    ORA-06512: at "PORTAL.WWSBR_API", line 610
    ORA-06512: at line 13

    can any one of u please give me the reply to the above error,
    urgently.............

  • Blob writing error      ORA-29532 Java call terminated Unsupported feature

    Hi there,
    I've got the following Java code which tries to write to a BLOB file. It's a version of some code to extract files from a zip archive, but with everything but the erroring call stripped out:
    create or replace and compile java source named zipunpack as
    package org.bristol.cyps;
    import oracle.sql.BLOB;
    import java.util.zip.*;
    public class ZipUnpack
    public static int unpack(BLOB ziparray[], String filename, BLOB filearray[])
    throws java.sql.SQLException, java.io.IOException
    BLOB file = filearray[0];
    java.io.OutputStream fileout = file.setBinaryStream(0L);
    return 1;
    This is published as follows:
    create or replace function zip_unpack (
    pio_zip in out nocopy blob
    , pi_filename in varchar2
    , pio_file in out nocopy blob
    ) return number as language java
    name 'org.bristol.cyps.ZipUnpack.unpack(oracle.sql.BLOB[], java.lang.String, oracle.sql.BLOB[]) return java.lang.Integer';
    And called like so:
    procedure send_zip_file (
    pi_zip in out nocopy blob
    , pi_filename in varchar2
    ) is
    file blob;
    completed integer;
    begin
    dbms_lob.createtemporary (
    lob_loc => file
    , cache => false
    , dur => dbms_lob.call
    completed := zip_unpack(pi_zip, pi_filename, file);
    if completed > 0 then
    bare_html.print_blob(file);
    else
    htp.print('File "' || pi_filename || '" not found');
    end if;
    end;
    This, as far as I can tell from the documentation, should work. Unfortunately, though, it generates an error:
    ORA-29532: Java call terminated by uncaught Java exception: java.sql.SQLException: Unsupported feature
    The particular line which is causing the error is the "java.io.OutputStream fileout = file.setBinaryStream(0L);" If I remove this, it runs fine. I'm flumoxed as to why this might be causing an "Unsupported feature" exception when it's documented as being supported. Can anyone shed any light?
    Cheers,
    Robert
    Message was edited for more clarity

    Hi,
    It looks like you are not using 10g JDBC. java.sql.Blob.setBinaryStream is a JDBC 3.0 method. In 9iR2 we added support for jdk14 and added stub methods for JDBC 3.0 behavior without fully implementing them. 10gR1 was the first version where the JDBC3.0 methods were fully supported.
    The workaround is to use the Oracle proprietary method oracle.sql.BLOB.getBinaryOutputStream
    Kuassi, http://db360.blogspot.com

  • Receiving error: Terminating app due to uncaught exception 'MFSQLiteException', reason: 'inserting mailbox url' abort() called terminating with uncaught exception of type NSException

    Today, I received this error when I re-added two email accounts that are tied in to my domain. The error is: "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'inserting mailbox url' abort() called terminating with uncaught exception of type NSException"
    Two days ago, at my wits end with email issues, I googled how to Reset Mail.app and followed the recommendation found here: https://discussions.apple.com/thread/2266399?tstart=0
    That's. all. I've. done.
    What should I do correct the error I'm receiving when adding my email accounts?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7"

    I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
    Permission Problems in RDBMS 8.1.6 and 8.1.7".
    It will be accessible from Oracle Support's "Metalink" site.
    "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    Problem Description
    Periodically an application running in the Enterprise Java Engine
    (EJE) formerly known as the "Oracle 8i JVM", "the JSERVER component", or
    the "Aurora JVM" will fail with a "java 2" permissions error having the
    following format :
    Note : Message shown below have been reformatted for easier readability.
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception:
    usually followed by a detailed error message similar to one of the following
    messages :
    Example # 1
    java.security.AccessControlException: the Permission
    (java.net.SocketPermission hostname resolve)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 2
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 3
    java.security.AccessControlException: the Permission
    (java.io.FilePermission \matt1.gif read)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Explanation
    The java 2 permission stated in line # 2 of each of the above "Examples"
    has not been granted to the user specified in line 4 of the above "Examples".
    Solution Description
    The methodology to solve this issue is identical for all java 2 permissions
    cases.
    1) Format a call "dbms_java.grant_permission" procedure as described below.
    2) Logon as SYS or SYSTEM
    3) Issue the TWO commands shown below
    4) Logoff as SYS or SYSTEM
    5) Retry your application
    For Example # 1
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.net.SocketPermission',
    'hostname',
    'resolve');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 2
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.util.PropertyPermission',
    'read,write');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 3
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.io.FilePermission',
    '\matt1.gif',
    'read');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    References
    For more details on java 2 permissions and security within the EJE, review
    Chapter 5, in the Java Developer's Guide. entitled,
    "Security For Oracle8i Java Applications"
    The RDBMS 8.1.7 version can be found at :
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/index.htm

    Hi, Don,
    I solved the problem of security exception I mentioned at java procedure topic as following:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException
    I tried to use your solution as following:
    call dbms_java.grant_permission('SDE', 'java.net.SocketPermission', 'ORCL.COHPA.UCF.EDU','resolve');
    but SQL*plus gave me a error message:
    invalid collumn.
    What's the problem?
    However, I call a grant command as following:
    SQL> grant JAVASYSPRIV to sde;
    and then that exception is gone. What's the difference between dbms_java.grant_permission and grant command?
    Thanks
    Bing
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by don -- oracle support:
    I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
    Permission Problems in RDBMS 8.1.6 and 8.1.7".
    It will be accessible from Oracle Support's "Metalink" site.
    "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    Problem Description
    <HR></BLOCKQUOTE>
    null

  • ORA-29532 when trying to write to a file using a Java stored procedure

    I have a Java stored procedure which gives me the following error when I run it:-
    SQL> exec zipfile('c:\temp\test.txt');
    BEGIN zipfile('c:\temp\test.txt'); END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission (java.io.FilePermission
    c:\temp\test.txt.zip write) has not been granted to SCOTT. The PL/SQL to grant
    this is dbms_java.grant_permission( 'SCOTT', 'SYS:java.io.FilePermission',
    'c:\temp\test.txt.zip', 'write' )
    ORA-06512: at "SCOTT.ZIPFILE", line 1
    ORA-06512: at line 1
    I have tried running the dbms_java command as recommended as sys and have performed the necessary commit afterwards, also I have ran dbms_java.grant_permission( 'SCOTT', 'java.io.FilePermission',
    '*', 'write' )
    But I still get the ORA-29532.
    Does anyone have any ideas as to how I can get around this ?

    Are you getting ORA-29532 for the same file and the same permission ?
    Edited by: user769997 on Nov 23, 2009 12:57 AM

  • Calling a WebServices From Java Stored Proc fails with Connection refused

    I have followed the example in Note:220662.1 on Metalink step by step.
    I am using two windows machines (2000 SP4). I have Oracle 9.2.0.5 EE on one of them and OC4J 9.0.4 standalone on the other(running on JVM 1.4.2_05-b04). The 2 servers "see" each other over the network.
    I can execute the stub from the database machine:
    C:\WebServices\HelloWorld>java HelloWorldImplWSStub
    Hello World - The current time is Sat Aug 21 11:56:20 EDT 2004When running it from the database, I get:
    SQL> select ws_hello_world from dual;
    select ws_hello_world from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: [SOAPException:
    faultCode=SOAP-ENV:IOException; msg=Connection refused;
    targetException=java.net.ConnectException: Connection refused]
    Elapsed: 00:00:21.02The trace file generated on the database server machine looks like:
    [SOAPException: faultCode=SOAP-ENV:IOException; msg=Connection refused; targetException=java.net.ConnectException: Connection refused]
      at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765)
      at org.apache.soap.rpc.Call.invoke(Call.java:261)
      at HelloWorldImplWSStub.sayHelloWorld(HelloWorldImplWSStub.java:52)Here is the stub code generated using JDeveloper 9.0.5.1:
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    import org.apache.soap.encoding.SOAPMappingRegistry;
    import java.net.URL;
    import org.apache.soap.rpc.Call;
    import org.apache.soap.Constants;
    import java.util.Vector;
    import org.apache.soap.rpc.Response;
    import org.apache.soap.rpc.Parameter;
    import org.apache.soap.Fault;
    import org.apache.soap.SOAPException;
    import java.util.Properties;
    public class HelloWorldImplWSStub  {
      public HelloWorldImplWSStub() {
        m_httpConnection = new OracleSOAPHTTPConnection();
        m_smr = new SOAPMappingRegistry();
      public static String endpoint = "http://oc4jsrv:8888/MyWorkarea-OC4J-context-root/HelloWorldImplWS";
      public String getEndpoint() {
        return _endpoint;
      public void setEndpoint(String endpoint) {
        _endpoint = endpoint;
      private static OracleSOAPHTTPConnection m_httpConnection = null;
      private static SOAPMappingRegistry m_smr = null;
      public static String sayHelloWorld() throws Exception {
        String returnVal = null;
        URL endpointURL = new URL(_endpoint);
        Call call = new Call();
        call.setSOAPTransport(m_httpConnection);
        call.setTargetObjectURI("HelloWorldImplWS");
        call.setMethodName("sayHelloWorld");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
        Vector params = new Vector();
        call.setParams(params);
        call.setSOAPMappingRegistry(m_smr);
        Response response = call.invoke(endpointURL, "");
        if (!response.generatedFault()) {
          Parameter result = response.getReturnValue();
          returnVal = (String)result.getValue();
        else {
          Fault fault = response.getFault();
          throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
        return returnVal;
      public void setMaintainSession(boolean maintainSession) {
        m_httpConnection.setMaintainSession(maintainSession);
      public boolean getMaintainSession() {
        return m_httpConnection.getMaintainSession();
      public void setTransportProperties(Properties props) {
        m_httpConnection.setProperties(props);
      public Properties getTransportProperties() {
        return m_httpConnection.getProperties();
       public static void main(String[] argv) throws Exception   {    
        HelloWorldImplWSStub hstub = new HelloWorldImplWSStub();    
        System.out.println(hstub.sayHelloWorld());  
    }The PL/SQL function code:
    CREATE OR REPLACE FUNCTION ws_hello_world RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'HelloWorldImplWSStub.sayHelloWorld() return java.lang.String';Any help would be greatly appreciated.

    Hello,I have the same problem. Did you find any solution to it?
    Thanks. Diego (Argentina)

  • Utl_dbws web service call ORA-29532

    Hello,
    I want to call web services from database (version 10.2.0.4.0) using the package utl_dbws and the SOAP message format "document".
    The web service is build with the jDeveloper 10.1.3.4 and is deployed on the OC4J server.
    With the help of the following example I tried to call my service:
    http://steveracanovic.blogspot.com/2008/10/using-utldbws-package-to-call-web.html
    A very simple example, with a web service that use the SOAP message format "document".
    I get the following error, when I try to call the service from my PLSQL script:
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request: unexpected element name: expected={http://ws/types/}sayHelloWorldElement, actual=sayHelloWorldElement
    The OC4J Server shows the same error message too:
    ERROR OWS-04045 Fehlerhafte Request-Nachricht: unexpected element name: expected={http://ws/types/}sayHelloWorldElement, actual=sayHelloWorldElement
    With an other web service that use the SOAP message format "rpc" I have success.
    But with the "rpc" style, I can only get a result with a lengh of 32k.
    Can somebody help me?
    Thank you in advance.
    regards
    Michael

    Hi,
    I had same error and then implement your solution. But I get invalid xml error (I have header and body tags)
    How can you remove Envelope tag?

  • SocketPermission & Uncaught Java Exception Problems

    Hi,
    I'm trying to run a applet that uses BC4J.
    But I'm getting a SocketPermission - resolve-connect - problem.
    When I try to grant "connect-resolve" permissions using the DBMS_JAVA procedure,
    EXEC DBMS_JAVA.GRANT_PERMISSION('CONFIG','SYS:java.net.SocketPermision', '3.8.180.87', 'connect,resolve');
    I'm getting the following exception:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.SecurityException: policy table update SYS:java.net.SocketPermision,
    3.8.180.87
    ORA-06512: at "SYS.DBMS_JAVA", line 0
    ORA-06512: at line 1
    BTW,
    Both the Web Server and the Oracle DB Server are in the same computer.
    I tried with both: SYSTEM and SYS users.
    "CONFIG" is a DB existent schema -user-
    "3.8.180.87" is the web & db server -I tried "*", too, but I got the same error-.
    Could some body help me, please?
    I think I'm doing the right steps -procedure.
    Thanks in advance,
    Agustin

    I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    It will be accessible from Oracle Support's "Metalink" site.
    "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    Problem Description
    Periodically an application running in the Enterprise Java Engine
    (EJE) formerly known as the "Oracle 8i JVM", "the JSERVER component", or
    the "Aurora JVM" will fail with a "java 2" permissions error having the
    following format :
    Note : Message shown below have been reformatted for easier readability.
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception:
    usually followed by a detailed error message similar to one of the following
    messages :
    Example # 1
    java.security.AccessControlException: the Permission
    (java.net.SocketPermission hostname resolve)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 2
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 3
    java.security.AccessControlException: the Permission
    (java.io.FilePermission \matt1.gif read)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Explanation
    The java 2 permission stated in line # 2 of each of the above "Examples"
    has not been granted to the user specified in line 4 of the above "Examples".
    Solution Description
    The methodology to solve this issue is identical for all java 2 permissions
    cases.
    1) Format a call "dbms_java.grant_permission" procedure as described below.
    2) Logon as SYS or SYSTEM
    3) Issue the TWO commands shown below
    4) Logoff as SYS or SYSTEM
    5) Retry your application
    For Example # 1
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.net.SocketPermission',
    'hostname',
    'resolve');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 2
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.util.PropertyPermission',
    'read,write');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 3
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.io.FilePermission',
    '\matt1.gif',
    'read');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    References
    For more details on java 2 permissions and security within the EJE, review
    Chapter 5, in the Java Developer's Guide. entitled,
    "Security For Oracle8i Java Applications"
    The RDBMS 8.1.7 version can be found at :
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/index.htm
    null

  • Uncaught java exception

    Hi, all,
    I recently installed Oracle8.1.7. I tried to create java in DBA STUDIO and got an error:
    VBO-1508: An error has occured and the server object could not be initialized. Please disconnect and try again.
    ORA-29532: Java call terminated by uncaught java exception: oracle.aurora.rdbms.ModifypermissionException: in [email protected]_available
    ORA-01031: insufficient privileges.
    I have ever deployed the java class to Oracle8.1.5 before and I could call the java using SQL statements. But after I installed 8.1.7, I can't deploy java to Oracle8.1.7 using either Jdeveloper and loadjava command.
    that error message is :
    oracle.jdeveloper.cm.CMException: Connection
    refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12500)(ERROR_STACK=(ERROR=(CODE=12500)(EMFI=4))(ERROR=(CODE=12560)(EMFI=4))(ERROR=(CODE=530)(EMFI=4))(ERROR=(BUF=''))))
    at
    oracle.jdeveloper.cm.JdbcConnectionWrapper.createConnection(Compiled
    Code)
    at
    oracle.jdeveloper.cm.ConnectionWrapper.<init>(Compiled
    Code)
    Can someone tell me what's the problem?
    Thanks.
    Bing
    null

    Please post the details of the application release, database version and OS.
    Recently, there was a java upgrade in my system What is this upgrade? From what version to what version?
    What is your client OS/Browser?
    What is the Jinitiator version?
    and after that when i login to E-Biz suite, i get the following Jinitiator error and many Jinitiator windows open up with this error.
    Uncaught Java Exception while persisting the null bean
    Java.io.NotSerializableException:java.lang.thread
    at.java.io.ObjectOutputStream.outputObject(Compiled Code)
    at.java.io.ObjectOutputStream.writeObject(Compiled Code)
    at.java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:369)
    at.java.io.ObjectOutputStream.outputObject(Compiled Code)
    at.java.io.ObjectOutputStream.writeObject(Compiled Code)
    at sun.beans.ole.OleBeanInterface.saveBean(OleBeanInterface.java.508)It is very difficult to deal with many jinitiator error windows opening up.
    Could any one tell the reason for this issue and its resolution as well?Is the issue with all clients and all browsers?
    Have you tried to clear the jcache and the browser history files?
    Thanks,
    Hussein

  • Simple geometry gets ORA-29532 error on all SDO_GEOM calls

    Hi all,
    I have a single point in a table such that the query:
    select SDO_GEOM.VALIDATE_GEOMETRY(geomObj, 0.05) from testvalid;
    /* Returns */
    SDO_GEOM.VALIDATE_GEOMETRY(GEOMOBJ,0.05)
    'TRUE'However the query:
    select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid;Receives the following error:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.NumberFormatException: empty String
    ORA-06512: at "MDSYS.SDO_3GL", line 658
    ORA-06512: at "MDSYS.SDO_GEOM", line 519
    ORA-06512: at "MDSYS.SDO_GEOM", line 558
    ORA-06512: at line 1The data itself is a single sdo_point:
    select GEOMOBJ from testvalid;
    /* Returns: */
    GEOMOBJ
    '(3001, , (174.092329032787, 129.420551704918, -71.2857142857142), , )'I think that the problem is something to do with the precision of the stored X, Y and Z values in the point because if I run the following:
    update TESTVALID set GEOMOBJ.sdo_point.x = cast(GEOMOBJ.sdo_point.x as number(8,3));
    select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid;
    /* Returns: */
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOMOBJ,0.05)
    'TRUE'Similarly, running a direct comparison from an object made on the fly from the point's text representation works fine:
    select SDO_GEOM.VALIDATE_GEOMETRY_with_context("MDSYS"."SDO_GEOMETRY"(3001,NULL, "MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL), 0.005) from dual;
    /* Returns */
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT("MDSYS"."SDO_GEOMETRY"(3001,NULL,"MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL),0.005)
    'TRUE'Note that I only noticed this problem after upgrading from v11 to v11 R2. Also, the same ORA-29532 error comes up when running any of the SDO_GEOM.[x] function calls such as SDO_GEOM.DISTANCE(). The problem is not limited to SDO_POINT type geometries, yet the problem occurs only on some geometry entries in my database. It is repeatable in that the same geometry will continue to fail and the only solution I've found is to try to round down its precision in x, y, and/or z. I only know how to easily round down the precision for SDO_POINT types, so one of my problems is that I'm left with a whole scattering of other geometries that I can no longer spatially query.
    The datas themselves were inserted from MATLAB (which connects using v11 Oracle ODBC Java drivers) which converts my coordinates to java.math.BigDecimal and binds them to an oracle prepared statement.
    One possibility that I'm considering is that the insertion is done from various computers, some of which are 64-bit machines. Maybe somehow those machines are pumping in coordinates to a precision too great for oracle geometry?
    Any help would be fantastic as I'm pretty lost here.
    If the precision is indeed the problem, does anyone know how I can trim off those excess values after the decimal point for all geometry types?
    Thanks,
    Sven.

    The problem is with the way the ordiantes are created via java programs pre 11.2.
    There was a bit alignment problem in the internal representation of the number when these numbers are created from a java program.
    In 11.2 this corruption is fixed, but as a result the data that is already corrupted gives this "empty string" error.
    It is very easy to fix. Follow the steps in the script below.
    create or replace function id_geom ( g in sdo_geometry)
    return sdo_geometry deterministic as
    g1 sdo_geometry ;
    idx number;
    ords sdo_ordinate_array;
    x number;
    y number;
    z number;
    point_t sdo_point_type;
    begin
    if (g.sdo_point is not NULL) then
    x := NULL; y := NULL; z := NULL;
    if (g.sdo_point.x is not NULL) then
    x := g.sdo_point.x * 10;
    x := x / 10;
    end if;
    if (g.sdo_point.y is not NULL) then
    y := g.sdo_point.y * 10;
    y := y / 10;
    end if;
    if (g.sdo_point.z is not NULL) then
    z := g.sdo_point.z * 10;
    z := z / 10;
    end if;
    point_t := SDO_POINT_TYPE(x,y,z);
    else
    point_t := NULL;
    end if;
    if (g.sdo_ordinates is not NULL) then
    ords := sdo_ordinate_array();
    ords.extend(g.sdo_ordinates.count);
    for idx in 1 .. ords.count loop
    x := g.sdo_ordinates(idx);
    x := (x*10.0);
    x := x/10.0;
    ords(idx) := x;
    end loop;
    g1 := sdo_geometry(g.sdo_gtype, g.sdo_srid,point_t,g.sdo_elem_info,ords);
    else
    g1 := sdo_geometry(g.sdo_gtype, g.sdo_srid,point_t,g.sdo_elem_info, NULL);
    end if;
    return g1;
    end;
    And then update the rows with geometry data with SQL like this:
    update geom_table set geom = id_geom(geom);

  • Oracle Database Web Service Client using UTL_DBWS :: ORA-29532 Error

    Hi,
    I have the Oracle Database 10.2.0.1.0 :-
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - ProductionI have written a simple Web Services Client using the classes gfrom the UTL_DBWS package. I loaded the JAR file dbwsclient.jar in the SYS Schema and I am trying to use it in the USF Schema.
    However, I have hit this error & I ma unable to proceed :-
    SQL>  select get_stock_price from dual;
    select get_stock_price from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.IllegalAccessException: javax.xml.rpc.ServiceException:
    java.security.AccessControlException: the Permission
    (java.lang.RuntimePermission getClassLoader) has not been granted to USF. The
    PL/SQL to grant this is dbms_java.grant_permission( 'USF',
    'SYS:java.lang.RuntimePermission', 'getClassLoader', '' )
    ORA-06512: at "USF.UTL_DBWS", line 193
    ORA-06512: at "USF.UTL_DBWS", line 190
    ORA-06512: at "USF.GET_STOCK_PRICE", line 17Can you please help me with this ?
    Regards,
    Sandeep

    Hi,
    The error message said
    the Permission(java.lang.RuntimePermission getClassLoader) has not been granted to USF.
    I'd follow the suggestion
    The PL/SQL to grant this is dbms_java.grant_permission( 'USF','SYS:java.lang.RuntimePermission', 'getClassLoader', '' )
    In case you have not done so, consult the Callout Users Guide @
    http://www.oracle.com/technology/sample_code/tech/java/jsp/callout_users_guide.htm
    Kuassi http://db360.blogspot.com

  • ORA-29532 error when invoking SSL web services using UTL_DBWS

    Web Service gurus,
    The WSDL for web services is as follows -
    <definitions name="Webservice" targetNamespace="http://webservice.airclic.com/">

    <types>

    <xs:schema targetNamespace="http://webservice.airclic.com/" version="1.0">
    <xs:element name="Exception" type="tns:Exception"/>
    <xs:element name="listenForEvents" type="tns:listenForEvents"/>
    <xs:element name="listenForEventsResponse" type="tns:listenForEventsResponse"/>
    <xs:element name="sendAuthenticationResponse" type="tns:sendAuthenticationResponse"/>
    <xs:element name="sendAuthenticationResponseResponse" type="tns:sendAuthenticationResponseResponse"/>
    <xs:element name="upsertTask" type="tns:upsertTask"/>
    <xs:element name="upsertTaskResponse" type="tns:upsertTaskResponse"/>

    <xs:complexType name="upsertTask">

    <xs:sequence>
    <xs:element minOccurs="0" name="task" type="tns:Task"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Task">

    <xs:complexContent>

    <xs:extension base="tns:PlatformObject">

    <xs:sequence>
    <xs:element minOccurs="0" name="status" type="tns:status"/>
    <xs:element minOccurs="0" name="assignee" type="xs:string"/>
    <xs:element minOccurs="0" name="assigneeUserId" type="xs:string"/>
    <xs:element minOccurs="0" name="name" type="xs:string"/>
    <xs:element minOccurs="0" name="type" type="xs:string"/>
    <xs:element minOccurs="0" name="creationTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="updateTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="startTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="endTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="source" type="tns:source"/>
    <xs:element minOccurs="0" name="notes" type="xs:string"/>
    <xs:element minOccurs="0" name="priority" type="xs:int"/>
    <xs:element minOccurs="0" name="penalized" type="xs:boolean"/>
    <xs:element minOccurs="0" name="hasSLA" type="xs:boolean"/>
    <xs:element minOccurs="0" name="location" type="tns:Location"/>
    <xs:element minOccurs="0" name="windowStartTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="windowEndTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="signee" type="xs:string"/>
    <xs:element minOccurs="0" name="signature" type="xs:base64Binary"/>
    <xs:element minOccurs="0" name="customerId" type="xs:string"/>
    <xs:element minOccurs="0" name="travelTime" type="xs:int"/>
    <xs:element minOccurs="0" name="expirationTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="parentId" type="xs:long"/>
    <xs:element minOccurs="0" name="externalTimezone" type="xs:string"/>
    <xs:element minOccurs="0" name="localTimeOffset" type="xs:long"/>
    <xs:element minOccurs="0" name="consignee" type="xs:string"/>
    <xs:element minOccurs="0" name="assignmentWindowStartTimestamp" type="xs:long"/>
    <xs:element minOccurs="0" name="assignmentWindowEndTimestamp" type="xs:long"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="PlatformObject">

    <xs:sequence>
    <xs:element name="id" type="xs:string"/>
    <xs:element name="externalId" type="xs:string"/>
    <xs:element name="revision" type="xs:long"/>
    <xs:element name="platformDateCreated" type="xs:dateTime"/>
    <xs:element name="platformDateUpdated" type="xs:dateTime"/>
    <xs:element name="objectName" type="xs:string"/>
    <xs:element maxOccurs="unbounded" name="extendedAttributes" type="tns:ExtendedAttribute"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Location">

    <xs:sequence>
    <xs:element minOccurs="0" name="name" type="xs:string"/>
    <xs:element minOccurs="0" name="description" type="xs:string"/>
    <xs:element minOccurs="0" name="type" type="xs:string"/>
    <xs:element minOccurs="0" name="address" type="tns:Address"/>
    <xs:element minOccurs="0" name="position" type="tns:Position"/>
    <xs:element minOccurs="0" name="geofenceId" type="xs:long"/>
    <xs:element minOccurs="0" name="capcity" type="xs:int"/>
    <xs:element minOccurs="0" name="contact" type="xs:string"/>
    <xs:element minOccurs="0" name="email" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Address">

    <xs:sequence>
    <xs:element minOccurs="0" name="addressLine" type="xs:string"/>
    <xs:element minOccurs="0" name="addressLine2" type="xs:string"/>
    <xs:element minOccurs="0" name="city" type="xs:string"/>
    <xs:element minOccurs="0" name="secondaryCity" type="xs:string"/>
    <xs:element minOccurs="0" name="subdivision" type="xs:string"/>
    <xs:element minOccurs="0" name="postalCode" type="xs:string"/>
    <xs:element minOccurs="0" name="country" type="xs:string"/>
    <xs:element minOccurs="0" name="phone" type="xs:string"/>
    <xs:element minOccurs="0" name="freeform" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Position">

    <xs:sequence>
    <xs:element name="latitude" type="xs:double"/>
    <xs:element name="longitude" type="xs:double"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="ExtendedAttribute">

    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element name="value" type="xs:anyType"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="upsertTaskResponse">

    <xs:sequence>
    <xs:element minOccurs="0" name="task" type="tns:Task"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Exception">

    <xs:sequence>
    <xs:element minOccurs="0" name="message" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="listenForEvents">

    <xs:sequence>
    <xs:element minOccurs="0" name="listenParams" type="tns:ListenParams"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="ListenParams">

    <xs:sequence>
    <xs:element name="queueName" type="xs:string"/>
    <xs:element name="resendLast" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="listenForEventsResponse">

    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="events" type="tns:Event"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Event">

    <xs:sequence>
    <xs:element name="id" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="AuthenticationRequestEvent">

    <xs:complexContent>

    <xs:extension base="tns:RequestEvent">

    <xs:sequence>
    <xs:element name="username" type="xs:string"/>
    <xs:element minOccurs="0" name="password" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="RequestEvent">

    <xs:complexContent>

    <xs:extension base="tns:Event">

    <xs:sequence>
    <xs:element name="correlationId" type="xs:string"/>
    <xs:element name="response" type="tns:Response"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="Response">

    <xs:sequence>
    <xs:element name="correlationId" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="AuthenticationResponse">

    <xs:complexContent>

    <xs:extension base="tns:Response">

    <xs:sequence>
    <xs:element name="success" type="xs:boolean"/>
    <xs:element name="username" type="xs:string"/>
    <xs:element minOccurs="0" name="password" type="xs:string"/>
    <xs:element minOccurs="0" name="firstName" type="xs:string"/>
    <xs:element minOccurs="0" name="lastName" type="xs:string"/>
    <xs:element minOccurs="0" name="email" type="xs:string"/>
    <xs:element minOccurs="0" name="active" type="xs:boolean"/>
    <xs:element minOccurs="0" name="timeZone" type="xs:string"/>
    <xs:element minOccurs="0" name="group" type="xs:string"/>
    <xs:element minOccurs="0" name="role" type="xs:string"/>
    <xs:element minOccurs="0" name="errorCode" type="xs:string"/>
    <xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="DispatchEvent">

    <xs:complexContent>

    <xs:extension base="tns:Event">

    <xs:sequence>
    <xs:element name="type" type="tns:eventType"/>
    <xs:element minOccurs="0" name="previousTask" type="tns:Task"/>
    <xs:element name="changeTask" type="tns:Task"/>
    <xs:element minOccurs="0" name="newTask" type="tns:Task"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="sendAuthenticationResponse">

    <xs:sequence>
    <xs:element minOccurs="0" name="authenticationResponse" type="tns:AuthenticationResponse"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="sendAuthenticationResponseResponse">
    <xs:sequence/>
    </xs:complexType>

    <xs:simpleType name="status">

    <xs:restriction base="xs:string">
    <xs:enumeration value="NULL"/>
    <xs:enumeration value="UNASSIGNED"/>
    <xs:enumeration value="ASSIGNED"/>
    <xs:enumeration value="RECEIVED"/>
    <xs:enumeration value="ACCEPTED"/>
    <xs:enumeration value="REJECTED"/>
    <xs:enumeration value="IN_PROGRESS"/>
    <xs:enumeration value="POSTPONED"/>
    <xs:enumeration value="COMPLETED"/>
    <xs:enumeration value="CANCELED"/>
    <xs:enumeration value="CLEARED"/>
    <xs:enumeration value="EXPIRED"/>
    </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="source">

    <xs:restriction base="xs:string">
    <xs:enumeration value="NULL"/>
    <xs:enumeration value="DISPATCH"/>
    <xs:enumeration value="SYSTEM"/>
    <xs:enumeration value="ENDUSER"/>
    </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="eventType">

    <xs:restriction base="xs:string">
    <xs:enumeration value="TaskCreated"/>
    <xs:enumeration value="TaskUpdated"/>
    <xs:enumeration value="TaskAssigned"/>
    <xs:enumeration value="TaskDeleted"/>
    <xs:enumeration value="TaskStatusChanged"/>
    <xs:enumeration value="TaskConflicted"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>
    </types>

    <message name="Webservice_listenForEvents">
    <part element="tns:listenForEvents" name="listenForEvents"/>
    </message>

    <message name="Webservice_sendAuthenticationResponseResponse">
    <part element="tns:sendAuthenticationResponseResponse" name="sendAuthenticationResponseResponse"/>
    </message>

    <message name="Webservice_sendAuthenticationResponse">
    <part element="tns:sendAuthenticationResponse" name="sendAuthenticationResponse"/>
    </message>

    <message name="Webservice_upsertTaskResponse">
    <part element="tns:upsertTaskResponse" name="upsertTaskResponse"/>
    </message>

    <message name="Exception">
    <part element="tns:Exception" name="Exception"/>
    </message>

    <message name="Webservice_upsertTask">
    <part element="tns:upsertTask" name="upsertTask"/>
    </message>

    <message name="Webservice_listenForEventsResponse">
    <part element="tns:listenForEventsResponse" name="listenForEventsResponse"/>
    </message>

    <portType name="Webservice">

    <operation name="listenForEvents" parameterOrder="listenForEvents">
    <input message="tns:Webservice_listenForEvents"/>
    <output message="tns:Webservice_listenForEventsResponse"/>
    <fault message="tns:Exception" name="Exception"/>
    </operation>

    <operation name="sendAuthenticationResponse" parameterOrder="sendAuthenticationResponse">
    <input message="tns:Webservice_sendAuthenticationResponse"/>
    <output message="tns:Webservice_sendAuthenticationResponseResponse"/>
    <fault message="tns:Exception" name="Exception"/>
    </operation>

    <operation name="upsertTask" parameterOrder="upsertTask">
    <input message="tns:Webservice_upsertTask"/>
    <output message="tns:Webservice_upsertTaskResponse"/>
    <fault message="tns:Exception" name="Exception"/>
    </operation>
    </portType>

    <binding name="WebserviceBinding" type="tns:Webservice">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="listenForEvents">
    <soap:operation soapAction=""/>

    <input>
    <soap:body use="literal"/>
    </input>

    <output>
    <soap:body use="literal"/>
    </output>

    <fault name="Exception">
    <soap:fault name="Exception" use="literal"/>
    </fault>
    </operation>

    <operation name="sendAuthenticationResponse">
    <soap:operation soapAction=""/>

    <input>
    <soap:body use="literal"/>
    </input>

    <output>
    <soap:body use="literal"/>
    </output>

    <fault name="Exception">
    <soap:fault name="Exception" use="literal"/>
    </fault>
    </operation>

    <operation name="upsertTask">
    <soap:operation soapAction=""/>

    <input>
    <soap:body use="literal"/>
    </input>

    <output>
    <soap:body use="literal"/>
    </output>

    <fault name="Exception">
    <soap:fault name="Exception" use="literal"/>
    </fault>
    </operation>
    </binding>

    <service name="Webservice">

    <port binding="tns:WebserviceBinding" name="WebservicePort">
    <soap:address location="https://webservice.mp.b.airclic.com:443/webservice/product/fieldservice/v1/Webservice"/>
    </port>
    </service>
    </definitions>
    Following is the pl/sql code using UTL_DBWS
    DECLARE
    l_service UTL_DBWS.service;
    l_call UTL_DBWS.call;
    l_wsdl_url VARCHAR2(32767);
    l_namespace VARCHAR2(32767);
    l_service_qname UTL_DBWS.qname;
    l_port_qname UTL_DBWS.qname;
    l_operation_qname UTL_DBWS.qname;
    l_input_params UTL_DBWS.anydata_list;
    soap_request xmltype;
    l_result xmltype;
    result_output VARCHAR2(32767);
    BEGIN
    l_wsdl_url := 'https://webservice.mp.b.airclic.com/webservice/product/fieldservice/v1/Webservice?WSDL';
    l_namespace := 'http://webservice.airclic.com/';
    dbms_output.put_line ('1');
    l_service_qname := UTL_DBWS.to_qname(l_namespace, 'Webservice');
    dbms_output.put_line ('2');
    l_port_qname := UTL_DBWS.to_qname(l_namespace, 'WebservicePort');
    dbms_output.put_line ('3');
    l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sendAuthenticationResponse');
    dbms_output.put_line ('4');
    l_service := UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_qname);
    dbms_output.put_line ('5');
    l_call := UTL_DBWS.create_call (
    service_handle => l_service,
    port_name => l_port_qname,
    operation_name => l_operation_qname);
    dbms_output.put_line ('6');
    UTL_DBWS.SET_PROPERTY(l_call,'USERNAME',<username to access wsdl>);
    dbms_output.put_line ('7');
    UTL_DBWS.SET_PROPERTY(l_call,'PASSWORD',<password>);
    dbms_output.put_line ('8');
    utl_dbws.set_property(l_call,'OPERATION_STYLE', 'document');
    dbms_output.put_line ('9');
    soap_request := xmltype.createxml('<?xml version="1.0" encoding="UTF-8"?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <ns2:sendAuthenticationResponse xmlns:ns2="http://webservice.airclic.com/">
    <authenticationResponse>
    <correlationId>4646735802698040711:[email protected]</correlationId>
    <success>true</success>
    <username>changlanih</username>
    <password>abcd1234</password>
    <firstName>hero</firstName>
    <lastName>changlani</lastName>
    <email>[email protected]</email>
    <active>true</active>
    <timeZone>eastern</timeZone>
    <group>Northeast</group>
    <role>Service Manager</role>
    </authenticationResponse>
    </ns2:sendAuthenticationResponse>
    </S:Body>
    </S:Envelope>');
    l_result := UTL_DBWS.invoke ( l_call,soap_request);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    result_output := l_result.getstringval;
    dbms_output.put_line('web svc output ===> ' || result_output);
    END;
    Following is the error from pl/sql code
    1
    2
    3
    4
    DECLARE
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException:
    Failed to read WSDL from https://webservice.mp.b.airclic.com/webservice/product/fieldservice/v1/Webservice?WSDL:
    HTTP connection error code is 401
    ORA-06512: at "SYS.UTL_DBWS", line 193
    ORA-06512: at "SYS.UTL_DBWS", line 190
    ORA-06512: at line 20
    Notes
    The program fails at following line of code -
    l_service := UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_qname);
    Web services are SSL.
    The WSDL is at https location and needs username/password for access. The username/password to access WSDL are set using UTL_DBWS.SET_PROPERTY
    To access the SSL site, I have imported the CA in Oracle Wallet, JVM home and JDK home.
    Can anyone tell me what am I doing wrong here. I am not able to even establish connection to web service host.
    This is very frustrating - Oracle has no examples on how to access a SSL Web Service (that needs authentication) from Database.
    This is effecting our project deadlines ......... any help would be greatly appreciated.
    Thanks.

    Hi,
    I presume your Web Service needs HTTP (BASIC?) Authentication.
    All this needs is setting the following 2 properties, which as can be seen, you are setting....
    UTL_DBWS.set_property(l_call, 'USERNAME', '<username>');
    UTL_DBWS.set_property(l_call, 'PASSWORD', '<pwd>');
    This should work as long as your DBWS Callout Utility was downloaded from OTN after June 2008, and it's version is atleast 10.1.3.1.
    Following is a sample code snippet that was tested successfully for this :
    Declare
    l_service UTL_DBWS.service;
    l_call UTL_DBWS.call;
    l_result sys.XMLTYPE;
    l_request sys.XMLTYPE;
    BEGIN
    l_service := UTL_DBWS.create_service(null);
    l_call := UTL_DBWS.create_call(l_service);
    UTL_DBWS.set_target_endpoint_address(l_call, 'http://xxx.oracle.com:8888/basic/MyWebService1SoapHttpPort');
    UTL_DBWS.set_property(l_call, 'USERNAME', 'username');
    UTL_DBWS.set_property(l_call, 'PASSWORD', 'pwd');
    UTL_DBWS.set_property(l_call, 'OPERATION_STYLE', 'document');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_USE', 'true');
    UTL_DBWS.set_property(l_call, 'SOAPACTION_URI', 'http://xxx.oracle.com:8888/basic/MyWebService1SoapHttpPort');
    l_request := XMLTYPE('<Z_CENTRICITY_GET_DOCLIST
    xmlns:urn="urn:sap-com:document:sap:rfc:functions">' ||
    '<I_INCLUDE_OLD_VERSIONS></I_INCLUDE_OLD_VERSIONS>' ||
    '<I_INSTITUTION>0001</I_INSTITUTION>' ||
    '<I_PATIENT_NR>0000000181</I_PATIENT_NR>' ||
    '</Z_CENTRICITY_GET_DOCLIST>');
    l_result := UTL_DBWS.invoke(l_call, l_request);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(sqlcode || ' ' || sqlerrm);
    END;
    Hope this helps,
    Yogesh

Maybe you are looking for