wwSoap::ParseObject

This method parses an object type into a Fox object if a type definition exists in the WSDL file.

This method is used internally by CallWSDLMethod to take object parameters and return generic Fox objects that contain the structure of the embedded XML. The objects are data only objects and return the full hierarchy as long as the child object definitions exist as WSDL definitions which are used to create objects on the fly.

o.ParseObject(loObjectNode, lcTypeName)

Return Value

Object or .NULL.

Parameters

loObjectNode
DOM node that corresponds to the Root of the object. Typically this will be the return value node of the SOAP body.

lcTypeName
Name of the class to convert. This value is case sensitive and must match a type that exists in the WSDL defnition.

Remarks

Be careful of object that return schema's types (like DataSet). DataSet and other schema'd results are returned as NULL values.

Objects are returned as data objects only - no methods exist on them, only the properties. If a property cannot be matched it'll be set to .NULL.

Some property names that conflict with VFP's native names will fail. Top, Left, Name, Class etc. - if your object has these the conversion may fail.

You typically don't have to call this method explicitly as CallWSDLMethod() will call it automatically for non-intrinsic return types.

Example

oSOAP = CREATE("wwSOAP")
oSOAP.nReturnType = 2   && DOM Node

loSDL = oSOAP.ParseServiceWSDL(lcWSDL,.T.) && Make sure you parse types!

oSOAP.AddParameter("lnPK",5444)
loDomNode = oSOAP.CallMethod("ReturnCustomer") 

*** Parse the XML for the Customer type
loCust = oSOAP.ParseObject(loDomNode,"Customer")

? loCust.cCompany
? loCust.tEntered

Overloads:


See also:

Class wwSoap

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