4 Replies Latest reply: Mar 2, 2012 11:51 AM by user10945315 RSS

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

    user10945315
      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
        • 1. Re: error while calling .svc web service from pl/sql using utl_dbws
          damorgan
          I see nothing in what you posted that would allow anyone to help you.

          1. What version?
          SELECT * FROM v$version;
          2. What error message ... we need the full and complete error stack not your interpretation of it.
          3. "I am calling means what?" We need the full and complete statement showing the values of all parameters.

          Perhaps more but this would be a good starting point.
          • 2. Re: error while calling .svc web service from pl/sql using utl_dbws
            user10945315
            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;
            /
            • 3. Re: error while calling .svc web service from pl/sql using utl_dbws
              Billy~Verreynne
              I have never used UTL_DBWS - the API is clunky and I detest dealing with cryptic Java exceptions when the source code written is not Java.

              Instead I use plain vanilla PL/SQL and the UTL_HTTP interface for interacting with web services. An example listed in {message:id=4205205}. The code can also easily be modularised (creating a generic PL/SQL proc that accepts a SOAP envelope and URL and returns a XMLTYPE).

              The native PL/SQL option is one that you may want to keep in mind when dealing with web services from PL/SQL.
              • 4. Re: error while calling .svc web service from pl/sql using utl_dbws
                user10945315
                Hi Billy,

                Thanks for the response, how can I build a soap envelope for my web service, can you point me to any documents/steps ?

                Thanks
                Rk

                Edited by: user10945315 on Mar 2, 2012 11:50 AM