wwSoap::ParseObject

This low level method parses an object based on the WSDL definition. A new empty object is created and the object is created on the fly and returned to you.

In most cases you don't have to call this method explicitly as a wwSOAP call will automatically try to convert the object. However, you can apply this method to a raw DOM result in the case of embedded objects that wwSOAP may not be able to parse automatically.

o.ParseObject(loObjectNode, lcTypeName)

Returns

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

See also

Class wwSoap