HTTP services

Additionally to the automated REST interface of the application, the platform allows creating native HTTP services in the application.

Using the 1C:Enterprise language, the developer generates a query response. With that, they have convenient access to the initial query's body, headers, and string, or can generate the code, body, and headers at their own discretion.

HTTP services have several benefits compared to existing SOAP web services, namely:

  • Easy HTTP service client programming

  • Potentially lower volume of the transmitted data

  • Potentially lower computation load

  • HTTP services focus on resources while SOAP services focus on actions

The first three factors are crucial for mobile applications.

HTTP services can be used as lite RPC services not requiring effort-consuming preparation of XML datasets. Methods can be identified in the URL while parameters can be transmitted in the request options or body. In the latter case, such services become similar to SOAP services, offering lower specification accuracy but better flexibility.

In terms of design, HTTP services resemble built-in web services. Also, there are HTTP service configuration objects. Such objects are added to OVERALL — HTTP services:

Every HTTP service may contain one or several templates. For every template, the user can generate one or several data processing methods:

A template sets the path to access the HTTP service. A template may contain a set of characters, including parametrized segments like {some text}.

For every template, an HTTP method is specified and a 1C:Enterprise language-powered data processing procedure created. Also, the user can prescribe that any available HTTP method, rather than a specific one, is processed.

When accessing such an HTTP service, the platform will first try to collate match the access URL to one of the available templates and methods. If the match is failed, the platform will return the response code, 404 Not Found. If an appropriate method is found, the platform will start to execute its handler by sending it all the query data in the form of 1C:Enterprise language object HTTPServiceQuery:

From that object, the user can easily get parameters contained in the initial URL and use them for extracting the intended data from the base.

The obtained data can be returned in various formats. For instance, they can be transformed into XML (see figure above) or a text string with separators.

The service response is generated by dedicated 1C:Enterprise language object HTTPServiceResponse the body of which the user can fill with the data.

HTTP services are published in the same way as web services. They are subject to the similar authentication, data separation, and debugging procedures.

Next page: JSON

Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.