locked
Generating the edmx file for the SL4 proxy RRS feed

  • Question

  • Hi there,

     

    I would like to know if there is a command line tool or a flag in datasvcutil.exe to generate the edmx file needed in the proxy. 

     

    Best regards


    Philippe
    Tuesday, September 14, 2010 12:55 PM

Answers

  • Hi,

    The file is not generated when you update/add data service reference, it is simply downloaded from the service (since the client proxy is then generated from this file). You can definitely compile and run your application without the file.

    Thanks,


    Vitek Karas [MSFT]
    • Marked as answer by PhilTheGap Thursday, September 16, 2010 7:02 AM
    Wednesday, September 15, 2010 5:17 PM
    Moderator

All replies

  • Hi,

    Could you please explain which proxy needs an edmx file? The client side proxies generated by DataSvcUtil don't need any edmx files.

    Thanks,


    Vitek Karas [MSFT]
    Tuesday, September 14, 2010 7:49 PM
    Moderator
  • Hi,

    Well I use an Silverlight 4 client. In my solution, after updating manually the service reference in Visual Studio 2010, a "service.edmx" file is generated, on the same folder than the "reference.cs" file.

    I give here the beginning of that file:

     

     

    <edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
     <edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="1.0">
     <Schema Namespace="PictBaseModel" 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/2008/09/edm">
     <EntityType Name="Anchor">
     <Key>
      <PropertyRef Name="Id_Anch" />
     </Key>
     <Property Name="Id_Anch" Type="Edm.Int32" Nullable="false" p8:StoreGeneratedPattern="Identity" xmlns:p8="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
    

     

     Seems to contains metadata. If I delete it, I can still compile and my app is still working.

    If I give this "service.edmx" file as an input for "datasvcutil.exe", I have a non empty (so probably correct) "reference.cs" file.

     

    Best regards


    Philippe
    Wednesday, September 15, 2010 9:34 AM
  • Hi,

    That services.edmx file is just a copy of the $metadata response for your service. Assuming your service is hosted on http://host/service.svc, then you can point your browser to http://host/service.svc/$metadata and you will get exactly the same response as the one stored in the service.edmx.

    Thanks,


    Vitek Karas [MSFT]
    Wednesday, September 15, 2010 10:19 AM
    Moderator
  • Hi,

    That services.edmx file is just a copy of the $metadata response for your service. Assuming your service is hosted on http://host/service.svc, then you can point your browser to http://host/service.svc/$metadata and you will get exactly the same response as the one stored in the service.edmx.

    Thanks,


    Vitek Karas [MSFT]

    So why is this file generated when updating/adding a data service reference ? Can I compile and run my app without it ?

     

    Thanks


    Philippe
    Wednesday, September 15, 2010 12:35 PM
  • Hi,

    The file is not generated when you update/add data service reference, it is simply downloaded from the service (since the client proxy is then generated from this file). You can definitely compile and run your application without the file.

    Thanks,


    Vitek Karas [MSFT]
    • Marked as answer by PhilTheGap Thursday, September 16, 2010 7:02 AM
    Wednesday, September 15, 2010 5:17 PM
    Moderator