Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Requested array json n...
Finance forum
Answered

Requested array json not able to read

Posted on by 46
Hello Everyone,
 
I am getting an error while reading the requested array JSON. I created custom web service and client requesting a JSON by consuming it.
 
Error: /Message/: /An exception occured when deserializing the request - Exception occured when parsing the request content - Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1./,
    /ExceptionType/: /XppServicesDeserializationException/,
    /ActivityId/: /55b747e4-4cf4-0000-29a5-c22a9ea2da01/
Requested JSON Structure: (sample only have more nested list nodes)
[
  {
    /Customer/: {
      /CUSTOMERACCOUNT/: //,
      /GENDER/: //,
      /PERSONBIRTHDAY/: //,
      /PERSONBIRTHMONTH/: //,
      /PERSONBIRTHYEAR/: //,
      /PERSONFIRSTNAME/: //,
      /PERSONLASTNAME/: //,
      /SalesOrderHeader/: [
        {
          /SalesId/: //,
          /BROADCASTID/: //,
          /CALLCENTERAGENTID/: //,
          /CALLCENTERNAME/: //,
          /PAYMREFERENCE/: //,
          /SALESUNITID/: //,
          /TOTALORDERVALUE/: 0.00,
          /SalesOrderLine/: [
            {
              /SALESTYPEID/: //,
              /LINENUMBER/: /1/,
              /ITEMNUMBER/: //,
              /ORDEREDSALESQUANTITY/: 1,
              /ORDEREDINVENTORYSTATUSID/: //,
              /SALESPRICE/: 0.00,
              /ORIGINALPRICE/: 100.00              
            }
          ]
        }
      ]
    }
  }
]
Categories:
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 223,308 Super User on at
    Requested array json not able to read
    he JSON isn't valid for a custom service. You need an object with a properties matching parameters of the service method. The root element of your JSON is an array, not an object.
     
    Moved from D365 general forum to the Finance forum, because it's clearly about F&O and not about D365 in general.

Helpful resources

Quick Links

Upcoming TechTalk: Copilot Capabilities…

Review the Copilot features that are currently available in Dynamics 365 Finance…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,377 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans