wwSoap::ParseObjectArray

Parses a DOM node that contains an array of same type objects into an array.

This low level method provides the ability to retrieve XML into a DOM node through the SOAP client and then pass it to this method to parse the array into its individual objects.

o.ParseObjectArray(@laObjects,lcObjectType,loNodeHeader)

Parameters

@laObjects
The array that is filled with the objects.

lcObjectType
The object type defined in the WSDL file.

loNodeHeader
Optional - A DOM node that points at the root node of the array items.
If this parameter is not parsed wwSOAP attempts to read the return value from the method call.

Remarks

Generally you should return results from the Web Service as a DOM node (nReturnMode=2) . Otherwise wwSOAP may end up parsing the array as a single object automatically.

Example


lcWSDL = "http://localhost/FoxWebServiceInterop/FoxInteropService.asmx?WSDL"

*** WWSOAP
oSOAP = CREATEOBJECT("wwSOAP")
oSOAP.lParseReturnedObjects = .t.

oSOAP.nReturnMode = 2 && XMLDOM

loAuthors = oSOAP.CallWSDLMethod("GetAuthorArray",lcWSDL)

IF oSOAP.lError
? oSOAP.cErrorMsg
RETURN
ENDIF

DIMENSION laAuthors[1]
lnCount = oSOAP.ParseObjectArray(@laAuthors,"AuthorEntity")
? lnCount
FOR x = 1 TO lnCount
? laAuthors[x].au_lName
? " --- " + laAuthors[x].PhoneNumbers.HomePhone
ENDFOR


See also:

Class wwSoap

© West Wind Technologies, 1996-2024 • Updated: 06/23/04
Comment or report problem with topic