{"title":"Use OData to return and obtain a service metadata document","url":"https://jonas-paprotka.de/docs/dev-itpro/webservices/return-obtain-service-metadata-edmx-document/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/return-obtain-service-metadata-edmx-document, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/return-obtain-service-metadata-edmx-document","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Using OData to return and obtain a Service Metadata (EDMX) Document.","date":"2025-12-23","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Use OData to return and obtain a service metadata document","slug":"use-odata-to-return-and-obtain-a-service-metadata-document","at":0,"chars":3057},{"level":2,"title":"Obtain a service metadata \\(EDMX\\) document","slug":"obtain-a-service-metadata-edmx-document","at":1586,"chars":1430},{"level":2,"title":"Related information","slug":"related-information","at":3016,"chars":41}],"text":"# Use OData to return and obtain a service metadata document\nThe Entity Data Model \\(EDM\\) is a specification for defining the data that is used by applications that are built on the Entity Framework. EDMX is an XML-based file format that is the packaging format for the service metadata of a data service. When you interact with an OData service that is published from Business Central, you can request EDM-based proxies, Then, use tools such as LINQ to create data access logic. LINQ is a programming model that developers can use to query data from various data sources, including OData. See LINQ \\(Language-Integrated Query\\)<https://learn.microsoft.com/previous-versions/bb397926(v=vs.140)>.\nThe Business Central implementation of EDM follows the .NET 4.0 WCF Data Service Framework implementation<https://learn.microsoft.com/dotnet/framework/wcf/>.\nThe following guidelines are implemented for EDM.\n Primary key fields in tables are automatically defined as properties in the service metadata document even if they aren't exposed on a page as controls.\n Business Central field names are mapped to EDMX property names by applying the following transformations:\n   Spaces are replaced with underscores (_)\n   Dots (`.`) are removed (example: No. -> No)\n   Parentheses are removed (example: `Balance (LCY)` -> Balance_LCY)\n   Slashes (`/`) are replaced with underscores (example: `Country/Region` -> Country_Region)\n   Apostrophes (`'`) are encoded as _x0027_ (example: `Don't` -> Don_x0027_t)\n   Percent signs (`%`) are replaced with Percent (example: `Profit %` -> Profit_Percent)\n## Obtain a service metadata \\(EDMX\\) document\n1. You can obtain service metadata documents for either page or query web services. This example uses a page web service. Register and publish a page web service by using the Business Central Web client. See publish-web-service..\n1. Start a supported web browser, such as Microsoft Edge. In the Address field, enter a URI in this format:\n ```http\n https://<Server>:<WebServicePort>/<ServerInstance>/ODataV4/$metadata\n ```\n If Business Central Server is running on the local computer and is using the default Business Central Server instance and OData port, then the address is:\n ```http\n https://localhost:7048/<server instance>/ODataV4/$metadata\n ```\n The browser should now show the complete metadata for the page web service that you published. The beginning of this document looks like this:\n ```xml\n <edmx:Edmx xmlns:edmx=\"http://docs.oasis-open.org/odata/ns/edmx\" Version=\"4.0\">\n  <edmx:DataServices>\n   <Schema xmlns=\"http://docs.oasis-open.org/odata/ns/edm\" Namespace=\"NAV\">\n    <EntityType Name=\"Media\">\n     <Key>\n       <PropertyRef Name=\"ID\"/>\n     </Key>\n     <Property Name=\"ID\" Type=\"Edm.Guid\" Nullable=\"false\">\n       <Annotation Term=\"NAV.LabelId\" String=\"ID\"/>\n       <Annotation Term=\"NAV.NavType\">\n         <EnumMember>NAV.NavType/Guid</EnumMember>\n       </Annotation>\n       <Annotation Term=\"NAV.AllowEditOnCreate\" Bool=\"true\"/>\n     </Property>\n     ...\n ```\n## Related information\nodata-web-services"}