Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call SOAP web service from APEX..

TexasApexDeveloperMay 22 2016 — edited May 24 2016

Using APEX 5, with Oracle 11g rs database and MOzilla's Firefox browser, I am trying to rewrite some existing code that calls a web service to retrieve data...

Basics of what I have done so far:

Envelope definition I have right now:

       l_envelope         VARCHAR2(32000) := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="https://ws.exporter.xxxx.zzz.yyy/">

              

    <soapenv:Header/>

    <soapenv:Body>

       <ws:getObjectExportInfo>

          <!--Optional:-->

          <repositoryName>some_docs</

repositoryName>
          <!--Optional:-->
          <userId>TEST_USER</userId>
          <!--Optional:-->
          <password>TEST_PASSWORD</password>
          <!--Optional:-->
          <dqlQuery>' || v_dql || '</dqlQuery>
          <!--Optional:-->
          <delimiter>:</delimiter>
       </ws:getObjectExportInfo>
    </soapenv:Body>
</soapenv:Envelope>';

This envelope has the v_dql string replaced with a query string that is passed into the web service call from pl/sql..

The next code I have is to setup the http header and send the request to the web service server:

UTL_HTTP.set_wallet(l_Wallet);

       http_req := UTL_HTTP.begin_request (l_http_target_url, 'POST', 'HTTP/1.1');

       UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml;charset=UTF-8');

       UTL_HTTP.set_header ( http_req,

                             'SOAPAction',

                             '"http://oracle-base.com/webservices/server.php/ws_add"');
       UTL_HTTP.set_header (http_req, 'Content-Length', LENGTH (l_envelope));
       UTL_HTTP.set_header (http_req, 'User-Agent', 'Mozilla/4.0');

I am pretty clear on what I need to replace this code and the code used to get the response from the http server:

-- Get the XML response from the web service.

  l_xml := APEX_WEB_SERVICE.make_request(

  p_url => 'http://oracle-base.com/webservices/server.php',

  p_action => 'http://oracle-base.com/webservices/server.php/ws_add',

  p_envelope => l_envelope

  );

My question is I am confused to what the p_url .. In my current code the l_http_target_url is something like this:

https://test_server.test.nowhere.com/666/DownloadStuffWS/TESTDownloadStuffWS

Can anyone offer a hand here?

Thank you,

Tony Miller
LuvMuffin Software
Los Alamos, NM

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2016
Added on May 22 2016
21 comments
6,059 views