none
DataSource.Error: OData: The feed's metadata document appears to be invalid. Details: null

    Question

  • Just started playing with Power Query today. I've mocked some odata feeds as URLs which return static feeds.  Got error that $metadata was not found.  I mocked a $metadata url and now get

    DataSource.Error: OData: The feed's metadata document appears to be invalid. Details: null

    So two question:

    1. Any way to tell Power Query to NOT ask for metadata? All the needed metadata is in the table returned by my test feed.

    2. How to get more diagnostics on why it doesn't like the metadata feed I am providing? For my test, I fed it the Northwinds sample OData metadata but I get the above error.

    Thursday, July 11, 2013 12:09 AM

Answers

  • There is no way to not use $metadata. In fact, Power Query requires $metadata in order to provide you with the experience for easy consumption of the feed.

    At the moment, the system will simply tell you if $metadata appears to be invalid. The sample Northwind OData feed works fine - have you tried accessing that?

    -faisal

    Friday, July 12, 2013 12:12 AM

All replies

  • There is no way to not use $metadata. In fact, Power Query requires $metadata in order to provide you with the experience for easy consumption of the feed.

    At the moment, the system will simply tell you if $metadata appears to be invalid. The sample Northwind OData feed works fine - have you tried accessing that?

    -faisal

    Friday, July 12, 2013 12:12 AM
  • Hi,

    I've returned to this project.  I am still getting this error:

    DataSource.Error: OData: The feed's metadata document appears to be invalid. Details: null

    My EDMX doc is below.  How can one go about diagnosing this error? Is Power Query using one of the .NET OData libraries? Can I test loading my EDMX with the same library to get more verbose error reporting?

    Thanks

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
      <edmx:DataServices m:DataServiceVersion="1.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <Schema Namespace="GA" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2007/05/edm">
          <EntityType Name="Query1">
            <Key>
              <PropertyRef Name="Medium" />
            </Key>
            <Property Name="Medium" Type="Edm.String" Nullable="false" />
            <Property Name="Visitors" Type="Edm.Int32" />
          </EntityType>
          <EntityContainer Name="GAContainer" m:IsDefaultEntityContainer="true">
            <EntitySet Name="Query1" EntityType="GA.Query1" />
          </EntityContainer>
        </Schema>
      </edmx:DataServices>
    </edmx:Edmx>

    Wednesday, October 30, 2013 4:51 PM
  • Power Query uses ODataMessageReader.ReadMetadataDocument in ODataLib to read metadata documents. You should be able to download that from Codeplex or nuget.org.

    Wednesday, October 30, 2013 5:41 PM
  • I was successfully able to read the EDMX you posted into a metadata document. Is it possible that there's some kind of text encoding problem with the file being served? Does it look encoded correctly if you use Fiddler or some other tool to look at the network traffic?
    Wednesday, October 30, 2013 5:50 PM
  • It does look OK in Fiddler.  I am wondering if Power Query requires any specific/special HTTP headers to be present?

    Wednesday, October 30, 2013 5:54 PM
  • How are you setting the content type? In a working example, the content type of the metadata is "application/xml"
    Wednesday, October 30, 2013 6:09 PM
  • Hi Curt,

    Changing the response type from "text/xml" to "application/xml" fixed it! Thanks.

    Thursday, October 31, 2013 2:37 AM
  • I observe that Excel (or Power Query) is caching credentials and data previews.  I am hoping there is some mechanism to clear that cache - or even better to disable it during development. Any ideas?
    Thursday, October 31, 2013 5:44 AM
  • Just figure it out:

    http://office.microsoft.com/en-us/excel-help/data-source-settings-HA104050013.aspx

    Thursday, October 31, 2013 6:21 AM
  • But I'm still interested in understanding how Excel is caching data previews. I observer that preview data is present when I create an OData connection to a URL that I had used previously even though no traffic shows up in Fiddler.
    Thursday, October 31, 2013 6:25 AM
  • Yes, Power Query caches data locally for performance reasons. If you use "refresh", it will force the data to be re-fetched.
    Thursday, October 31, 2013 10:53 AM