Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > RESTful HTTP Service

Forum

Search UsersRules
RESTful HTTP Service
#1
Active user
Points:: 0
Joined:: Mar 20, 2012

Hello.
I'm trying to implement new OData based RESTful Web Service.

When I trying to call this method:

Code
GET /Infobase/odata/standard.odata/InformationRegister_PreciosDeNomenclatura/SliceLast() 


i've got this error:

Code
<m:error><m:code>6</m:code><m:message>Extra segments are found in a request to an entity container!</m:message></m:error>
.

What am I doing wrong?

Profile
#2
Guest
Points::
Joined::

Hello, Mikhail!

Can you provide raw HTTP request data?
Also please check, is it possible to execute SliceLast() for PreciosDeNomenclatura information register without parameters?

Profile
#3
Active user
Points:: 0
Joined:: Mar 20, 2012

I just entered this request into the browser address field. With accumulation register balance() method it works fine. But with information register, even with parameters, it shows the same error message.

How can I check this:

Quote
Timofey Bugaevsky wrote:
is it possible to execute SliceLast() for PreciosDeNomenclatura information register without parameters?
?

What exactly means this error message?

Profile
#4
Guest
Points::
Joined::

Is PreciosDeNomenclatura information register periodical? If it does not, it can not have a slice of last values.
See the result of

Code
InformationRegisters.PreciosDeNomenclatura.SliceLast()

Does it return Undefined instead of ValueTable?

Profile
#5
Active user
Points:: 0
Joined:: Mar 20, 2012

It returns ValueTable.

Profile
#6
Guest
Points::
Joined::

Thank you, I need to doublecheck this information and will inform you later.

Profile
#7
Guest
Points::
Joined::

Hello, Mikhail!
You need to set the compatibility mode of the configuration to 8.3.4 and publish OData and Web and Thin clients.
I have created a simple example, see attached files.

Profile
#8
Guest
Points::
Joined::

If you want too disable the compatibility mode of the configuration, you need to specify the standard OData interface content. For this, you can create an external data processor or build this into the applied solution. The data processor should run script that configures the list of objects, which are available for OData interface. Here is the example:

Code
Array = New Array();

For Each InformationRegister In Metadata.InformationRegisters Do
    Array.Add(InformationRegister);
EndDo;

SetStandardODataInterfaceContent(Array);

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.