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

PowerBuilder Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(PowerBuilder) Peoplevox WMS Authentication

Provides an example of a call to the Peoplevox WMS Authenticate using SOAP 1.1.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
integer li_Success
oleobject loo_SbSoapXml
oleobject loo_Crypt
string ls_PasswordBase64
integer li_NumReplacements
oleobject loo_Req
oleobject loo_Http
oleobject loo_Resp
oleobject loo_XmlResponse
string ls_Detail

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

// Sends a POST that looks like this:

// 	POST /PEOPLEVOX_CLIENT_ID/resources/integrationservicev4.asmx HTTP/1.1
// 	Content-Type: text/xml;charset=UTF-8
// 	SOAPAction: http://www.peoplevox.net/Authenticate
// 	Content-Length: (automatically computed and added by Chilkat)
// 	Host: qac.peoplevox.net
// 
// 	<?xml version="1.0" encoding="utf-8"?>
// 	<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:peop="http://www.peoplevox.net/">
// 	   <soapenv:Header/>
// 	   <soapenv:Body>
// 	      <peop:Authenticate>
// 	         <peop:clientId>PEOPLEVOX_CLIENT_ID</peop:clientId>
// 	         <peop:username>PEOPLEVOX_USERNAME</peop:username>
// 	         <peop:password>PEOPLEVOX_BASE64_PASSWORD</peop:password>
// 	      </peop:Authenticate>
// 	   </soapenv:Body>
// 	</soapenv:Envelope>
// 

loo_SbSoapXml = create oleobject
li_rc = loo_SbSoapXml.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
if li_rc < 0 then
    destroy loo_SbSoapXml
    MessageBox("Error","Connecting to COM object failed")
    return
end if
loo_SbSoapXml.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>")
loo_SbSoapXml.Append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:peop=\"http://www.peoplevox.net/\">")
loo_SbSoapXml.Append("   <soapenv:Header/>")
loo_SbSoapXml.Append("   <soapenv:Body>")
loo_SbSoapXml.Append("      <peop:Authenticate>")
loo_SbSoapXml.Append("         <peop:clientId>PEOPLEVOX_CLIENT_ID</peop:clientId>")
loo_SbSoapXml.Append("         <peop:username>PEOPLEVOX_USERNAME</peop:username>")
loo_SbSoapXml.Append("         <peop:password>PEOPLEVOX_BASE64_PASSWORD</peop:password>")
loo_SbSoapXml.Append("      </peop:Authenticate>")
loo_SbSoapXml.Append("   </soapenv:Body>")
loo_SbSoapXml.Append("</soapenv:Envelope>")

// Base64 encode the password and update the SOAP XML.
loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat_9_5_0.Crypt2")

ls_PasswordBase64 = loo_Crypt.EncodeString("PEOPLEVOX_PASSWORD","utf-8","base64")
li_NumReplacements = loo_SbSoapXml.Replace("PEOPLEVOX_BASE64_PASSWORD",ls_PasswordBase64)

loo_Req = create oleobject
li_rc = loo_Req.ConnectToNewObject("Chilkat_9_5_0.HttpRequest")

loo_Req.HttpVerb = "POST"
loo_Req.SendCharset = 1
loo_Req.Charset = "utf-8"
loo_Req.AddHeader("Content-Type","text/xml")
loo_Req.AddHeader("SOAPAction","http://www.peoplevox.net/Authenticate")
loo_Req.Path = "/PEOPLEVOX_CLIENT_ID/resources/integrationservicev4.asmx"
li_Success = loo_Req.LoadBodyFromString(loo_SbSoapXml.GetAsString(),"utf-8")

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")

loo_Http.FollowRedirects = 1

loo_Resp = loo_Http.SynchronousRequest("qac.peoplevox.net",443,1,loo_Req)
if loo_Http.LastMethodSuccess <> 1 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_SbSoapXml
    destroy loo_Crypt
    destroy loo_Req
    destroy loo_Http
    return
end if

// We should expect a 200 response if successful.
if loo_Resp.StatusCode <> 200 then
    Write-Debug "Response StatusCode = " + string(loo_Resp.StatusCode)
    Write-Debug "Response StatusLine: " + loo_Resp.StatusLine
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    destroy loo_SbSoapXml
    destroy loo_Crypt
    destroy loo_Req
    destroy loo_Http
    return
end if

// A successful response returns this XML:

// <?xml version="1.0" encoding="utf-8" ?>
// <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
//     <soap:Body>
//         <AuthenticateResponse xmlns="http://www.peoplevox.net/">
//             <AuthenticateResult>
//                 <ResponseId>0</ResponseId>
//                 <TotalCount>1</TotalCount>
//                 <Detail>PEOPLEVOX_CLIENT_ID,7fe13431-c67f-4d52-bcfd-b60fbfa3b0ca</Detail>
//                 <Statuses />
//                 <ImportingQueueId>0</ImportingQueueId>
//                 <SalesOrdersToDespatchIds />
//             </AuthenticateResult>
//         </AuthenticateResponse>
//     </soap:Body>
// </soap:Envelope>
// 

loo_XmlResponse = create oleobject
li_rc = loo_XmlResponse.ConnectToNewObject("Chilkat_9_5_0.Xml")

li_Success = loo_XmlResponse.LoadXml(loo_Resp.BodyStr)
Write-Debug loo_XmlResponse.GetXml()
destroy loo_Resp

// Show how to get the Detail, which must be the ClientId,SessionId
ls_Detail = loo_XmlResponse.ChilkatPath("soap:Body|AuthenticateResponse|AuthenticateResult|Detail|*")
Write-Debug "Detail = " + ls_Detail


destroy loo_SbSoapXml
destroy loo_Crypt
destroy loo_Req
destroy loo_Http
destroy loo_XmlResponse

 

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