# Dynamic Array as an input field to a service

**URL:** <https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE\
**Created:** [January 3, 2023, 9:51pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853 "2023-01-03T21:51:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Swarny](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@Greg\_Swarny](https://techcommunity.softwareag.com/u/Greg_Swarny)\
**Post date:** [January 3, 2023, 9:51pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/1 "2023-01-03T21:51:19Z")

</div>

#### NaturalONE - Software AG Designer 10.11

#### Development

#### I successfully developed a subprogram with dynamic array as one of the input fields, tested in DDL Tester. Can’t get syntax to pass as a REST Service.

#### Access to a non-materialized X-array field not permitted

---

<div class="post-metadata">

**Author:** ![MICK.FITZPATRICK](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MICK.FITZPATRICK](https://techcommunity.softwareag.com/u/MICK.FITZPATRICK)\
**Post date:** [January 3, 2023, 10:18pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/2 "2023-01-03T22:18:44Z")

</div>

The part about the REST service is a bit outside my wheelhouse but I do know that a dynamic array must be initially sized before it can be referenced.

There is a RESIZE AND RESET ARRAY statement for that purpose.

Mick Fitzpatrick - 301-529-8022  
Expert Technology Consultant

---

<div class="post-metadata">

**Author:** ![Eugene.Miklovich](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Eugene.Miklovich](https://techcommunity.softwareag.com/u/Eugene.Miklovich)\
**Post date:** [January 3, 2023, 10:20pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/3 "2023-01-03T22:20:31Z")

</div>

Just a guess, but did you have an initial allocation size?

---

<div class="post-metadata">

**Author:** ![Eugene.Miklovich](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Eugene.Miklovich](https://techcommunity.softwareag.com/u/Eugene.Miklovich)\
**Post date:** [January 3, 2023, 10:35pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/4 "2023-01-03T22:35:25Z")

</div>

You may have to have an initial sizing on the client side??

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [January 3, 2023, 10:58pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/5 "2023-01-03T22:58:30Z")

</div>

Is your REST service configured to accept a POST request? Does your REST client provide a document to be posted? Are you sending JSON (application/json) or XML (application/xml or text/xml)?

[Calling Natural from REST](https://documentation.softwareag.com/webmethods/entireX/exx10-9/webhelp/exx-webhelp/nat2rest/overview.htm#generate_define-rest)

Note particularly: GET method applies only to APIs where input signature parameters do not contain arrays. To use input arrays, you will need to POST a request document.

---

<div class="post-metadata">

**Author:** ![Greg\_Swarny](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@Greg\_Swarny](https://techcommunity.softwareag.com/u/Greg_Swarny)\
**Post date:** [January 4, 2023, 1:06pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/6 "2023-01-04T13:06:51Z")

</div>

Kathy predicted you would provide the answer! I am indeed doing a GET, which I am told is correct for retrieval only, but I like the POST and having a JSON Body much better. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [July 3, 2023, 1:07pm UTC](https://techcommunity.softwareag.com/t/dynamic-array-as-an-input-field-to-a-service/267853/7 "2023-07-03T13:07:22Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
