Problem using odatagen tool

Feb 14, 2011 at 2:26 PM


I'm trying to the to generate a Proxy Class using the ODatagen tool for accessing my SQL Azure DB with  the following statement

./odatagen /uri=$metadata /out=/Users/matthiaswedig/odataapp

But I receive the following error message:

odatagen[1387:903] odatagen: Error in saving metadataentw01:MacOSX10.6.sdk

Most likely I'm making a basic error. Nevertheless, any help is appreciated.

Thanks, Matthias

Feb 14, 2011 at 8:08 PM

The error happens during saving. Does the folder /Users/matthiaswedig/odataapp exist?

If it does exist, can you view the URL on your browser? What do you see from the URL$metadata

Feb 15, 2011 at 7:48 AM

The folder exists and the URL in the browser works fine - at least it looks fine to me. My assumption is the saving problem has something to do with user rights on the Mac I'm developing on but so far I haven't had any other user right issues. Therefore I'm a bit lost.


Here's the XML I'm getting via the browser:

  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <edmx:Edmx Version="1.0" xmlns:edmx="">
- <edmx:DataServices xmlns:m="" m:DataServiceVersion="1.0">
- <Schema Namespace="Bundesliga" xmlns:d="" xmlns:m="" xmlns="">
- <EntityType Name="Vereine">
- <Key>
  <PropertyRef Name="VereinsID" />
  <Property Name="ErstelltAm" Type="Edm.DateTime" Nullable="false" />
  <Property Name="ErstelltVon" Type="Edm.String" Nullable="true" />
  <Property Name="GeändertAm" Type="Edm.DateTime" Nullable="true" />
  <Property Name="GeändertVon" Type="Edm.String" Nullable="true" />
  <Property Name="Jahresbudget" Type="Edm.Decimal" Nullable="true" />
  <Property Name="SaisonID" Type="Edm.Int32" Nullable="false" />
  <Property Name="Transferausgaben" Type="Edm.Decimal" Nullable="true" />
  <Property Name="VereinsID" Type="Edm.Int32" Nullable="false" />
  <Property Name="Vereinslogo" Type="Edm.Binary" Nullable="true" />
  <Property Name="Vereinsname" Type="Edm.String" Nullable="true" />
- <EntityContainer Name="Bundesliga" m:IsDefaultEntityContainer="true">
  <EntitySet Name="Vereines" EntityType="Bundesliga.Vereine" />
Feb 17, 2011 at 12:42 AM

I will verify that this works on Version 1.2. This may be a problem with Version 1.1, and sorry I can't verify it. Version 1.2 is coming out soon.

Mar 4, 2011 at 9:49 PM

I have verified that this works with Version 1.2. What I did was use the service definition that you quoted above. I put that definition in a file and fed it to odatagen. ODatagen V1.2 generated the .h and .m files. I am sending these files to you privately in case you can't wait for Version 1.2.

Mar 25, 2011 at 2:53 PM


I'm having the same issue but I'm not able to send you the metadata... Is there any solution?
We just decided to create a new product which based on OData.

Thanks, fspies

Mar 26, 2011 at 7:47 AM

I finally got it by myself:
There was a problem to create the metadata.xml in filesystem. I manually fed it to odatagen and it works.
Dunno there is another way but this works for me:

- open odata project in Xcode and comment line 


- use instead

if (NO)

- build project and navigate to the products folder
- save your metadata of the service to <products folder>/metadata.xml
- navigate in shell to products folder and type

./odatagen /uri=anythingyouwantcauseitsignored /out=your_output_folder


Hope this helps,