Skip to content

HttpGetXmlAddr - cXmlHttpTransfer

Retrieves XML data and returns the memory address of that data

Type: Function
Return Data Type: Pointer

Parameters

Parameter Type Description
sHost String The URL host (e.g. DataAccess.com - Note: DO NOT include the "HTTP://")
sFilePath String The file path and any data passed in a query string (e.g. MyXMlSite/XmlSrvc.asp?ID=A)

Syntax

Function HttpGetXmlAddr String sHost String sFilePath Returns Pointer

Call Example

Get HttpGetXmlAddr sHost sFilePath to PointerVariable

Description

The HttpGetXmlAddr function requests XML data. The data received is returned as a pointer. The data does not have to be valid XML, although this is assumed.

Sample

Procedure Example
    handle hoHttp hoXml
    address aXml
    integer bOk iVoid

    Get Create U_cXmlHttpTransfer to hoHttp

    Get HttpGetXmlAddr of hoHttp "dataaccess.com" ;
        "MyApplication/pricelist.xml" to aXml

    Send Destroy of hoHttp

    If (aXml=0) ;
        Send Stop_Box "No document returned" "Error"
    Else Begin
        Get Create U_cXmlDomDocument to hoXml

        Get LoadXmlFromAddress of hoXml aXml to bOk

        Move (Free(aXml)) to iVoid

        If (bOk=True) ;
            Send DoWhateverYouWantWithXmlDocument hoXml

        Send Destroy of hoXml
    End
End_Procedure  // Example

See Also

HttpGetXmlString

Return Value

If an error occurs in the transfer, a zero is returned. It is up to you to dispose of the returned data using the Free function.