Using SOAP Results

There are three types of results that can be returned from a successful wsapi SOAP call:

ReadResult

The NSOA.wsapi.read(readRequest) function returns the ReadResult object.

For example, if the fields to be returned were "id, nickname, updated”, the objects property for the returned ReadResult object would be:

          // example ReadResult object - assumes the fields to be returned were "id, nickname, updated"   
 [
      {
             "errors": null,
           "objects": [
            {
                "id": "26",
                "nickname": "mcollins",
                "updated": "2019-10-03 15:42:23",
                "return_fields": {
                    "id": "1",
                    "nickname": "1",
                    "updated": "1"
                }
            },  
            {
                "id": "33",
                "nickname": "jadmin",
                "updated": "2019-09-03 09:12:46",
                "return_fields": {
                    "id": "1",
                    "nickname": "1",
                    "updated": "1"
                }
            } 
        ]
      }
] 

        

Property

Value

objects

Array of Complex Type objects, each with the following properties:

  • One property for each field to be returned as listed in the ReadRequest object. Each property has:

    • key: field_name — name of the field to be returned

    • value: field_value — returned field value

  • return_fields — object with the following properties for each field to be returned:

    • key: field_name — name of the field to be returned

    • value: 1

errors

Array of oaError objects.

UpdateResult

Thefollowing functions return the UpdateResult object.

Property

Value

id

Internal ID of the record created or updated.

errors

Array of oaError objects.

status

  • “U” — record was updated.

  • “A” — record was added.

  • “D” — record was deleted.

  • “-1” — one or more errors occurred.

Also see Handling SOAP Errors.