Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

VBScript Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(VBScript) HTTP SOAP 1.2 Request and Response using POST

Demonstrates a working SOAP 1.2 request and response using POST with a live server. You may try running this example with the URLs and data provided. See http://wsf.cdyne.com/WeatherWS/Weather.asmx?op=GetCityWeatherByZIP for details.

Note: This example is correct in theory, but no longer works for live testing because the SOAP service provider (cdyne.com) has made changes or discontinued the free service.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = CreateObject("Chilkat_9_5_0.Http")

set soapXml = CreateObject("Chilkat_9_5_0.Xml")

soapXml.Tag = "soap12:Envelope"
success = soapXml.AddAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")
success = soapXml.AddAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema")
success = soapXml.AddAttribute("xmlns:soap12","http://www.w3.org/2003/05/soap-envelope")

soapXml.NewChild2 "soap12:Body",""
success = soapXml.GetChild2(0)
soapXml.NewChild2 "GetCityWeatherByZIP",""
success = soapXml.GetChild2(0)
success = soapXml.AddAttribute("xmlns","http://ws.cdyne.com/WeatherWS/")
soapXml.NewChild2 "ZIP","60187"
soapXml.GetRoot2 

outFile.WriteLine(soapXml.GetXml())

set req = CreateObject("Chilkat_9_5_0.HttpRequest")
req.HttpVerb = "POST"
req.SendCharset = 0
req.AddHeader "Content-Type","application/soap+xml; charset=utf-8"
req.AddHeader "SOAPAction","http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"
req.Path = "/WeatherWS/Weather.asmx"
success = req.LoadBodyFromString(soapXml.GetXml(),"utf-8")

http.FollowRedirects = 1

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.SynchronousRequest("wsf.cdyne.com",80,0,req)
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
Else
    set xmlResponse = CreateObject("Chilkat_9_5_0.Xml")
    success = xmlResponse.LoadXml(resp.BodyStr)
    outFile.WriteLine(xmlResponse.GetXml())

End If


outFile.Close

 

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