Retrieving $ metadata for a specific collection or object using Odata Web Services in Microsoft Dynamics NAV 2016

Environment

As part of an integration project, I need a PHP site to be able to read and write to Microsoft Dynamics NAV 2016 Odata services.

Microsoft Dynamics NAV 2016 uses the Odata v3 standard .


Context

Now take my service customeras an example.

Getting a set of objects

Getting an overview of my collection of objects customerworks fine using a link with the following format:

https://<Server>:<WebServicePort>/<ServerInstance>/OData/Company(\'<CompanyName>\')/customer

Getting one object

Getting a single object customerbased on idworks fine using a link with the following format:

https://<Server>:<WebServicePort>/<ServerInstance>/OData/Company(\'<CompanyName>\')/customer(\'<Id>\')

Retrieving Global Metadata

$metadata ( Json), :

https://<Server>:<WebServicePort>/<ServerInstance>/OData/$metadata

,

, Odata v3 odata.metadata , $metadata customer, :

https://<Server>:<WebServicePort>/<ServerInstance>/OData/$metadata#customer

. . The issue.

, Odata v3 odata.metadata , $metadata customer, :

https://<Server>:<WebServicePort>/<ServerInstance>/OData/$metadata#customer/@<FieldName>

. . The issue.

- , $metadata, , . , URL- , .


()

  • , Fetching collection-specific metadata Fetching entity-specific metadata The context ?
  • , ? ?
+1
2

@xuzhg, , , Github, (# 181), , Odata $metadata . XML .

, - $ https://<Server>:<WebServicePort>/<ServerInstance>/OData/$metadata#..., XML, Json ( Odata).

+1

, , , URI , $metadata, .

, . #customer EntityType, Name customer. , #customer/@someprop Property, Name someprop.

+1

Source: https://habr.com/ru/post/1661488/


All Articles