2 Replies Latest reply: Mar 1, 2012 9:49 AM by Kubilay RSS

    apex_web_service.make_request fails

    bjarkekr
      Hi,

      Im trying some of the examples here:
      http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_web_service.htm#BABGEIAH

      But I cant get it to work..

      It fails on this part:
      apex_web_service.make_request

      Here is the code:
      -----
      declare
      l_envelope CLOB;
      l_xml XMLTYPE;
      BEGIN
      l_envelope := ' <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:tns="http://www.ignyte.com/whatsshowing"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <tns:GetTheatersAndMovies>
      <tns:zipCode>43221</tns:zipCode>
      <tns:radius>5</tns:radius>
      </tns:GetTheatersAndMovies>
      </soap:Body>
      </soap:Envelope>';

      l_xml := apex_web_service.make_request(
      p_url => ' http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx',
      p_action => ' http://www.ignyte.com/whatsshowing/GetTheatersAndMovies',
      p_envelope => l_envelope
      );
      END;
      -----


      you can see the error here:
      http://test.kolonist.dk/sql_error.jpg


      I then thought maybe the ignyte webservice wasnt available, so I tried another which I found here: http://www.service-repository.com/service/overview/2020380455

      -----
      l_envelope := '<?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <GetHalloweenDay xmlns="http://www.27seconds.com/Holidays/US/Dates/">
      <year>2010</year>
      </GetHalloweenDay>
      </soap:Body>
      </soap:Envelope>';

      l_xml := apex_web_service.make_request(
      p_url => 'http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx',
      p_action => 'http://www.27seconds.com/Holidays/US/Dates/GetHalloweenDay',
      p_envelope => l_envelope
      );
      -----

      Same result..


      I also tried with p_action beeing: GetTheatersAndMovies

      And all kinds of different ways to write the url.

      Edited by: bjarkekr on 2010-10-27 08:45

      Edited by: bjarkekr on 2010-10-27 14:41
        • 1. Re: apex_web_service.make_request fails
          martinbn
          Bjarke,

          Your first envelope contains a space character in front of the url's (this is a bug in the example shown in the APEX Documentation).

          The following code is working fine for me:

          declare
          l_envelope CLOB;
          l_xml XMLTYPE;
          BEGIN
          wwv_flow_api.set_security_group_id;

          l_envelope := '<?xml version="1.0" encoding="UTF-8"?>
          <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
          xmlns:tns="http://www.ignyte.com/whatsshowing"
          xmlns:xs="http://www.w3.org/2001/XMLSchema">
          <soap:Body>
          <tns:GetTheatersAndMovies>
          <tns:zipCode>43221</tns:zipCode>
          <tns:radius>5</tns:radius>
          </tns:GetTheatersAndMovies>
          </soap:Body>
          </soap:Envelope>';

          l_xml := apex_web_service.make_request(
          p_url => 'http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx',
          p_action => 'http://www.ignyte.com/whatsshowing/GetTheatersAndMovies',
          p_envelope => l_envelope
          );

          dbms_output.put_line(substr(l_xml.getClobVal(),1,255));
          END;

          Brgds
          Martin

          Edited by: martinbn on Oct 30, 2010 12:20 AM
          • 2. Re: apex_web_service.make_request fails
            Kubilay
            I have started receiving the error ORA-06503: PL/SQL: Function returned without value on this code when I run in it from SQL in Oracle Apex. Does anybody know why? Thanks!

            Best Regards

            Kubilay Tsil Kara
            @databasesystems