Rest API - Underscores in entity name for model

Posted by: grapecity on 25 September 2017, 10:47 pm EST

    • Post Options:
    • Link

    Posted 25 September 2017, 10:47 pm EST

    Greetings, I’m trying to make some post petitions to REST service for adding new entities in my model.

    Some of my entities naming have underscores (_) in it, like “entity_name”, but when sending a constructed JSON to the service, that underscore seems to be interpreted like a point (.) as in “entity.name”.

    Is there a way to use underscores in their naming?

    Originally, my JSON was constructed by using some methods made in JAVA and to test if this issue arises because of differences between platforms I replicated them in C# but no luck so far .

    (Attached to this post is the mentioned method and result returned from server)

    My current AR Server build is: ActiveReports10Server-v10.2.7127.0

    (Additionally, I’ve submitted a ticket for this issue but as for now any response of you receiving it has been received)

    2017/03/RESTIssue.txt

  • Posted 25 September 2017, 10:47 pm EST

    Hello ,

    please change the binding string format to “Binding = string.Format(@“vw_rh_{0}_{1}”, report, user),”

    Thanks, Sergey Romanov.

  • Posted 25 September 2017, 10:47 pm EST

    Hi, You need to escape the “_” with “_” in the table name, before sending the Json to the service.

  • Posted 25 September 2017, 10:47 pm EST

    @SergeyRomanov said: Hello ,

    please change the binding string format to “Binding = string.Format(@“vw_rh_{0}_{1}”, report, user),”

    Thanks, Sergey Romanov.

    Thanks for the answer, I’ve tried your recommendation but now the service returns an array out of bounds exception (attached to this post).

    To verify if it wasn’t an issue with my method, I sent another request to the API but using a table without underscores in its name and worked fine, so it must be another thing. 2017/04/ModelException.txt

  • Posted 25 September 2017, 10:47 pm EST

    Hello ,

    in such case, i think you need to add “dbo_” - “Binding = string.Format(@”dbo_vw_rh_{0}_{1}”, report, user),”

    Thanks, Sergey Romanov.

  • Posted 25 September 2017, 10:47 pm EST

    @SergeyRomanov said: Hello ,

    in such case, i think you need to add “dbo_” - “Binding = string.Format(@”dbo_vw_rh_{0}_{1}”, report, user),”

    Thanks, Sergey Romanov.

    This solves the previously found problem and the troubles with the server handling JSON. Thanks.

    (Sorry for delaying my response, there were holidays here in my country and couldn’t check this)

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels