3 Replies Latest reply: Jan 25, 2013 8:39 AM by cbritez RSS

    Run an ODI Scenario from APEX

    Alex_M
      Hi,

      I need to run an ODI 11g scenario from APEX.


      Any idea?. Web Services?

      How can i execute http://localhost:20910/oraclediagent/OdiInvoke.wsil from APEX ??
      Thanks in advance.

      Edited by: Alex_M on 14-sep-2012 15:01
        • 1. Re: Run an ODI Scenario from APEX
          acojocar-Oracle
          Hi Alex,
          Did you solve this? If Yes, could you please share the solution with me.
          Thanks in advance,
          Aurelian
          • 2. Re: Run an ODI Scenario from APEX
            Jörg Lang
            Hi there,
            I have it working to start scenarios from apex

            See my post: Re: Problem on APEX 4.2 while accessing Oracle ODI Web services

            I looks like that there is a problem when the "Web Service Reference" is based on wsdl.

            So just create it manually as following:


            URL: http://localhost:20910/oraclediagent/OdiInvoke
            Action: invokeStartScen
            SOAP Version: 1.1

            SOAP Envelop:
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:odi="xmlns.oracle.com/odi/OdiInvoke/">
               <soapenv:Header/>
               <soapenv:Body>
                  <odi:OdiStartScenRequest>
                     <!--You may enter the following 2 items in any order-->
                     <Credentials>
                        <!--You may enter the following 3 items in any order-->
                        <OdiUser> put here the user (not the repository credentials)</OdiUser>
                        <OdiPassword> put here the password </OdiPassword>
                        <WorkRepository> put here the workrepository</WorkRepository>
                     </Credentials>
                     <Request>
                        <ScenarioName> put here the name </ScenarioName>
                        <ScenarioVersion> put here the version</ScenarioVersion>
                        <Context> put here the context</Context>
                        <!--Optional:-->
                        <Synchronous>false</Synchronous>
                        <!--Optional:-->
                        <LogLevel>5</LogLevel>
                     </Request>
                  </odi:OdiStartScenRequest>
               </soapenv:Body>
            </soapenv:Envelope>
            then you can execute the action on a page process
            • 3. Re: Run an ODI Scenario from APEX
              cbritez
              I used the code from Jörg Lang to invoke from a PL SQL block and works very good

              DECLARE

              req_text VARCHAR2(4000) := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:odi="xmlns.oracle.com/odi/OdiInvoke/">
              <soapenv:Header/>
              <soapenv:Body>
              <odi:OdiStartScenRequest>
              <Credentials>
              <OdiUser>SUPERVISOR</OdiUser>
              <OdiPassword>P4nt3r4$</OdiPassword>
              <WorkRepository>WORKREP</WorkRepository>
              </Credentials>
              <Request>
              <ScenarioName>LOAD_TEST</ScenarioName>
              <ScenarioVersion>001</ScenarioVersion>
              <Context>DEV</Context>
              <!--Optional:-->
              <Synchronous>false</Synchronous>
              <!--Optional:-->
              <LogLevel>5</LogLevel>
              </Request>
              </odi:OdiStartScenRequest>
              </soapenv:Body>
              </soapenv:Envelope>';

              req utl_http.req;
              res utl_http.resp;
              res_text VARCHAR2(32767);

              BEGIN

              req := utl_http.begin_request('http://localhost:20910/oraclediagent/OdiInvoke?wsdl',
              'POST',
              'HTTP/1.1');
              utl_http.set_header(req, 'Content-Type', 'text/xml');
              utl_http.set_header(req, 'Content-Length', length(req_text));
              utl_http.set_header(req, 'SOAPAction', 'invokeStartScen');

              utl_http.write_text(req, req_text);

              res := utl_http.get_response(req);
              utl_http.read_text(res, res_text);
              utl_http.end_response(res);

              dbms_output.put_line(res_text);

              END;