Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Peoplevox GetReportDataDemonstrates how to export data from a Peoplevox Warehouse Management System (WMS) using a system report template.
; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. Local $bSuccess ; 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/GetReportData ; Content-Length: (automatically computed and added by Chilkat) ; Host: qac.peoplevox.net ; ; <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:peop="http://www.peoplevox.net/"> ; <soap:Header> ; <peop:UserSessionCredentials> ; <peop:UserId>PEOPLEVOX_USER_ID</peop:UserId> ; <peop:ClientId>PEOPLEVOX_CLIENT_ID</peop:ClientId> ; <peop:SessionId>PEOPLEVOX_SESSION_ID</peop:SessionId> ; </peop:UserSessionCredentials> ; </soap:Header> ; <soap:Body> ; <peop:GetReportData> ; <peop:getReportRequest> ; <peop:TemplateName>Item movement history</peop:TemplateName> ; <peop:PageNo>1</peop:PageNo> ; <peop:ItemsPerPage>20</peop:ItemsPerPage> ; <peop:OrderBy>[Date timestamp]</peop:OrderBy> ; <peop:Columns>[Item code],[Date timestamp],[From],[To],[Quantity],[Comments]</peop:Columns> ; <peop:SearchClause>([Date timestamp] > DateTime(2016,01,01,09,00,00))</peop:SearchClause> ; </peop:getReportRequest> ; </peop:GetReportData> ; </soap:Body> ; </soap:Envelope> ; ; Notice that a UserId is needed here. This is different than the username required for Peoplevox authentication. ; The UserId for the admin account is 1. ; $oSbSoapXml = ObjCreate("Chilkat.StringBuilder") $oSbSoapXml.Append("<?xml version=""1.0"" encoding=""utf-8""?>" & @CRLF) $oSbSoapXml.Append("<soap:Envelope xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" xmlns:peop=""http://www.peoplevox.net/"">" & @CRLF) $oSbSoapXml.Append(" <soap:Header>" & @CRLF) $oSbSoapXml.Append(" <peop:UserSessionCredentials>" & @CRLF) $oSbSoapXml.Append(" <peop:UserId>PEOPLEVOX_USER_ID</peop:UserId>" & @CRLF) $oSbSoapXml.Append(" <peop:ClientId>PEOPLEVOX_CLIENT_ID</peop:ClientId>" & @CRLF) $oSbSoapXml.Append(" <peop:SessionId>PEOPLEVOX_SESSION_ID</peop:SessionId>" & @CRLF) $oSbSoapXml.Append(" </peop:UserSessionCredentials>" & @CRLF) $oSbSoapXml.Append(" </soap:Header>" & @CRLF) $oSbSoapXml.Append(" <soap:Body>" & @CRLF) $oSbSoapXml.Append(" <peop:GetReportData>" & @CRLF) $oSbSoapXml.Append(" <peop:getReportRequest>" & @CRLF) $oSbSoapXml.Append(" <peop:TemplateName>Item movement history</peop:TemplateName>" & @CRLF) $oSbSoapXml.Append(" <peop:PageNo>1</peop:PageNo>" & @CRLF) $oSbSoapXml.Append(" <peop:ItemsPerPage>20</peop:ItemsPerPage>" & @CRLF) $oSbSoapXml.Append(" <peop:OrderBy>[Date timestamp]</peop:OrderBy>" & @CRLF) $oSbSoapXml.Append(" <peop:Columns>[Item code],[Date timestamp],[From],[To],[Quantity],[Comments]</peop:Columns>" & @CRLF) $oSbSoapXml.Append(" <peop:SearchClause>([Date timestamp] > DateTime(2016,01,01,09,00,00))</peop:SearchClause>" & @CRLF) $oSbSoapXml.Append(" </peop:getReportRequest>" & @CRLF) $oSbSoapXml.Append(" </peop:GetReportData>" & @CRLF) $oSbSoapXml.Append(" </soap:Body>" & @CRLF) $oSbSoapXml.Append("</soap:Envelope>") $oReq = ObjCreate("Chilkat.HttpRequest") $oReq.HttpVerb = "POST" $oReq.SendCharset = True $oReq.Charset = "utf-8" $oReq.AddHeader "Content-Type","text/xml" $oReq.AddHeader "SOAPAction","http://www.peoplevox.net/GetReportData" $oReq.Path = "/PEOPLEVOX_CLIENT_ID/resources/integrationservicev4.asmx" $bSuccess = $oReq.LoadBodyFromString($oSbSoapXml.GetAsString(),"utf-8") $oHttp = ObjCreate("Chilkat.Http") $oHttp.FollowRedirects = True Local $oResp = $oHttp.SynchronousRequest("qac.peoplevox.net",443,True,$oReq) If ($oHttp.LastMethodSuccess <> True) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ; We should expect a 200 response if successful. If ($oResp.StatusCode <> 200) Then ConsoleWrite("Response StatusCode = " & $oResp.StatusCode & @CRLF) ConsoleWrite("Response StatusLine: " & $oResp.StatusLine & @CRLF) ConsoleWrite("Response Header:" & @CRLF) ConsoleWrite($oResp.Header & @CRLF) ConsoleWrite($oResp.BodyStr & @CRLF) Exit EndIf $oXmlResponse = ObjCreate("Chilkat.Xml") $bSuccess = $oXmlResponse.LoadXml($oResp.BodyStr) ConsoleWrite($oXmlResponse.GetXml() & @CRLF) Local $sDetail = $oXmlResponse.ChilkatPath("soap:Body|GetReportDataResponse|GetReportDataResult|Detail|*") $oCsv = ObjCreate("Chilkat.Csv") $oCsv.HasColumnNames = True $oCsv.LoadFromString($sDetail) ConsoleWrite("NumRows = " & $oCsv.NumRows & @CRLF) ConsoleWrite("NumColumns = " & $oCsv.NumColumns & @CRLF) ; Iterate over the rows, getting the ItemCode, Name, and Barcode Local $i = 0 Local $iNumRows = $oCsv.NumRows While $i < $iNumRows ConsoleWrite("Item code: " & $oCsv.GetCellByName($i,"Item code") & @CRLF) ConsoleWrite("Date timestamp: " & $oCsv.GetCellByName($i,"Date timestamp") & @CRLF) ConsoleWrite("From: " & $oCsv.GetCellByName($i,"From") & @CRLF) ConsoleWrite("To: " & $oCsv.GetCellByName($i,"To") & @CRLF) ConsoleWrite("Quantity: " & $oCsv.GetCellByName($i,"Quantity") & @CRLF) ConsoleWrite("Comments: " & $oCsv.GetCellByName($i,"Comments") & @CRLF) ConsoleWrite("-" & @CRLF) $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.