Viewing data from «1C: Enterprise» and other HTTP services

Print Previous page Top page Next page

External sources of attributive data can be configured for the user map. These sources are accessed through the NTTR protocol. The returned data set in XML format is a table, where the nodes within the main node of the document are the records of this table, and the first-level child nodes within them are the fields of the table.

The sources of attributive data can be:

- any HTTP services that return a data set in XML format in response to a GET request (as indicated above);

- «1C:Enterprise» web service, which returns a data set in XML format in response to a GET request, including in accordance with the OData protocol.

The connection of records of a data set from an external source with map objects is carried out according to the value of the key field and the predefined semantics of the object, which is specified in the settings.

Several external sources can be configured for a user map, for each of which the one or more attributive data requests can be configured.

The specified settings are saved in a file with the *.SES extension, located next to the map passport file and having the same name.

The dialog for setting sources of external semantics is called by pressing the «Settings» button in the «Information from the database table» dialog box, as well as from the context menu called by right-clicking on the tree element corresponding to the customized user map in the «Map Legend» window (F11 ).

 

mapdba_dialog

Dialog for setting sources of external semantics

 

 

Order of customization of requests of external semantics

 

1.

Call the dialog for setting external semantics.

2.

Add a new connection to the data source (the «+» button in the upper left part of the dialog),

or select an existing data source for editing.

3.

In the connection parameters, specif:

 

-

connection name (data source);

 

-

comment (optional parameter);

 

-

choose connection type (currently only one option is available - HTTP service);

 

-

for NTR service it is necessary to specify:

 

 

-

connection string (URL) to the service - here you specify the root address of the web application of the service that responds to requests, the requests themselves are configured further

 

 

-

type of authorization (currently available options: no authorization and basic authorization by login and password);

 

 

-

in the case of basic authorization, specify the login and password (the password can be empty).

4.

Add data request parameters to the configured connection (the «+» button at the top of the right panel of the dialog box) or select an existing request for editing.

5.

-

To request data from the HTTP service you need to specify the following parameters:

 

 

-

request alias unique request name used by the program for identification;

 

 

-

request name text that will be used as a header for the received data;

 

 

-

request reference string (URL) - both the full URL string for the request and the part of the string directly responsible for a particular request, appended to the root address of the web application of the service specified to connect to the HTTP service can be specified;

 

 

-

if you specify the URL of the request, which must be added to the root address of the HTTP service, you should check the box in the option «Append to the main URL»;

 

 

-

for «1C: Enterprise» NTTR services that publish their resource data via the OData protocol, the request has a predefined format: «main_URL/odata/standard.odata/resource_name»;

 

 

-

only one type of HTTP request is currently supported - GET request;

 

 

-

the format of the response should be chosen based on how the server generates the response:

 

 

 

-

«XML» - for most HTTP services (the result is in the form of xml, where the root node contains the records of the data set, and their first-level child nodes are the fields of the records);

 

 

 

-

«XML (OData 1C)» - for «1C: Enterprise» NTTR services (the result is also as xsh1, where the root node contains descriptions of entities - in <entry> nodes, and their semantics fields are not in the first level child nodes, but inside the sub-node <content><m:properties>...</m:properties></content>;

 

 

-

specify the parameters of link between map objects and records of the data set obtained as a result of the request, the link is carried out by the coincidence of values:

 

 

 

-

semantic characteristics of the map object;

 

 

 

-

the specified key field of the dataset.