Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

VBScript Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Cloud Storage
Google Drive
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
PayPal
Peoplevox
QuickBooks
REST
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Stripe
Tar Archive
Twitter
VoiceBase
Walmart
XML
XMP
Xero
Zip
curl
eBay

 

 

 

(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.

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)

set http = CreateObject("Chilkat_9_5_0.Http")

'  Any string unlocks the component for the 1st 30-days.
success = http.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

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 (resp Is Nothing ) 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-2016 Chilkat Software, Inc. All Rights Reserved.