Call A WS From PL/SQL

Does anyone manged to call an asynch' WS from PL/SQL?
I'm trying to call a bpel process and I get an error in the response, after the service was executed.
thanks
Riko

I'm trying to call a bpel process and I get an error in the responseThere is BPEL. That might be a better place to ask this question. If you do go there be sure to tell them what error message/number you get.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/

Similar Messages

  • Calling a report from pl/sql

    Is it possible to call a report from pl/sql. I want to create a package which when invoked by dbms_jobs will create parameters and then call a report.
    Thanks in advance,
    Mark.

    Mark,
    cf: http://download-uk.oracle.com/docs/cd/B10464_05/bi.904/b13673/pbr_evnt.htm#sthref1477
    Patrick.

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Can I call a report from pl/sql?

    How can I call a report from pl/sql? I would like the output to be pdf and have it outputted to the screen?
    We are running Oracle 10g database and 10.1.2.3 application server on LInux Redhat 4.
    Thanks.
    Shirley
    Edited by: jonesfnalgov on Jul 12, 2011 2:17 PM
    Edited by: jonesfnalgov on Jul 12, 2011 2:18 PM

    Hello,
    a package is provided : srwAPIins.sql installs the Event-Driven Publishing API.
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_evnt.htm
    The Event-Driven Publishing API is a PL/SQL package that provides the basic functions required for the development of procedures that respond to events in the database. Event-driven jobs are submitted using the HTTP protocol. The server assigns a unique job_ident record to every call, useful for tracking the status of the job.
    Regards

  • How to call web services from PL/SQL?

    Hi,
    Can one help in how to call web services from PL/SQL? Steps, pros and cons, etc....
    Thanks in advance

    Here's some example skeleton code to get you started...
      PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
        soap_request  VARCHAR2(30000);
        soap_respond  CLOB;
        http_req      utl_http.req;
        http_resp     utl_http.resp;
        resp          XMLType;
        soap_err      exception;
        v_code        VARCHAR2(200);
        v_msg         VARCHAR2(1800);
        v_len number;
        v_txt Varchar2(32767);
      BEGIN
        UTL_HTTP.SET_PROXY(p_proxy);
        -- Define the SOAP request according the the definition of the web service being called
        soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
                       '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
                       '  <SOAP-ENV:Body>'||
                       '    <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
                       '      <m:UserName>'||p_username||'</m:UserName>'||
                       '      <m:Password>'||p_password||'</m:Password>'||
                       '    </m:DownloadRequest>'||
                       '  </SOAP-ENV:Body>'||
                       '</SOAP-ENV:Envelope>';
        http_req:= utl_http.begin_request
                  ( 'http://www.website.net/webservices/GetDetailsService.asmx'
                  , 'POST'
                  , 'HTTP/1.1'
        utl_http.set_header(http_req, 'Content-Type', 'text/xml');
        utl_http.set_header(http_req, 'Content-Length', length(soap_request));
        utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
        utl_http.write_text(http_req, soap_request);
        http_resp:= utl_http.get_response(http_req);
        utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
        FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
        LOOP
            utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
            soap_respond := soap_respond || v_txt; -- build up CLOB
        END LOOP;
        utl_http.end_response(http_resp);
        resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
      END;Using secure web services (https)...
    Web serivces call in Plsql
    As for 'pros and cons'... there's nothing to compare against... either you want to call a web service or you don't.

  • Call Oracle form from pl/sql

    Dear All
    How can I call Oracle form from pl/sql and open this form to end user
    many thanks

    Hshihadah wrote:
    how can I show this form to specific client ?What client?!? Database PL/SQL is executed within a process on the database server, it's not something which is executed on the client. Could you please elaborate a little bit more?
    By now I have not the faintest clue if you want to
    - call a form from another form ( call_form )
    - call a form within a database process (?!?)
    - call your form from a client you did not tell us (probably APEX?!?)
    For the case you really meant to call a form within Database PL/SQL: Just in case you didn't recognize it, but the database is perfectly capable of PL/SQL and as calling a form within a database process is a one-way street as you cannot interact with it there is no point at all in writing the things you want to do in forms. If you want some PL/SQL code executed on the database then...well...put it in a stored procedure in the database!
    cheers

  • Call C++ programs from PL/SQL

    Can someone give me an example of how to call C++ programs from PL/SQL ASAP please?
    Thanks
    Chitra

    Hello,
    You can use External Procedure facility of of PL/SQL (Assuming your DB is 8 or 8i)
    Please refer the doc at http://oradoc.photo.net/ora8doc/DOC/server803/A54654_01/10_procs.htm
    James

  • Calling OA page from PL/SQL or HTML

    Is there any mechanism to call OA page from PL/SQL or HTML ?
    The reason for asking is , in iReceivables page there is section called Content Layout and which is handled by PL/SQL package. I want to call OA page from this section.
    in 1158 it was working fine but in 12i it is not working.
    Thanks,

    Hi Srini,
    Thanks for your reply...
    Basically I written the following code in ARI_CONFIG package to call a OA page ... this code was working in 1158 where as in 12i it is not working.
    Just want to know whether the following mechanism is supported in 12i or not ...
    Begin
    v_bill_to_customer_id := 0;
    Select distinct bill_to_customer_id into v_bill_to_customer_id from ra_customer_trx_all where printing_pending = 'Y' and bill_to_customer_id = p_customer_id;
         IF v_bill_to_customer_id > 0 then
    p_output_string := p_output_string||'</ul></td>
    </tr>
    <tr>
    <td height="8" class="OraBGAccentDark"></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td><ul>
                                       <li class="OraLine">';
                                       p_output_string := p_output_string || '<font color=blue>Click For Test Newest Invoices<input type=button value=Go OnClick=window.location.href="/OA_HTML/OA.jsp?akRegionCode=ARIACCTDETAILSPAGE&akRegionApplicationId=222&Iracctdtlgocontrol_ext=&Ircustomerid='||p_encrypted_customer_id||'&Iracctdtlstype_ext=PENDING&Iraccountstatus_ext="></font></li>';
    End If;
    Exception
    When Others then
         null;
         End;
    Edited by: user575383 on Jul 22, 2009 12:08 PM

  • Calling Cobol program from PL/SQL

    What is the caling convention for PL/SQL to call a Cobol program?

    You cannot do it directly from PL/SQL. PL/SQL is.. well, kind of abstract ito the actual platform it runs on. PL/SQL cannot talk directly to operating system. It cannot (itself) do socket calls, file I/O calls, use the printer, etc.
    <p>
    All this has to be done using a lower level implementation library - like UTL_FILE for example that wraps internal C written modules that does file I/O. PL/SQL can call these to do I/O on its behalf. Ditto for wrappers like UTL_TCP and others.
    <p>
    There is no default wrapper for calling external processes from PL/SQL. It can however be done indirectly using the external procedure (EXTPROC) feature, or using Java to do it.
    <p>
    The latter is the easiest. You create a Java stored proc that can access the operating system and run external programs and commands. You punch a big hole in the Oracle Java security to allow this Java stored proc access to the operating system. Next you create a PL/SQL wrapper for this Java proc which then in turn can be called from PL/SQL.
    Just remember that you MUST secure this hole you've punched into Oracle security. If any Oracle user can access this PL/SQL wrapper, they can hack, compromise, trash or simply destroy your entire Oracle account on that server.
    Here is the basic code:
    create or replace and compile Java Source named "OSCommand" as
    -- java:        OS COMMAND
    -- descr:       Executes an Operating System Command using the JAVA RTS
    -- IN parameter:        os command to execute (including fully qualified path names)
    -- OUT parameter:       returncode [\nstring]
    --                      where string a max of 32000 chars of the output of the command
    --                      (note that \n is used as separators in the string)
    --                      returncode=-1   Java RTS error occurred (e.g. command does not exist)
    --                      returncode=255  o/s command failed (e.g. invalid command params)
    import java.io.*;
    import java.lang.*;
    public class OSCommand{
            public static String Run(String Command){
                    Runtime rt = Runtime.getRuntime();
                    int     rc = -1;
                    try{
                            Process p = rt.exec( Command );
                            int bufSize = 32000;
                            int len = 0;
                            byte buffer[] = new byte[bufSize];
                            String s = null;
                            BufferedInputStream bis = new BufferedInputStream( p.getInputStream(), bufSize );
                            len = bis.read( buffer, 0, bufSize );
                            rc = p.waitFor();
                            if ( len != -1 ){
                                    s = new String( buffer, 0, len );
                                    return( s );
                            return( rc+"" );
                    catch (Exception e){
                            e.printStackTrace();
                            return(  "-1\ncommand[" + Command + "]\n" + e.getMessage() );
    show errors
    create or replace function OSexec( cCommand IN string ) return varchar2 is
    -- function:    OS EXEC
    -- descr:       PL/SQL wrapper for the Java OSCOMMAND stored proc
    language        JAVA
    name            'OSCommand.Run(java.lang.String) return java.lang.String';
    show errors
    -- Punching a hole into the Java VM sandbox. The following must be run as
    -- sysdba. Substitute SCOTT with the applicable schema that owns the OSEXEC
    -- and OSCOMMAND stored procs.
    declare
            SCHEMA  varchar2(30) := 'SCOTT';
    begin
            dbms_java.grant_permission(
                    SCHEMA,
                    'SYS:java.io.FilePermission',
                    '<<ALL FILES>>',
                    'execute'
            dbms_java.grant_permission(
                    SCHEMA,
                    'SYS:java.lang.RuntimePermission',
                    'writeFileDescriptor',
            dbms_java.grant_permission(
                    SCHEMA,
                    'SYS:java.lang.RuntimePermission',
                    'readFileDescriptor',
    commit;
    end;
    -- example: running the Unix/Linux date command to get the current date and time
    SQL> select OSexec('/usr/bin/date') as STDOUT from dual;
    STDOUT
    Fri Sep  1 08:09:34 SAST 2006
    1 row selected.
    SQL>Edited by: Billy Verreynne on Sep 4, 2008 6:26 PM to make the code snippet readable with the new Jive forum s/w.

  • Calling Web Service from PL/SQL in 9.2.0.4

    We're having some problems getting the "Calling Web Services Sample from PL/SQL" sample working with our 9.2.0.4 database. After downloading the sample from http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html, we try to run the sample but get the following error stack:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00243: element attribute value must be enclosed in quotes
    Error at line 20
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at "TODDH.DEMO_SOAP", line 81
    ORA-06512: at "TODDH.TIME_SERVICE", line 15
    ORA-06512: at line 2
    Has anyone encountered a similar problem? Any help is much appreciated.
    Todd.

    the message looks very much like the one posted at http://asktom.oracle.com/pls/ask/f?p=4950:8:5812357525663697256::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:16568950771220
    b.t.w. i don't think that any packages are missing. it seems that the XML is invalid. Did you use dbms_output commands to show the generated XML?

  • Urgent: Calling web service from PL/SQl fails with XML parsing

    Hi,
    I am trying to call a web service from PL/SQL (using SOAP protocol and UTL_HTTP built in Package).I am using Oracle 9i .I am calling from pl/sql block invoking web service method created in java.
    I am getting the below response object as a SOAP protocol, but i couldn't able to parse the SOAP.
    Could you please provide the values of FirstName, LastName and ErrorDescription
    declare
    request_env varchar2(32767);
    v_xml XMLTYPE;
    l_user_first_name varchar2(100);
    l_user_last_name varchar2(100);
    l_error_value varchar2(100);
    begin
    response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
    <axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
    <axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
    <axis2ns1:ErrorDescription />
    </UserInfoObjResponse>
    </soapenv:Body>
    </soapenv:Envelope>';
    dbms_output.put_line('Length of Request:' || length(response_env));
    dbms_output.put_line ('Request: ' || response_env);
    v_xml := XMLTYPE(response_env);
    -- SELECT EXTRACTVALUE(v_xml, '//UserInfoObjResponse/FirstName') INTO l_user_fast_name varchar2(100); FROM DUAL;
    dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
    dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
    dbms_output.put_line ('l_error_value: ' || l_error_value);
    end;

    In Oracle 9i:
    SQL> declare
      2    response_env varchar2(32767);
      3    v_xml XMLTYPE;
      4    l_user_first_name varchar2(100);
      5    l_user_last_name varchar2(100);
      6    l_error_value varchar2(100);
      7  begin
      8    response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      9                     <soapenv:Body>
    10                       <UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
    11                         <axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
    12                         <axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
    13                         <axis2ns1:ErrorDescription />
    14                       </UserInfoObjResponse>
    15                     </soapenv:Body>
    16                   </soapenv:Envelope>';
    17
    18    dbms_output.put_line('Length of Request:' || length(response_env));
    19  --  dbms_output.put_line ('Request: ' || response_env);
    20
    21    v_xml := XMLTYPE(response_env);
    22
    23    select EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:FirstName/text()') first_name,
    24           EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:LastName/text()') last_name,
    25           EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:ErrorDescription/text()') error_description
    26      into l_user_first_name, l_user_last_name, l_error_value
    27      from dual;
    28
    29    dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
    30    dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
    31    dbms_output.put_line ('l_error_value: ' || l_error_value);
    32  end;
    33  /
    Length of Request:530
    l_user_first_name: First Name Output
    l_user_last_name : Last Name Output
    l_error_value:
    PL/SQL procedure successfully completed.In Oracle 10g:
    SQL> declare
      2    response_env varchar2(32767);
      3    v_xml XMLTYPE;
      4    l_user_first_name varchar2(100);
      5    l_user_last_name varchar2(100);
      6    l_error_value varchar2(100);
      7  begin
      8    response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      9                     <soapenv:Body>
    10                       <UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
    11                         <axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
    12                         <axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
    13                         <axis2ns1:ErrorDescription />
    14                       </UserInfoObjResponse>
    15                     </soapenv:Body>
    16                   </soapenv:Envelope>';
    17
    18    dbms_output.put_line('Length of Request:' || length(response_env));
    19  --  dbms_output.put_line ('Request: ' || response_env);
    20
    21    v_xml := XMLTYPE(response_env);
    22
    23    select r.*
    24      into l_user_first_name, l_user_last_name, l_error_value
    25    from XMLTABLE('/' PASSING v_xml
    26                  COLUMNS
    27                  first_name varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:FirstName/text()',
    28                  last_name varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:LastName/text()',
    29                  error_description varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:ErrorDescrition/text()'
    30                  ) r;
    31
    32    dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
    33    dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
    34    dbms_output.put_line ('l_error_value: ' || l_error_value);
    35  end;
    36  /
    Length of Request:530
    l_user_first_name: First Name Output
    l_user_last_name : Last Name Output
    l_error_value:
    PL/SQL procedure successfully completed.Max
    http://oracleitalia.wordpress.com
    Edited by: Massimo Ruocchio on Feb 14, 2010 11:55 PM
    Added the first one.

  • Calling web services from PL/SQL

    Hi,
    We have a requirement where we need to call a web services from PL/SQL.
    I believe we have a PL/SQL API that allows you to consume external web services.
    I was looking for other possible options too to consume web Service from PL/SQL.
    Can any one suggest the other possible options , and which option is best to consume web service.
    Thanks
    AB

    AB,
    I didn't realize you cannot attach documents to your post. You will have to provide me with an email address that I can send the documents to. They are a little rough (ie not commented etc) but they do illustrate the point. The basic idea is to build up the payload of the soap envelope using pl/sql. Meaning as I loop through the cursor I use each record in the cursor to build an xml string. This string of xml becomes the payload of the soap message. This could also be done using xml functionality provided by the db meaning xmlelement, xmlforest etc. The issue I ran into was the size of the message. That is why I elected to build the xml message by string concatenation as I moved through the cursor.
    Ryan

  • Errors in calling web-service from pl/sql

    Hello All,
    Morning , we are getting the errors mentioned here (ORA-29261 bad argument , ORA-06512 at SYS.UTL_HTTP) while calling the composite (having a bpel process) deployed on 11g WLS server.
    From PL/SQL side we are calling this by forming the soap request & calling like this : utl_http.begin_request('end point location of composite', 'POST', 'HTTP/1.1')
    getting the response via : utl_http.get_response & finally ending the response : utl_http.end_response.
    But we keep this error message for SYS.UTL_HTTP with bad argument and also at times it works fine as well without any errors ...but many times we get this error message.
    Could someone please help as to how we could troubleshoot this issue/error ??
    means how do we debug or trace the session for the composite instance on the 11g WLS server side ..how do we get the logging enabled on 11g side & whether this could be done from EM console for this deployed composite having issue.. Could someone please provide us the steps for this or any reference document.
    We are not getting as to why sometimes this error shows up..could someone please help with inputs..this issue is a bit critical for us..
    regards

    Hi Vlad,
    Firstly thanks for your reply back ...tried this but it seems currently we don't have this utility installed from a database perspective.
    --Is there any other way to debug the issue/exceptions coming with the use of utl_http ...this is really critical for us..
    --Also is there any way to debug or trace from the 11g WLS server for this particular composite..
    The other issue is that this error doesn't come always, but it does occur many a times..
    Regards

  • Calling stored procedure from embedded sql

    I'm trying to call a stored procedure from embedded sql. I'm following the examples located in
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/a96109/pco06pls.htm#i9641
    I have the following section in my .pco file before precompiling.
    exec sql execute
    begin
    docs.grant_access_to_all_categories(:p_sam_id);
    end;
    end-exec.
    When running procob on the file with the above code I get the following error.
    Error at line 225, column 13 in file pco\docs_stored_procedures.pco
    exec sql execute
    ............1
    PCB-S-00576, PLS-201: identifier 'DOCS.GRANT_ACCESS_TO_ALL_CATEGORIES' must be d
    eclared
    Error at line 225, column 13 in file pco\docs_stored_procedures.pco
    exec sql execute
    ............1
    PCB-S-00576, PLS-0: Statement ignored
    Any ideas on what I am doing wrong on calling this stored procedure.

    I get the same error when trying to precompile sample11.pco from the demo directory in the oracle client software.
    Error at line 70, column 12 in file sample11.pco
    EXEC SQL EXECUTE
    ...........1
    PCB-S-00576, PLS-201: identifier 'EMP_DEMO_PKG.OPEN_CUR' must be declared
    Error at line 70, column 12 in file sample11.pco
    EXEC SQL EXECUTE
    ...........1
    PCB-S-00576, PLS-0: Statement ignored

  • Calling Javascript function from PL/SQL Process

    I am new to APEX and Javascript so please forgive my question.
    I have a process on page which successfully runs a few procedures etc. but now, as part of this process, I want to call a javascript function I have typed into the HTML Header.
    My question is how can I call the javascript function from my process? Is it possible?
    Many thanks
    Winnie
    ps. as an example my javascript looks like:
    <script language="JavaScript">
    function test(){
    var decision = confirm("Click a button below and watch what pops up next.");
    alert(decision);
    </script>

    See: How to call a javascript function from pl/sql?

Maybe you are looking for

  • Upgrade to Maverick

    if a bought the IOS moutain lion? Why know is free? What happen with my payment?

  • Reg..yahoo messenger

    Hello Friends, I have recently got my Macbook (White, 2.16 GHz. Core 2 Duo, 2 GB RAM, 120 GB HardDsic). This is my first mac experiance and I am still trying to explore the world of Mac. I have downloaded Yahoo Messenger, yesterday..Its working fine

  • Files from template not copy img background property

    i have a simple(single) template with two bars(vertical and horizontal, each one has a specific png backgorund image set in .twoColHybLtHdr #header and #sidebar ) and a editable region in the middle of the page, so far i've built the entire site base

  • Exporting Art object in AI 3

    I just installed CS3 and also just learning Illustrator. I can't find any information about exporting objects that fits my need. I opened a new document (8.5in X 5.5in) and created a piece of artwork to be used as a logo. It didn't fill the page. I g

  • BI analysis authorization- checking for not equal to values

    hello, the info provider (ZIC_COPA) is having auth. relevant char. are 0COMP_CODE, PLANT, 0SALESORG. When i am executing query which is built on ZIC_COPA info provider. It is checking all above charcteristics value. But in RSECADMIN i found that syst