UTL_DBWS

After a clean 11.2 install and following the instructions when i use the loadjava for sys I get
loading : class com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$1
Error while creating class com/sun/jmx/interceptor/DefaultMBeanServerInterceptor
$1
ORA-01031: insufficient privileges
ORA-06512: at line 1
genmissing: com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ListenerWrappe
r
creating : class com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ListenerW
rapper
loading : class com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ListenerW
rapper
Error while creating class com/sun/jmx/interceptor/DefaultMBeanServerInterceptor
$ListenerWrapper
ORA-01031: insufficient privileges
ORA-06512: at line 1
why would i have insufficient privileges?
also is there any method to grant to jmx or is it a case I need to add a lib/jar file

to create this issue, i used windows xp sp3. Installed oracle 11g 11.2.0, i then followed the dbws callout example for 11g, however installed the client admin type to %ORACLE_HOME%\dbhome_1.
Following the example used loadjava for the 2 wsclient file. This was the first error seen on the loadjava response
home this is enough info, i also have the oracle weblogic loaded on the same box.

Similar Messages

  • Unable to call WSS (WS-Security) enabled Web Service using UTL_DBWS

    We are attempting to call a WSS (WS-Security) enabled Web Service from PL/SQL using the UTL_DBWS package (see [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_dbws.htm#CHDIDGJH] ). We are doing this in similar fashion to [http://www.oracle-base.com/articles/10g/utl_dbws10g.php] with calls to utl_dbws.create_service, utl_dbws.create_call and utl_dbws.invoke.
    Using this method we can successfully call an unsecured Web Service, but calls to WSS-enabled Web Services fail. We are currently using Oracle Database 10.2.0.3.
    The failure we are getting is:
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException:
    com.sun.xml.wss.XWSSecurityException: Message does not conform to configured
    policy ( AuthenticationTokenPolicy(S) ): No Security Header found;nested
    exception is com.sun.xml.wss.XWSSecurityException:
    com.sun.xml.wss.XWSSecurityException: Message does not conform to configured
    policy ( AuthenticationTokenPlicy(S) ): No Security Header found
    Apparently UTL_DBWS does not support calling WSS enabled services, although this doesn't appear to be an officially recognised position. Does anyone know if Oracle are planning to support this soon (if ever)? Looking at Re: Calling WS from PL/SQL using WS-security suggests that support has been considered before, but not yet realised.
    Thanks,
    Tom

    Having raised a Service Request with Oracle support on this, I got the following response from Oracle Development (On unpublished bug [8542959|https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=BUG&p_id=8542959]):
    Development has confirmed that WS-Security is not supported through UTL_DBWS. They have also acknowledged that this is not documented and they will change the official Oracle documentation will reflect this fact. From what is being stated, it would appear that there is no plan to support the use of WS-Security through UTL_DBWS in any release in the near future.
    So, in short, without developing your own home-grown SOAP request, there is no way to call a WSS enabled web service from within PL/SQL.
    -Tom

  • Error while calling utl_dbws.create_service

    hi,
    i get following error
    "ORA-29541: class SYS.oracle/jpub/runtime/dbws/DbwsProxy could not be resolved"
    while calling a webservice from utl_dbws.create_service
    Can any on help me.
    kiran

    Done That,
    Thanx a ton Dave, it worked.
    So I am finally moving on :-)
    Just one question Dave, I happened to work on the Beta release of this version too, the problem was not there. How come we have been able to get it in dev preview.

  • Error while calling .svc web service from pl/sql using utl_dbws

    Hello Folks,
    I am calling a .svc web service from pl/sql using utl_dbws and encountering the following error
    javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
    Can you help me find what am I doing wrong?
    Thanks
    Rk

    Hi,
    Here are the details
    1. What version?
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    2. What error message ... we need the full and complete error stack not your interpretation of it.
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Messag
    3. "I am calling means what?" We need the full and complete statement showing the values of all parameters.
    The input to the web-service is a xmltype containing address information and the web-service returns a string
    CREATE OR REPLACE FUNCTION get_id
    RETURN VARCHAR2
    AS
    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_xmltype_in SYS.XMLTYPE;
    l_xmltype_out SYS.XMLTYPE;
    l_return VARCHAR2 (32767);
    BEGIN
    l_wsdl_url := 'http://test.com/test.svc?wsdl';
    l_namespace := 'http://test.org/';
    l_service_qname := UTL_DBWS.to_qname (l_namespace, 'SName');
    l_port_qname := UTL_DBWS.to_qname (l_namespace, 'BasicHttpBinding_ISName');
    l_operation_qname := UTL_DBWS.to_qname (l_namespace, 'Iden');
    l_service :=
    UTL_DBWS.create_service
    (wsdl_document_location => urifactory.geturi
    (l_wsdl_url),
    service_name => l_service_qname
    l_call :=
    UTL_DBWS.create_call (service_handle => l_service,
    port_name => l_port_qname,
    operation_name => l_operation_qname
    l_xmltype_in :=
    SYS.XMLTYPE
    ('<IdenRequest xmlns:i="http://www.w3.org/XMLSchema-instance" xmlns="http://test.org/SNameIden.WCFService">
    <address />
    <zip>12345</zip>
    <state>AA</state>
    <street>W Test </street>
    </address>
    </IdenRequest>'
    l_xmltype_out :=
    UTL_DBWS.invoke (call_handle => l_call,
    request => l_xmltype_in);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    l_return := l_xmltype_out.EXTRACT ('//Iden/text()').getstringval();
    RETURN l_return;
    END;
    /

  • UTL_DBWS - Multiple calls to a web-service

    I am new to using UTL_DBWS and am wondering how to call a web-serivce multiple times with the same connection.
    I have this sample code and am wondering if there are any experts to tell me if this is right?
    DECLARE
       l_city   VARCHAR2 (500);
       PROCEDURE get_city_from_zipcode
       AS
          l_service           UTL_DBWS.service;
          l_call              UTL_DBWS.CALL;
          l_result            ANYDATA;
          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;
       BEGIN
          l_wsdl_url := 'http://webservices.imacination.com/distance/Distance.jws?wsdl';
          l_namespace := 'http://webservices.imacination.com/distance/Distance.jws';
          l_service_qname := UTL_DBWS.to_qname (l_namespace, 'DistanceService');
          l_port_qname := UTL_DBWS.to_qname (l_namespace, 'Distance');
          l_operation_qname := UTL_DBWS.to_qname (l_namespace, 'getCity');
          l_service := UTL_DBWS.create_service (wsdl_document_location      => urifactory.geturi (l_wsdl_url), service_name => l_service_qname);
          l_call := UTL_DBWS.create_call (service_handle      => l_service
                                        , port_name           => l_port_qname
                                        , operation_name      => l_operation_qname
          FOR cur IN (SELECT '94065' zip
                        FROM DUAL
                      UNION ALL
                      SELECT '94066' zip
                        FROM DUAL)
          LOOP
             l_input_params (0) := ANYDATA.convertvarchar2 (cur.zip);
             l_result := UTL_DBWS.invoke (call_handle       => l_call, input_params => l_input_params);
             DBMS_OUTPUT.put_line (ANYDATA.accessvarchar2 (l_result));
          END LOOP;
          UTL_DBWS.release_call (call_handle      => l_call);
          UTL_DBWS.release_service (service_handle      => l_service);
       END;
    BEGIN
       get_city_from_zipcode;
    END;Thanks

    Well, I don't have APEX installed. I'm trying to use in a standalone way, just to make RESTful requests from PL/SQL (i don't need APEX). Is it possible to share all the objects referenced in the package flex_ws_api?
    thanks

  • "No Deserializer found" using UTL_DBWS

    Hi guys,
    I've been using web services before, but I just can't set this one up.
    I tried sooo many different combinations in namespaces and such, but the code below still gives
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: No Deserializer found to deserialize a 'http://es.tsystems.icam.iit.comunicacioIndirecta.consultarIt.presentacio.webservices/IConsultarItWS.xsd:ns1:usuari' using encoding style 'null'. [java.lang.IllegalArgumentException]
    CREATE OR REPLACE FUNCTION K_TEST RETURN VARCHAR2 AS
    v_WSDL      VARCHAR2(100) := 'https://pre.salut.gencat.net/sic_iit/AppJava/ConsultarItWS?WSDL';
    v_service   UTL_DBWS.SERVICE;
    v_call      UTL_DBWS.CALL;
    v_request   CLOB;
    v_response  XMLTYPE;
    BEGIN
      v_service := UTL_DBWS.CREATE_SERVICE(UTL_DBWS.TO_QNAME(NULL, 'ConsultarItWS'));
      v_call := UTL_DBWS.CREATE_CALL(v_service);
      UTL_DBWS.SET_TARGET_ENDPOINT_ADDRESS(v_call, v_WSDL);
      UTL_DBWS.SET_PROPERTY(v_call, 'OPERATION_STYLE', 'DOCUMENT');
      UTL_DBWS.SET_PROPERTY(v_call, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
      v_request := '
    <ns1:ConsultaSituacioIT xmlns:tns="http://es/tsystems/icam/iit/comunicacioIndirecta/consultarIt/presentacio/webservices/ConsultarItWS.wsdl" xmlns:ns1="http://es.tsystems.icam.iit.comunicacioIndirecta.consultarIt.presentacio.webservices/IConsultarItWS.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_ConsultaSituacioITVO">
      <ns1:usuari  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_UsuariVO">
        <CODI_USUARI  xsi:type="xsd:string">M003</CODI_USUARI>
        <CLAU_USUARI  xsi:type="xsd:string">temp</CLAU_USUARI>
        <NOM_USUARI  xsi:type="xsd:string">Proves</NOM_USUARI>
        <PRIMER_COGNOM_USUARI  xsi:type="xsd:string">Activa</PRIMER_COGNOM_USUARI>
        <SEGON_COGNOM_USUARI  xsi:type="xsd:string"></SEGON_COGNOM_USUARI>
        <NUM_COLEGIAT  xsi:type="xsd:string"></NUM_COLEGIAT>
        <DNI_USUARI  xsi:type="xsd:string">37735679K</DNI_USUARI>
      </ns1:usuari>
      <atencioPrimaria  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_AtencioPrimariaVO">
        <TIPUS_AP_COMUNICADORA  xsi:type="xsd:string">1</TIPUS_AP_COMUNICADORA>
        <CODI_AP_COMUNICADORA  xsi:type="xsd:string">M003</CODI_AP_COMUNICADORA>
        <COLEGIACIO  xsi:type="xsd:string"></COLEGIACIO>
        <CODI_PROVINCIA_COLEGIAT  xsi:type="xsd:string"></CODI_PROVINCIA_COLEGIAT>
        <NUMERO_COLEGIAT  xsi:type="xsd:string"></NUMERO_COLEGIAT>
        <DIGIT_CONTROL_COLEGIAT  xsi:type="xsd:string"></DIGIT_CONTROL_COLEGIAT>
        <NOM_COLEGIAT  xsi:type="xsd:string"></NOM_COLEGIAT>
        <PRIMER_COGNOM_COLEGIAT  xsi:type="xsd:string"></PRIMER_COGNOM_COLEGIAT>
        <SEGON_COGNOM_COLEGIAT  xsi:type="xsd:string"></SEGON_COGNOM_COLEGIAT>
      </atencioPrimaria>
      <ciutada  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_PeticioCiutadaVO">
        <NIC_CIUTADA  xsi:type="xsd:string"></NIC_CIUTADA>
        <NASS_CIUTADA  xsi:type="xsd:string">080213160436</NASS_CIUTADA>
        <NIA_CIUTADA  xsi:type="xsd:string"></NIA_CIUTADA>
        <CIP_CIUTADA  xsi:type="xsd:string"></CIP_CIUTADA>
        <DOCUMENT_ID_CIUTADA  xsi:type="xsd:string">37453036M</DOCUMENT_ID_CIUTADA>
        <TIPUS_DOCUMENT_CIUTADA  xsi:type="xsd:string">1</TIPUS_DOCUMENT_CIUTADA>
        <NOM_CIUTADA  xsi:type="xsd:string">JORGE</NOM_CIUTADA>
        <PRIMER_COGNOM_CIUTADA  xsi:type="xsd:string">ADRO</PRIMER_COGNOM_CIUTADA>
        <SEGON_COGNOM_CIUTADA  xsi:type="xsd:string">MO</SEGON_COGNOM_CIUTADA>
        <GENERE  xsi:type="xsd:string">H</GENERE>
        <DATA_NAIXEMENT  xsi:type="xsd:string">11/01/1952</DATA_NAIXEMENT>
      </ciutada>
      <episodi  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_EpisodiIndicadorAnulacioVO">
        <IND_ANULATS  xsi:type="xsd:string"></IND_ANULATS>
      </episodi>
      <resultat  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_ResultatVO">
        <CODI_ERROR  xsi:type="xsd:string"></CODI_ERROR>
        <DESCRIPCIO_ERROR  xsi:type="xsd:string"></DESCRIPCIO_ERROR>
      </resultat>
    </ns1:ConsultaSituacioIT>
      v_response := UTL_DBWS.INVOKE(v_call, XMLTYPE(v_request));
      RETURN null;
    END K_TEST;Any expert in WSDL that knows how to define the XML for the request to deserialize?
    Thanks for any suggestions,
    K.

    Hi guys,
    I've been using web services before, but I just can't set this one up.
    I tried sooo many different combinations in namespaces and such, but the code below still gives
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: No Deserializer found to deserialize a 'http://es.tsystems.icam.iit.comunicacioIndirecta.consultarIt.presentacio.webservices/IConsultarItWS.xsd:ns1:usuari' using encoding style 'null'. [java.lang.IllegalArgumentException]
    CREATE OR REPLACE FUNCTION K_TEST RETURN VARCHAR2 AS
    v_WSDL      VARCHAR2(100) := 'https://pre.salut.gencat.net/sic_iit/AppJava/ConsultarItWS?WSDL';
    v_service   UTL_DBWS.SERVICE;
    v_call      UTL_DBWS.CALL;
    v_request   CLOB;
    v_response  XMLTYPE;
    BEGIN
      v_service := UTL_DBWS.CREATE_SERVICE(UTL_DBWS.TO_QNAME(NULL, 'ConsultarItWS'));
      v_call := UTL_DBWS.CREATE_CALL(v_service);
      UTL_DBWS.SET_TARGET_ENDPOINT_ADDRESS(v_call, v_WSDL);
      UTL_DBWS.SET_PROPERTY(v_call, 'OPERATION_STYLE', 'DOCUMENT');
      UTL_DBWS.SET_PROPERTY(v_call, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
      v_request := '
    <ns1:ConsultaSituacioIT xmlns:tns="http://es/tsystems/icam/iit/comunicacioIndirecta/consultarIt/presentacio/webservices/ConsultarItWS.wsdl" xmlns:ns1="http://es.tsystems.icam.iit.comunicacioIndirecta.consultarIt.presentacio.webservices/IConsultarItWS.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_ConsultaSituacioITVO">
      <ns1:usuari  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_UsuariVO">
        <CODI_USUARI  xsi:type="xsd:string">M003</CODI_USUARI>
        <CLAU_USUARI  xsi:type="xsd:string">temp</CLAU_USUARI>
        <NOM_USUARI  xsi:type="xsd:string">Proves</NOM_USUARI>
        <PRIMER_COGNOM_USUARI  xsi:type="xsd:string">Activa</PRIMER_COGNOM_USUARI>
        <SEGON_COGNOM_USUARI  xsi:type="xsd:string"></SEGON_COGNOM_USUARI>
        <NUM_COLEGIAT  xsi:type="xsd:string"></NUM_COLEGIAT>
        <DNI_USUARI  xsi:type="xsd:string">37735679K</DNI_USUARI>
      </ns1:usuari>
      <atencioPrimaria  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_AtencioPrimariaVO">
        <TIPUS_AP_COMUNICADORA  xsi:type="xsd:string">1</TIPUS_AP_COMUNICADORA>
        <CODI_AP_COMUNICADORA  xsi:type="xsd:string">M003</CODI_AP_COMUNICADORA>
        <COLEGIACIO  xsi:type="xsd:string"></COLEGIACIO>
        <CODI_PROVINCIA_COLEGIAT  xsi:type="xsd:string"></CODI_PROVINCIA_COLEGIAT>
        <NUMERO_COLEGIAT  xsi:type="xsd:string"></NUMERO_COLEGIAT>
        <DIGIT_CONTROL_COLEGIAT  xsi:type="xsd:string"></DIGIT_CONTROL_COLEGIAT>
        <NOM_COLEGIAT  xsi:type="xsd:string"></NOM_COLEGIAT>
        <PRIMER_COGNOM_COLEGIAT  xsi:type="xsd:string"></PRIMER_COGNOM_COLEGIAT>
        <SEGON_COGNOM_COLEGIAT  xsi:type="xsd:string"></SEGON_COGNOM_COLEGIAT>
      </atencioPrimaria>
      <ciutada  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_PeticioCiutadaVO">
        <NIC_CIUTADA  xsi:type="xsd:string"></NIC_CIUTADA>
        <NASS_CIUTADA  xsi:type="xsd:string">080213160436</NASS_CIUTADA>
        <NIA_CIUTADA  xsi:type="xsd:string"></NIA_CIUTADA>
        <CIP_CIUTADA  xsi:type="xsd:string"></CIP_CIUTADA>
        <DOCUMENT_ID_CIUTADA  xsi:type="xsd:string">37453036M</DOCUMENT_ID_CIUTADA>
        <TIPUS_DOCUMENT_CIUTADA  xsi:type="xsd:string">1</TIPUS_DOCUMENT_CIUTADA>
        <NOM_CIUTADA  xsi:type="xsd:string">JORGE</NOM_CIUTADA>
        <PRIMER_COGNOM_CIUTADA  xsi:type="xsd:string">ADRO</PRIMER_COGNOM_CIUTADA>
        <SEGON_COGNOM_CIUTADA  xsi:type="xsd:string">MO</SEGON_COGNOM_CIUTADA>
        <GENERE  xsi:type="xsd:string">H</GENERE>
        <DATA_NAIXEMENT  xsi:type="xsd:string">11/01/1952</DATA_NAIXEMENT>
      </ciutada>
      <episodi  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_EpisodiIndicadorAnulacioVO">
        <IND_ANULATS  xsi:type="xsd:string"></IND_ANULATS>
      </episodi>
      <resultat  xsi:type="ns1:es_tsystems_icam_iit_comunicacioIndirecta_comuns_vo_ResultatVO">
        <CODI_ERROR  xsi:type="xsd:string"></CODI_ERROR>
        <DESCRIPCIO_ERROR  xsi:type="xsd:string"></DESCRIPCIO_ERROR>
      </resultat>
    </ns1:ConsultaSituacioIT>
      v_response := UTL_DBWS.INVOKE(v_call, XMLTYPE(v_request));
      RETURN null;
    END K_TEST;Any expert in WSDL that knows how to define the XML for the request to deserialize?
    Thanks for any suggestions,
    K.

  • XML Character Encoding Using UTL_DBWS

    Hi,
    I have a database with WINDOWS-1252 character encoding. I'm using UTL_DBWS to call a web service method which echoes a given string. For this purpose, I do the following:
    DECLARE
        v_wsdl CONSTANT VARCHAR2(500) := 'http://myhost/myservice?wsdl';
        v_namespace CONSTANT VARCHAR2(500) := 'my.namespace';
        v_service_name CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'MyService');
        v_service_port CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'MySoapServicePort');
        v_ping CONSTANT UTL_DBWS.QNAME := UTL_DBWS.to_qname(v_namespace, 'ping');
        v_wsdl_uri CONSTANT URITYPE := URIFACTORY.getURI(v_wsdl);
        v_str_request CONSTANT VARCHAR2(4000) :=
    '<?xml version="1.0" encoding="UTF-8" ?>
    <ping>
        <pingRequest>
            <echoData>Dev Team üöäß</echoData>
        </pingRequest>
    </ping>';
        v_service UTL_DBWS.SERVICE;
        v_call UTL_DBWS.CALL;
        v_request XMLTYPE := XMLTYPE (v_str_request);
        v_response SYS.XMLTYPE;
    BEGIN
        DBMS_JAVA.set_output(20000);
        UTL_DBWS.set_logger_level('FINE');
        v_service := UTL_DBWS.create_service(v_wsdl_uri, v_service_name);
        v_call := UTL_DBWS.create_call(v_service, v_service_port, v_ping);
        UTL_DBWS.set_property(v_call, 'oracle.webservices.charsetEncoding', 'UTF-8');
        v_response := UTL_DBWS.invoke(v_call, v_request);
        DBMS_OUTPUT.put_line(v_response.getStringVal());
        UTL_DBWS.release_call(v_call);
        UTL_DBWS.release_all_services;
    END;
    /Here is the SERVER OUTPUT:
    ServiceFacotory: oracle.j2ee.ws.client.ServiceFactoryImpl@a9deba8d
    WSDL: http://myhost/myservice?wsdl
    Service: oracle.j2ee.ws.client.dii.ConfiguredService@c881d39e
    *** Created service: -2121202561 - oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@afb58220 ***
    ServiceProxy.get(-2121202561) = oracle.jpub.runtime.dbws.DbwsProxy$ServiceProxy@afb58220
    Collection Call info: port={my.namespace}MySoapServicePort, operation={my.namespace}ping, returnType={my.namespace}PingResponse, params count=1
    setProperty(oracle.webservices.charsetEncoding, UTF-8)
    dbwsproxy.add.map: ns, my.namespace
    Attribute 0: my.namespace: xmlns:ns, my.namespace
    dbwsproxy.lookup.map: ns, my.namespace
    createElement(ns:ping,null,my.namespace)
    dbwsproxy.add.soap.element.namespace: ns, my.namespace
    Attribute 0: my.namespace: xmlns:ns, my.namespace
    dbwsproxy.element.node.child.3: 1, null
    createElement(echoData,null,null)
    dbwsproxy.text.node.child.0: 3, Dev Team üöäß
    request:
    <ns:ping xmlns:ns="my.namespace">
       <pingRequest>
          <echoData>Dev Team üöäß</echoData>
       </pingRequest>
    </ns:ping>
    Jul 8, 2008 6:58:49 PM oracle.j2ee.ws.client.StreamingSender _sendImpl
    FINE: StreamingSender.response:<?xml version = '1.0' encoding = 'UTF-8'?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><ns0:pingResponse xmlns:ns0="my.namespace"><pingResponse><responseTimeMillis>0</responseTimeMillis><resultCode>0</resultCode><echoData>Dev Team üöäß</echoData></pingResponse></ns0:pingResponse></env:Body></env:Envelope>
    response:
    <ns0:pingResponse xmlns:ns0="my.namespace">
       <pingResponse>
          <responseTimeMillis>0</responseTimeMillis>
          <resultCode>0</resultCode>
          <echoData>Dev Team üöäß</echoData>
       </pingResponse>
    </ns0:pingResponse>As you can see the character encoding is broken in the request and in the response, i.e. the SOAP encoder does not take into consideration the UTF-8 encoding.
    I tracked down the problem to the method oracle.jpub.runtime.dbws.DbwsProxy.dom2SOAP(org.w3c.dom.Node, java.util.Hashtable); and more specifically to the calls of oracle.j2ee.ws.saaj.soap.soap11.SOAPFactory11.
    My question is: is there a way to make the SOAP encoder use the correct character encoding?
    Thanks a lot in advance!
    Greetings,
    Dimitar

    I found a workaround of the problem:
        v_response := XMLType(v_response.getBlobVal(NLS_CHARSET_ID('CHAR_CS')), NLS_CHARSET_ID('AL32UTF8'));Ugly, but I'm tired of decompiling and debugging Java classes ;)
    Greetings,
    Dimitar

  • Problem with authentication using UTL_DBWS

    Hi,
    I'm trying to call out to a web service from a PL/SQL procedure using UTL_DBWS. I am getting the following error when executing the procedure:
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: ARERR [149] A user name must be supplied in the control record
    This is despite the fact that I have set the USERNAME property using utl_dbws.set_property. I am 99% sure that the problem is within my Oracle call, becuase I have used a web services utility (SoapSonar) to successfully call the web service, and I have also been able to recreate the error message using the same utility by removing the username information from the xml message header. I have also been able to successfully call the web service if I allow anonymous use of the web service (unfortuantely I need to use the security/authentication for this project).
    I have used utl_dbws.get_property to verify that the USERNAME property is being set correctly, but it still seems that the username is not being included in the header when I call the web service with UTL_DBWS.invoke.
    Does anyone have any suggestions?
    Thanks,
    Jason

    Hi,
    I'm having the same issue using UTL_DBWS. Calls to services that don't require authentication seem to work well using this package but I can't get the basic authentication calls working. When I examine the HTTP header it missing the "Authorization: Basic <base64-encoded-string>" line that I'd expect to see.
    I'm using the utl_dbws.set_property procedure to set the USERNAME and PASSWORD properties.
    Anyone have any ideas how to overcome this problem?
    Cheers,
    Anand.

  • Unrecognized operation - using utl_dbws

    -29532 ORA-29532: Java call terminated by uncaught Java exception:
    javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request:
    unrecognized operation: {http://hristdb/MyWebService1.wsdl}rminfo
    Any idea?
    CREATE OR REPLACE PROCEDURE getRM AS
    V_TARGET_NAMESPACE VARCHAR2(100);
    V_ENDPOINT_URL VARCHAR2(1024);
    V_wsdl_URL VARCHAR2(1024);
    V_STRING_TYPE_QNAME sys.utl_DBWS.QNAME;
    V_number_TYPE_QNAME sys.utl_DBWS.QNAME;
    V_SERVICE_NAME VARCHAR2(400);
    V_PORT_NAME VARCHAR2(400);
    V_OPERATION_NAME VARCHAR2(400);
    V_SERVICE_QNAME sys.utl_DBWS.QNAME;
    V_PORT_QNAME sys.utl_DBWS.QNAME;
    V_OPERATION_QNAME sys.utl_DBWS.QNAME;
    V_SERVICE sys.utl_DBWS.SERVICE;
    V_CALL sys.utl_DBWS.CALL;
    V_PARAMS sys.utl_DBWS.ANYDATA_LIST;
    v_outputs sys.utl_dbws.ANYDATA_LIST;
    V_RETURN ANYDATA;
    BEGIN
    -- Set the Target NameSpace
    V_TARGET_NAMESPACE := 'http://hristdb/MyWebService1.wsdl';
    -- Set the End Point URL
    V_ENDPOINT_URL := 'http://hrist:8888/DatasetWS-rm-context-root/MyWebService1SoapHttpPort';
    v_wsdl_url := 'http://hrist:8888/DatasetWS-rm-context-root/MyWebService1SoapHttpPort?WSDL';
    -- Set the Service
    V_SERVICE_NAME := 'MyWebService1';
    -- Set the Port
    V_PORT_NAME := 'MyWebService1SoapHttpPort';
    -- Set the Operation
    V_OPERATION_NAME := 'rminfo';
    -- Convert the Service, Port and Operation to Qualified Names
    V_SERVICE_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_SERVICE_NAME);
    V_PORT_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_PORT_NAME);
    V_OPERATION_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_OPERATION_NAME);
    -- Create a Service. The Service created here will be used to create a call
    -- to the Web Service.
    V_SERVICE := sys.utl_DBWS.CREATE_SERVICE(URIFACTORY.getURI(v_wsdl_url), V_SERVICE_QNAME);
    -- Create a Call to the Web Service. The call created here will be used to
    -- invoke the Web Services, using the End Point URL.
    V_CALL := sys.utl_DBWS.CREATE_CALL
    ( V_SERVICE,
    V_PORT_QNAME,
    V_OPERATION_QNAME);
    -- Set the SOAP Action Properties to use.
    sys.utl_dbws.set_property(V_CALL,'SOAPACTION_USE', 'TRUE');
    sys.utl_dbws.set_property(V_CALL,'SOAPACTION_URI', 'rminfo');
    sys.utl_dbws.set_property(V_CALL,'OPERATION_STYLE', 'rpc');
    -- set type of input and output parameters
    V_STRING_TYPE_QNAME := sys.utl_DBWS.TO_QNAME ('http://www.w3.org/2001/XMLSchema', 'string');
    -- Provide values for the Input Parameters
    v_params(0) := anydata.convertnumber(23);
    -- Set the Return Type
    sys.utl_dbws.set_return_type (v_call, v_string_type_qname);
    -- Set the Target End Point. The Target End Point is used to invoke the
    -- Web Service.
    sys.utl_DBWS.SET_TARGET_ENDPOINT_ADDRESS(V_CALL,V_ENDPOINT_URL);
    -- Invoke the Web Service
    v_return := sys.utl_dbws.invoke (v_call, v_params);
    -- v_outputs := sys.utl_dbws.get_output_values (v_call);
    -- Release the call to the Web Service. A Call to a Web Service is a
    -- Resource that needs to be released after the work is done.
    sys.utl_DBWS.RELEASE_CALL (V_CALL);
    -- Release the Service. A Service to a Web Service is a
    -- Resource that needs to be released after the work is done.
    sys.utl_DBWS.RELEASE_SERVICE (V_SERVICE);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(sqlcode ||' '||substr(SQLERRM, 1, 1000));
    END;
    /

    -29532 ORA-29532: Java call terminated by uncaught Java exception:
    javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request:
    unrecognized operation: {http://hristdb/MyWebService1.wsdl}rminfo
    Any idea?
    CREATE OR REPLACE PROCEDURE getRM AS
    V_TARGET_NAMESPACE VARCHAR2(100);
    V_ENDPOINT_URL VARCHAR2(1024);
    V_wsdl_URL VARCHAR2(1024);
    V_STRING_TYPE_QNAME sys.utl_DBWS.QNAME;
    V_number_TYPE_QNAME sys.utl_DBWS.QNAME;
    V_SERVICE_NAME VARCHAR2(400);
    V_PORT_NAME VARCHAR2(400);
    V_OPERATION_NAME VARCHAR2(400);
    V_SERVICE_QNAME sys.utl_DBWS.QNAME;
    V_PORT_QNAME sys.utl_DBWS.QNAME;
    V_OPERATION_QNAME sys.utl_DBWS.QNAME;
    V_SERVICE sys.utl_DBWS.SERVICE;
    V_CALL sys.utl_DBWS.CALL;
    V_PARAMS sys.utl_DBWS.ANYDATA_LIST;
    v_outputs sys.utl_dbws.ANYDATA_LIST;
    V_RETURN ANYDATA;
    BEGIN
    -- Set the Target NameSpace
    V_TARGET_NAMESPACE := 'http://hristdb/MyWebService1.wsdl';
    -- Set the End Point URL
    V_ENDPOINT_URL := 'http://hrist:8888/DatasetWS-rm-context-root/MyWebService1SoapHttpPort';
    v_wsdl_url := 'http://hrist:8888/DatasetWS-rm-context-root/MyWebService1SoapHttpPort?WSDL';
    -- Set the Service
    V_SERVICE_NAME := 'MyWebService1';
    -- Set the Port
    V_PORT_NAME := 'MyWebService1SoapHttpPort';
    -- Set the Operation
    V_OPERATION_NAME := 'rminfo';
    -- Convert the Service, Port and Operation to Qualified Names
    V_SERVICE_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_SERVICE_NAME);
    V_PORT_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_PORT_NAME);
    V_OPERATION_QNAME := sys.utl_DBWS.TO_QNAME(V_TARGET_NAMESPACE, V_OPERATION_NAME);
    -- Create a Service. The Service created here will be used to create a call
    -- to the Web Service.
    V_SERVICE := sys.utl_DBWS.CREATE_SERVICE(URIFACTORY.getURI(v_wsdl_url), V_SERVICE_QNAME);
    -- Create a Call to the Web Service. The call created here will be used to
    -- invoke the Web Services, using the End Point URL.
    V_CALL := sys.utl_DBWS.CREATE_CALL
    ( V_SERVICE,
    V_PORT_QNAME,
    V_OPERATION_QNAME);
    -- Set the SOAP Action Properties to use.
    sys.utl_dbws.set_property(V_CALL,'SOAPACTION_USE', 'TRUE');
    sys.utl_dbws.set_property(V_CALL,'SOAPACTION_URI', 'rminfo');
    sys.utl_dbws.set_property(V_CALL,'OPERATION_STYLE', 'rpc');
    -- set type of input and output parameters
    V_STRING_TYPE_QNAME := sys.utl_DBWS.TO_QNAME ('http://www.w3.org/2001/XMLSchema', 'string');
    -- Provide values for the Input Parameters
    v_params(0) := anydata.convertnumber(23);
    -- Set the Return Type
    sys.utl_dbws.set_return_type (v_call, v_string_type_qname);
    -- Set the Target End Point. The Target End Point is used to invoke the
    -- Web Service.
    sys.utl_DBWS.SET_TARGET_ENDPOINT_ADDRESS(V_CALL,V_ENDPOINT_URL);
    -- Invoke the Web Service
    v_return := sys.utl_dbws.invoke (v_call, v_params);
    -- v_outputs := sys.utl_dbws.get_output_values (v_call);
    -- Release the call to the Web Service. A Call to a Web Service is a
    -- Resource that needs to be released after the work is done.
    sys.utl_DBWS.RELEASE_CALL (V_CALL);
    -- Release the Service. A Service to a Web Service is a
    -- Resource that needs to be released after the work is done.
    sys.utl_DBWS.RELEASE_SERVICE (V_SERVICE);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(sqlcode ||' '||substr(SQLERRM, 1, 1000));
    END;
    /

  • Error while using UTL_DBWS package

    Hello
    I want to call a web service using UTL_DBWS package as explained in this link.
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    I implemented the example successfully, and I need to my own web service.
    my web service is just a java class that return a hello world and a parameter. deployed on Integrated weblogic server shipped with Jdeveloper11g.
    here is my java class
    package ws;
    import javax.jws.Oneway;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService
    public class HelloWorld {
        public HelloWorld() {
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloWorld(){
            return "Hello World";
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloName(@WebParam(name = "arg0")
            String n){
            return "Hello " + n;
    }my WSDL is
      <?xml version="1.0" encoding="UTF-8" ?>
    - <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <!--  Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="HelloWorldService">
    - <types>
    - <xsd:schema>
      <xsd:import namespace="http://ws/" schemaLocation="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?xsd=1" />
      </xsd:schema>
      </types>
    - <message name="sayHelloWorld">
      <part name="parameters" element="tns:sayHelloWorld" />
      </message>
    - <message name="sayHelloWorldResponse">
      <part name="parameters" element="tns:sayHelloWorldResponse" />
      </message>
    - <message name="sayHelloName">
      <part name="parameters" element="tns:sayHelloName" />
      </message>
    - <message name="sayHelloNameResponse">
      <part name="parameters" element="tns:sayHelloNameResponse" />
      </message>
    - <portType name="HelloWorld">
    - <operation name="sayHelloWorld">
      <input message="tns:sayHelloWorld" />
      <output message="tns:sayHelloWorldResponse" />
      </operation>
    - <operation name="sayHelloName">
      <input message="tns:sayHelloName" />
      <output message="tns:sayHelloNameResponse" />
      </operation>
      </portType>
    - <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="sayHelloWorld">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
    - <operation name="sayHelloName">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
      </binding>
    - <service name="HelloWorldService">
    - <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
      <soap:address location="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort" />
      </port>
      </service>
      </definitions>and my function is to call the web service
    CREATE OR REPLACE FUNCTION SAYHelloMYNAME (p_int_1 IN Varchar2)
      RETURN NUMBER
    AS
      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_xmltype_in        XMLTYPE;
      l_xmltype_out       XMLTYPE;
      l_return          VARCHAR2(100);
    BEGIN
      l_wsdl_url        := 'http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl';
      l_namespace       := 'http://ws/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'HelloWorldService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'HelloWorldPort');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sayHelloName');
       l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in :=  XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <sayHelloWorld xmlns="' || l_namespace || '">
          <parameters>' || p_int_1 || '</parameters>
          </sayHelloWorld>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//return/text()').getstringVal();
      RETURN l_return;
    END;
    /but when I test the function I get this error
    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 file at: "http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl", caused by: java.net.ConnectException.    : Connection refused
    ORA-06512: at "WSUSER.UTL_DBWS", line 193
    ORA-06512: at "WSUSER.UTL_DBWS", line 190
    ORA-06512: at "WSUSER.SAYHELLOMYNAME", line 24any suggestions?

    M.Jabr wrote:
    can you elaborate more on this?
    I can open http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl
    on my browser.Is your browser on that Oracle server? You are instructing Oracle server code (the UTL_DBWS package) to access that URL.
    The IP in that URL is a localhost IP address - and that means using the local IP stack only. So it expects a web server on the Oracle server platform on tcp port 7101. It cannot use that IP to access your client/development machine.
    How can I test it using UTL_HTTP?You can write a basic web browser, minus the rendering engine, using UTL_HTTP. You can also use it for web service calls - which is my preference as I deem the UTL_DBWS package to clunky and complex.
    See:
    {message:id=1925297} (sample PL/SQL web browser)
    {message:id=4205205} (sample PL/SQL web browser SOAP call)

  • How to set endpoint address using UTL_DBWS

    Hi,
    I have been struggling to invoke a web service in the Oracle 10g database using UTL_DBWS. Now I reached a point where I need to set an endpoint address using UTL_DBWS to complete the invoking process, I try to use UTL_DBWS.Set_Target_Endpoint_Address to do this, but SQL*Plus is returning an error saying Set_Target_Endpoint_Address must be declared.
    Am I calling the wrong function? If so which function should I call to set endpoint address in UTL_DBWS? I have all the necessary jar files installed and the right grants to access this package.
    any hint would be appreciated.
    Thanks.

    Did you try using 'UTL_SMTP.WRITE_DATA'?
    Like:
    DECLARE
    con UTL_SMTP.CONNECTION;
    BEGIN
    con := UTL_SMTP.OPEN_CONNECTION('alpha.beta.com');
    UTL_SMTP.HELO(con, 'gamma.com');
    UTL_SMTP.MAIL(con, '[email protected]');
    UTL_SMTP.RCPT(con, '[email protected]');
    UTL_SMTP.OPEN_DATA(con);
    UTL_SMTP.WRITE_DATA(con,'Importance: HIGH'||UTL_TCP.CRLF);
    END;I have not tested the code. I am not sure if it is going to work in your case.

  • 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?

  • UTL_DBWS support of the Secuity call to the Web Service.:

    I am invoking a webservice, by making use of the package URL_DBWS.INVOKE procedure.
    my request xml containss the security information as part of the request header.
    when i make a invoke call, i am getting the following error.:
    : Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: An error was discovered processing the <wsse:Security> header
    at "WIM210.UTL_DBWS",
    : at "WIM210.UTL_DBWS",
    : at line 68
    I am using the Oracle 11g, could any body tell me why is this error coming.

    The exeption we are getting is BEA-380000
    General runtime error: [Security:090477]Certificate chain received from XXX - 123.123.123.123 --> test.salesforce.com was not trusted causing SSL handshake failure.
    This is of course not relevant if the callout were using CONNECT. In the CONNECT scenario, OSB would not care about XXX's certificate.

  • 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

  • Return NULL when invoke Web Service via UTL_DBWS

    Hi all,
    right now, i'm using UTL_DBWS to acces Web Service via database.. but when i'm trying to get data from WEB SERVICE, using utl_dbws.invoke , i got NULL value.
    It happened if The result more than Varchar2 / 32767 byte.
    i'have tried to change code by :
    result := sys.utl_dbws.invoke(l_call, l_input_params);
    P_clob := sys.anydata.accessCLOB(result);
    The Output IS NULL value even if the data was less than Varchar2 or 32767 byte..
    this is my script looks like ::
    declare
    service sys.utl_dbws.SERVICE;
    l_call sys.utl_dbws.CALL;
    result ANYDATA;
    wsdl_url VARCHAR2(1024);
    service_name VARCHAR2(200);
    operation_name VARCHAR2(200);
    input_params sys.utl_dbws.ANYDATA_LIST;
    p_out VARCHAR2(32767);
    p_xml XMLTYPE;
    p_clob CLOB;
    begin
    wsdl_url := 'http://127.0.0.1/Exercise/WSDL2.php?wsdl';
    service_name :='{urn:hellowsdl}hellwsdl';
    operation_name := 'getData';
    service := sys.UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(wsdl_url),
    service_name => service_name);
    l_call := sys.utl_dbws.create_call(
    service_handle => service,
    port_name => null,
    operation_name => operation_name
    input_params(1) := ANYDATA.ConvertVarchar2('DOCCODE');
    result := sys.utl_dbws.invoke(l_call, l_input_params);
    p_out := sys.anydata.accessVarchar2(result);
    sys.UTL_DBWS.release_call (call_handle => l_call);
    sys.UTL_DBWS.release_service (service_handle => service);
    end;
    Thanx for Any Help

    The basics are simple:
    - format a valid SOAP envelope
    - use UTL_HTTP to make the call
    - process the response (typically XML output)
    Sample source code in {message:id=4205205}.

Maybe you are looking for