2 Replies Latest reply: Jun 18, 2012 6:14 PM by user1099620 RSS

    webservice query

    user1099620
      The select on webservice
      http://www.webservicex.net/globalweather.asmx?op=GetWeather

      SELECT x2.*
      FROM XMLTable(
      XMLNamespaces(
      'http://schemas.xmlsoap.org/soap/envelope/' AS "soap"
      , default 'http://www.webserviceX.NET'
      )
      , 'soap:Envelope/soap:Body/GetWeatherResponse/GetWeatherResult'
      PASSING XML_WS_RESPONSE
      columns string xmltype path '.'
      ) x1
      , XMLTABLE(
      '/string/CurrentWeather'
      PASSING X1.string
      COLUMNS LOCATION VARCHAR2(120) PATH 'Location'
      , TEMPERATURE VARCHAR2(40) PATH 'Temperature'
      ) x2
      ;

      results with
      ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name: (string)

      Help for proper select statement.
        • 1. Re: webservice query
          AlexAnd
          see odie_63's example - Re: Error ORA-29532 service does not contain port

          also respons looks like a bad
          see
          <?xml version="1.0" encoding="utf-16"?>
          in responce body.

          if you remove this row and add namespace for second xmltable
          SELECT x2.*
            FROM XMLTable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS  "soap",
                                        default 'http://www.webserviceX.NET'),
                          'soap:Envelope/soap:Body/GetWeatherResponse/GetWeatherResult'
                          PASSING XML_WS_RESPONSE  columns string xmltype path '.') x1,
                 XMLTABLE(XMLNamespaces(default 'http://www.webserviceX.NET'),
                          'GetWeatherResult/CurrentWeather' PASSING X1.string COLUMNS
                          LOCATION VARCHAR2(120) PATH 'Location',
                          TEMPERATURE VARCHAR2(40) PATH 'Temperature') x2
          it's work for me, 10.2 and 11.2.
          • 2. Re: webservice query
            user1099620
            What is the technique to to remove the bad tag (row) ?