UTL_DBWS – Consuming Web Services…

 

I was messing around with the UTL_DBWS package when Oracle 10g was first released and I must admit, I completely missed the point. The other day I came across my draft article and with some fresh eyes noticed what I was doing wrong. So here it is:

UTL_DBWS – Consuming Web Services in Oracle 10g

Cheers

Tim…

Author: Tim...

DBA, Developer, Author, Trainer.

4 thoughts on “UTL_DBWS – Consuming Web Services…”

  1. Hi,

    I am trying to consume a web service using the utl_dbws package. I am getting the following error:

    port: does not contain operation: Envelope
    at oracle.j2ee.ws.client.dii.ConfiguredCall.configureCall(ConfiguredCall.java:154)
    at oracle.j2ee.ws.client.dii.ConfiguredCall.configureCall(ConfiguredCall.java:113)
    at oracle.j2ee.ws.client.dii.ConfiguredCall.setOperationName(ConfiguredCall.java:95)
    at oracle.j2ee.ws.client.dii.BasicCall.directInvoke(BasicCall.java:686)
    at oracle.j2ee.ws.client.dii.BasicCall.invoke(BasicCall.java:598)
    at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.invokeProxy(Unknown Source)
    at oracle.jpub.runtime.dbws.DbwsProxy$CallProxy.access$2600(Unknown Source)
    at oracle.jpub.runtime.dbws.DbwsProxy.invokeProxy(Unknown Source)
    Internal error – -29532—ORA-29532: Java call terminated by uncaught Java exception: port:does not contain operation: Envelope
    ORA-06512: at “SYS.UTL_DBWS”, line 403
    ORA-06512: at “SYS.UTL_DBWS”, line 400
    ORA-06512: at “my_package_name”, line 622
    16:32:39 Execution finished, retrieved 300 lines, execution time: 2.047 seconds.
    16:32:39 End Executing anonymous block

    This is the way I am making a call:

    l_namespace :=
    ‘http://my url’;
    l_service_qname :=
    SYS.UTL_DBWS.to_qname (l_namespace, ‘myService’);
    l_port_qname :=
    SYS.UTL_DBWS.to_qname (l_namespace, ‘myServiceEndpointPort’);
    l_operation_qname := SYS.UTL_DBWS.to_qname (l_namespace, ‘check’);
    l_service :=
    SYS.UTL_DBWS.create_service
    (wsdl_document_location => urifactory.geturi
    (l_wsdl_url),
    service_name => l_service_qname
    );

    l_call :=
    SYS.UTL_DBWS.create_call (service_handle => l_service,
    port_name => l_port_qname,
    operation_name => l_operation_qname);

    SYS.UTL_DBWS.set_property (l_call, ‘SOAPACTION_USE’, ‘TRUE’);
    SYS.UTL_DBWS.set_property (l_call, ‘SOAPACTION_URI’, ”);
    SYS.utl_dbws.set_property(l_call, ‘OPERATION_STYLE’, ‘DOCUMENT’);

    sys.utl_dbws.set_property(l_call, ‘ENCODINGSTYLE_URI’, ‘http://schemas.xmlsoap.org/soap/encoding/’);

    sys.utl_dbws.to_qname(‘http://www.w3.org/2001/XMLSchema’, ‘string’);
    ws_request_xml :=
    SYS.XMLTYPE.createxml (create_xml (control_nb,
    last_name,
    first_name,
    ssn,
    dob,
    office_cd
    )
    );
    –DBMS_OUTPUT.put_line (ws_request_xml.getstringval);
    ws_response_xml := SYS.UTL_DBWS.invoke (l_call, ws_request_xml);
    DBMS_OUTPUT.put_line (‘3*****************’);
    — 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);
    DBMS_OUTPUT.put_line (ws_response_xml.getstringval);

  2. Hi sridevi,

    I am going through your post , i have some questions .. what does the below function do in your post :

    SYS.XMLTYPE.createxml (create_xml (control_nb,
    last_name,
    first_name,
    ssn,
    dob,
    office_cd
    )
    );

    Will it create xml documnet…..

  3. It’s not my code. I have no idea what it will do. 🙂

    I assume the “create_xml” function is a custom written function returns some XML, that is then passed to the “XMLTYPE.createxml” function to convert the XML document into an XMLTYPE.

    But as I said, it’s not my code so I have no idea about it.

    Cheers

    Tim…

  4. I can’t seem to call this (or any other) web service from Oracle. I get the following error message. (The first couple of lines are in Swedish, and are telling me politely that I have an error and an uncaught java exception). Does anyone know what may be causing this?

    Fel pσ rad 1:
    ORA-29532: Java-anrop avslutades av ouppfσngat Java-undantag:
    java.rmi.RemoteException: java.rmi.RemoteException: ; nested exception is:
    dynamic invocation error: javax.xml.soap.SOAPException: Error parsing envelope
    ORA-06512: vid “SYS.UTL_DBWS”, rad 404
    ORA-06512: vid “SYS.UTL_DBWS”, rad 401
    ORA-06512: vid “PRODPACK.HELLOWORLD”, rad 163

Comments are closed.