Skip to content

HttpGetXmlString - cXmlHttpTransfer

Retrieves XML data as a string

Type: Function
Return Data Type: String

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 HttpGetXmlString String sHost String sFilePath Returns String

Call Example

Get HttpGetXmlString sHost sFilePath to StringVariable

Description

The HttpGetXmlString function retrieves XML data as a string. The string does not have to be valid XML, although this is assumed.

Received data is translated as needed, based on the property values of peTranslateReceived.

Consider using the HttpGetXmlAddr function if you need to retrieve large blocks of data.

Sample

handle hoHttp
handle hoXml
string sXml

Get Create U_cXmlHttpTransfer to hoHttp

Get HttpGetXmlString of hoHttp "dataaccess.com" ;
    "MyApplication/pricelist.xml" to sXml

Send Destroy of hoHttp

If (sXml="") ;
    Send Stop_Box "No document returned" "Error"
Else Begin
    Send Info_Box sXml

    Get Create U_cXmlDomDocument to hoXml

    Send LoadXml of hoXml sXml to bOk

    If (bOk=True) ;
        Send DoWhateverYouWantWithXmlDocument hoXml

    Send Destroy of hoXml
End

See Also

HttpGetXmlAddr | Info_Box

Return Value

The returned string is subject to DataFlex string length limitations. If an error occurs in the transfer, an empty string is returned.