Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

DataFlex Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
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
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(DataFlex) WIN Air Freight - Send New Pouch Request

Sends a "POST /api/v1/Awb" to send a new pouch request.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Handle hoXml
    Variant vResp
    Handle hoResp
    Handle hoXmlResponse
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Set the "Accept" header to tell the web server that we'll accept an XML response.
    Set ComAccept Of hoHttp To "application/xml"

    // Tell Chilkat to cache any received cookies to files in a particular directory
    Set ComCookieDir Of hoHttp To "c:/qa_data/cookies"
    Set ComSaveCookies Of hoHttp To True

    // Also tell Chilkat to load and send matching cookies from the CookieDir.
    // The authToken cookie is first obtained in the login request. Each subsequent
    // request sends the authToken cookie and saves the new authToken cookie to the CookieDir.
    Set ComSendCookies Of hoHttp To True

    // Build out XML pouch request...
    Get Create (RefClass(cComChilkatXml)) To hoXml
    If (Not(IsComObjectCreated(hoXml))) Begin
        Send CreateComObject of hoXml
    End
    Set ComTag Of hoXml To "PouchDTO"
    Send ComUpdateChildContent To hoXml "Mawb|AwbID" ""
    Send ComUpdateChildContent To hoXml "Mawb|AwbNumber" "001-12312123"
    Send ComUpdateChildContent To hoXml "Mawb|AwbStatus" "D"
    Send ComUpdateChildContent To hoXml "Mawb|eAWB" "false"
    Send ComUpdateChildContent To hoXml "Mawb|WithPaper" "false"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|WinID" "444444"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|AccountNumber" "12345"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Name" "AABC SHIPPING & PACKAGING, INC."
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Phone" "111-222-3334"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Fax" "222-111-3334"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|Line1" "500 HARBOR DRIVE"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|Line2" "SUITE B1211"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|Place" "BEAUFORT"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|PostalCode" "28516"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|StateProvince" "NC"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|Country|Code" "US"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Shipper|Address|Country|Name" "U.S.A."
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|WinID" "0"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|AccountNumber" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Name" "DELTA MANUFACTURING"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Phone" "444-555-3333"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Fax" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|Line1" "185 RUE LAMANDE"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|Line2" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|Place" "PARIS"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|PostalCode" "75017"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|StateProvince" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|Country|Code" "FR"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Consignee|Address|Country|Name" "FRANCE"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|WinID" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|AccountNumber" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Name" "AABC SHIPPING, INC."
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Phone" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Fax" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|Line1" "110 FARA WAY"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|Line2" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|Place" "OZ"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|PostalCode" "11222"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|StateProvince" "NY"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|Country|Code" "US"
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Notify|Address|Country|Name" "U.S.A."
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Agent|WinID" ""
    Send ComUpdateChildContent To hoXml "Mawb|Parties|Agent|AccountNumber" "FACCT#1234"
    Send ComUpdateChildContent To hoXml "Mawb|Accounting|Identifier" "GEN"
    Send ComUpdateChildContent To hoXml "Mawb|Accounting|Information" "SARFWER"
    Send ComUpdateChildContent To hoXml "Mawb|Accounting|Identifier" "MCO"
    Send ComUpdateChildContent To hoXml "Mawb|Accounting|Information" "WERWERWER"
    Send ComUpdateChildContent To hoXml "Mawb|ShipmentReference|ReferenceNumber" "ZDFASF"
    Send ComUpdateChildContent To hoXml "Mawb|ShipmentReference|AdditionalInformation" "ZDFASF"
    Send ComUpdateChildContent To hoXml "Mawb|RoutingDetails|FromAirportCode" "EWN"
    Send ComUpdateChildContent To hoXml "Mawb|RoutingDetails|ToAirportCode" "LON"
    Send ComUpdateChildContent To hoXml "Mawb|RoutingDetails|CarrierCode" "AA"
    Send ComUpdateChildContent To hoXml "Mawb|RoutingDetails|FlightNumber" "N123"
    Send ComUpdateChildContent To hoXml "Mawb|RoutingDetails|FlightDate" "2016-11-30T00:00:00"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|CurrencyCode" "USD"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|ChargeCode" "PP"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|WeightOrValuation" "P"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|Other" "P"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|ValuesForCarriage" "1300.00"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|ValuesForCustoms" "12000.00"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesDeclaration|ValuesForInsurance" "11000.00"
    Send ComUpdateChildContent To hoXml "Mawb|Handling|SpecialServiceInformation" "Please Notify Consigneetestwwwww"
    Send ComUpdateChildContent To hoXml "Mawb|Handling|OtherServiceInformation" ""
    Send ComUpdateChildContent To hoXml "Mawb|Handling|SCI" ""
    Send ComUpdateChildContent To hoXml "Mawb|Handling|SpecialHandling|Code" "AOG"
    Send ComUpdateChildContent To hoXml "Mawb|Handling|SpecialHandling|Code" "ATT"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|NumberOfPieces" "12"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|GrossWeight|Value" "244.70"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|GrossWeight|UOM" "L"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|SLAC" "12"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|RateClassCode" "N"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|CommodityItemNumber" ""
    Send ComUpdateChildContent To hoXml "Mawb|Rates|ChargeableWeight" "245.0"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|RateOrCharge" "8.00"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|ChargeAmount" "1960.00"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|NatureAndQuantityOfGoods" "CONSOLIDATION PER ATTACHED MANIFEST."
    Send ComUpdateChildContent To hoXml "Mawb|Rates|Dims|Pcs" "12"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|Dims|Length" "4"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|Dims|Width" "8"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|Dims|Height" "4"
    Send ComUpdateChildContent To hoXml "Mawb|Rates|Dims|UOM" "CMT"
    Send ComUpdateChildContent To hoXml "Mawb|ChargesSummary|WeightCharge" "1960.00"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Description" "AW"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Amount" "123.00"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|ChargeIdentifier" "C"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|PrepaidCollect" "C"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Description" "FC"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Amount" "55.00"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|ChargeIdentifier" "A"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|PrepaidCollect" "P"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Description" "FC"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|Amount" "101.00"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|ChargeIdentifier" "C"
    Send ComUpdateChildContent To hoXml "Mawb|OtherCharges|PrepaidCollect" "C"
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Name" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Name" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Name" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Name" ""
    Send ComUpdateChildContent To hoXml "Mawb|EmailNotifications|Email" ""
    Send ComUpdateChildContent To hoXml "Mawb|Execution|Date" "2015-08-07T00:00:00"
    Send ComUpdateChildContent To hoXml "Mawb|Execution|Place" "OZ NY"
    Send ComUpdateChildContent To hoXml "Mawb|Execution|ShipperSignature" "OAS FREIGHT FORWARDE"
    Send ComUpdateChildContent To hoXml "Mawb|Execution|CarrierSignature" "OAS FREIGHT FORWARDE"
    Send ComUpdateChildContent To hoXml "Hawbs|AwbNumber" "001-12312123"
    Send ComUpdateChildContent To hoXml "Hawbs|HawbNumber" "CGL201107-27"
    Send ComUpdateChildContent To hoXml "Hawbs|HawbStatus" "D"
    Send ComUpdateChildContent To hoXml "Hawbs|NumberOfPieces" "12"
    Send ComUpdateChildContent To hoXml "Hawbs|GrossWeight|Value" "244.70"
    Send ComUpdateChildContent To hoXml "Hawbs|GrossWeight|UOM" "K"
    Send ComUpdateChildContent To hoXml "Hawbs|Locations|PortOfOrigin|Code" "EWN"
    Send ComUpdateChildContent To hoXml "Hawbs|Locations|PortOfDestination|Code" "LON"
    Send ComUpdateChildContent To hoXml "Hawbs|Commodity" "HWB #: CGL20110"
    Send ComUpdateChildContent To hoXml "Hawbs|SLAC" "12"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Name" "ABC SHIPPNG AGAIN"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Phone" "111-222-3333"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Fax" ""
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Email" ""
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Address|Line1" "100 MAIN STREET"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Address|Place" "OZ"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Address|PostalCode" "ZIP"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Address|StateProvince" "NY"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Shipper|Address|Country|Code" "US"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Name" "AABC SHIPPING & PACKAGING, INC."
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Phone" "111-222-3334"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Fax" "222-111-3334"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Email" ""
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Address|Line1" "500 HARBOR DRIVE"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Address|Place" "BEAUFORT"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Address|PostalCode" "28516"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Address|StateProvince" "NC"
    Send ComUpdateChildContent To hoXml "Hawbs|Parties|Consignee|Address|Country|Code" "US"
    Set ComEmitXmlDecl Of hoXml To False

    Get ComGetXml Of hoXml To sTemp1
    Get ComPText Of hoHttp "POST" "http://integration.winwebconnect.com/api/v1/Awb" sTemp1 "utf-8" "application/xml" False False To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 <> True) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatXml)) To hoXmlResponse
    If (Not(IsComObjectCreated(hoXmlResponse))) Begin
        Send CreateComObject of hoXmlResponse
    End
    Get ComBodyStr Of hoResp To sTemp1
    Get ComLoadXml Of hoXmlResponse sTemp1 To iSuccess

    // See below for an example XML response body.
    Showln "Response Body:"
    Get ComGetXml Of hoXmlResponse To sTemp1
    Showln sTemp1
    Showln "---"

    Showln "Response Header:"
    Get ComHeader Of hoResp To sTemp1
    Showln sTemp1

    Send Destroy of hoResp
    Showln "Success."


End_Procedure

 

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