The metadata service is used to retrieve information regarding entities. The information about the entities includes the list of the entities that are exposed through the service, their properties, and the data values contained in these properties. For more information on Exact Globe Next entity services, see Exact Globe entity services startpage.
To consume the metadata services, you can use Exact.Services.Client wrapper DLL, which handles most of the binding and serialization protocols and data formats for the service. You can either reference it from the bin folder (located at the installation directory of Exact Globe Next) or copy it to the project folder.
Note: When you are copying Exact.Services.Client wrapper DLL to the project folder, it is recommended that you copy it to the base project folder, as the contents of the bin folder will be erased after a rebuild or clean up in the system.
This document gives you the step-by-step procedure for obtaining metadata on specific entities using Exact Globe Next entity metadata services.
The references that are created are shown in the following screen:
The service binding is exposed through the Exact.Services.Client.Metadata.MetadataEG class. The existing entities are defined as Exact.Services.Client.Metadata.DefinedEntity and the details specific to an entity is defined as Exact.Services.Client.Metadata.MetadataEntity.
Private metaClient As Exact.Services.Client.Metadata.MetadataEG
Private exposedEntities() As Exact.Services.Client.Metadata.DefinedEntity
Private metaEntity As Exact.Services.Client.Metadata.MetadataEntity
Private metadataKeyProperty As String
To instance the service binding, the service URI must be provided to the MetadataEG constructor. Currently, the entity services are exposed as self-hosted web services under the services virtual folder of the machine. The port number can be either “8000” or “8010”, depending on the Exact Globe Next and Exact Synergy Enterprise installation types. As the metadata services do not depend on any database, you do not need to provide any SQL server name or database name to operate.
Private Function ConnectMetaData() As Boolean
Dim serviceURL As String
Dim portNumber As String = portNumberTextBox.Text
If portNumber.Trim().Length = 0 Then
portNumber = "8010"
portNumberTextBox.Text = "8010"
End If
If Not IsNumeric(portNumber) Then
ErrorProvider1.SetError(portNumberTextBox, "Port: Must be: Number.")
Return False
If serviceLocationTextBox.Text.Trim().Length = 0 Then
serviceLocationTextBox.Text = "localhost"
serviceURL = String.Format("http://{0}:{1}/services", "localhost", portNumber)
Else
serviceURL = String.Format("http://{0}:{1}/services", serviceLocationTextBox.Text, portNumber)
Try
metaClient = New Exact.Services.Client.Metadata.MetadataEG(serviceURL)
Catch ex As Exception
MessageBox.Show("Exception occurred trying to open meta data: " & ex.Message)
End Try
Return True
The MetadataEG instance can be used to retrieve all the available entities and also the metadata of specific entities.
The available entities can be retrieved using the method DefinedEntities, as shown in the following:
exposedEntities = metaClient.DefinedEntities()
The details of a specific entity can be retrieved using the method Retrieve, as shown in the following:
Private Function RetrieveMetadata(ByVal entityName As String, ByRef keyProperty As String) As Boolean
keyProperty = ""
If entityName.Length = 0 Then
If metaClient Is Nothing Then
If Not ConnectMetaData() Then
metaEntity = metaClient.Retrieve(entityName)
MessageBox.Show("Exception occurred reading meta data: " & ex.Message)
Return Nothing
keyProperty = metaEntity.Interface.KeyProperty
End Function
Note: The contents of MetadataEntity.Interface.Properties can be parsed to define their expected data values.