FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

Non-Chilkat Links
Text and String Handling

SOAP Example

How to send a SOAP request and get the XML response.

Download Chilkat XML ActiveX

Download Chilkat HTTP ActiveX

LOCAL loReq
LOCAL loHttp
LOCAL lnSuccess
LOCAL loSoapReq
LOCAL lcDomain
LOCAL lnPort
LOCAL lnSsl
LOCAL loResp
LOCAL loSoapResp
LOCAL loXmlResp

loReq = CreateObject('Chilkat.HttpRequest')
loHttp = CreateObject('Chilkat.Http')

*  Any string unlocks the component for the 1st 30-days.
lnSuccess = loHttp.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loHttp.LastErrorText)
    QUIT
ENDIF

*  Build this XML SOAP request:
*  <?xml version="1.0" encoding="utf-8"?>
*  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
*  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
*  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
*    <soap:Body>
*      <GetQuote xmlns="http://www.webserviceX.NET/">
*        <symbol>string</symbol>
*     </GetQuote>
*    </soap:Body>
*  </soap:Envelope>
loSoapReq = CreateObject('Chilkat.Xml')
loSoapReq.Encoding = "utf-8"
loSoapReq.Tag = "soap:Envelope"
loSoapReq.AddAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")
loSoapReq.AddAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema")
loSoapReq.AddAttribute("xmlns:soap","http://schemas.xmlsoap.org/soap/envelope/")

loSoapReq.NewChild2("soap:Body","")
loSoapReq.FirstChild2()
loSoapReq.NewChild2("GetQuote","")
loSoapReq.FirstChild2()
loSoapReq.AddAttribute("xmlns","http://www.webserviceX.NET/")
loSoapReq.NewChild2("symbol","MSFT")
loSoapReq.GetRoot2()

? loSoapReq.GetXml()

*  Build an SOAP request.
loReq.UseXmlHttp(loSoapReq.GetXml())
loReq.Path = "/stockquote.asmx"

loReq.AddHeader("SOAPAction","http://www.webserviceX.NET/GetQuote")

*  Send the HTTP POST and get the response.  Note: This is a blocking call.
*  The method does not return until the full HTTP response is received.

lcDomain = "www.webservicex.net"
lnPort = 80
lnSsl = 0

loResp = loHttp.SynchronousRequest(lcDomain,lnPort,lnSsl,loReq)
IF (loResp = NULL ) THEN
    ? loHttp.LastErrorText
ELSE
    *  The XML response is in the BodyStr property of the response object:
    loSoapResp = CreateObject('Chilkat.Xml')
    loSoapResp.LoadXml(loResp.BodyStr)

    *  The response will look like this:
    *  <?xml version="1.0" encoding="utf-8"?>
    *  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    *  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    *  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    *    <soap:Body>
    *      <GetQuoteResponse xmlns="http://www.webserviceX.NET/">
    *        <GetQuoteResult>string</GetQuoteResult>
    *      </GetQuoteResponse>
    *    </soap:Body>
    *  </soap:Envelope>
    *  Navigate to soap:Body
    loSoapResp.FirstChild2()
    *  Navigate to GetQuoteResponse
    loSoapResp.FirstChild2()
    *  Navigate to GetQuoteResult
    loSoapResp.FirstChild2()

    *  The actual XML response is the data within GetQuoteResult:
    loXmlResp = CreateObject('Chilkat.Xml')
    loXmlResp.LoadXml(loSoapResp.Content)

    *  Display the XML response:
    ? loXmlResp.GetXml()

ENDIF

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · ASP Mail Component · XML Parser