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
(PowerBuilder) WIN Air Freight - Send New Pouch RequestSends a "POST /api/v1/Awb" to send a new pouch request.
integer li_rc oleobject loo_Http oleobject loo_Xml oleobject loo_Resp oleobject loo_XmlResponse // This example assumes the Chilkat HTTP API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if // Set the "Accept" header to tell the web server that we'll accept an XML response. loo_Http.Accept = "application/xml" // Tell Chilkat to cache any received cookies to files in a particular directory loo_Http.CookieDir = "c:/qa_data/cookies" loo_Http.SaveCookies = 1 // 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. loo_Http.SendCookies = 1 // Build out XML pouch request... loo_Xml = create oleobject // Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0 li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml") loo_Xml.Tag = "PouchDTO" loo_Xml.UpdateChildContent("Mawb|AwbID","") loo_Xml.UpdateChildContent("Mawb|AwbNumber","001-12312123") loo_Xml.UpdateChildContent("Mawb|AwbStatus","D") loo_Xml.UpdateChildContent("Mawb|eAWB","false") loo_Xml.UpdateChildContent("Mawb|WithPaper","false") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|WinID","444444") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|AccountNumber","12345") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Name","AABC SHIPPING & PACKAGING, INC.") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Phone","111-222-3334") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Fax","222-111-3334") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Email","") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|Line1","500 HARBOR DRIVE") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|Line2","SUITE B1211") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|Place","BEAUFORT") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|PostalCode","28516") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|StateProvince","NC") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|Country|Code","US") loo_Xml.UpdateChildContent("Mawb|Parties|Shipper|Address|Country|Name","U.S.A.") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|WinID","0") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|AccountNumber","") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Name","DELTA MANUFACTURING") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Phone","444-555-3333") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Fax","") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Email","") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|Line1","185 RUE LAMANDE") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|Line2","") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|Place","PARIS") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|PostalCode","75017") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|StateProvince","") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|Country|Code","FR") loo_Xml.UpdateChildContent("Mawb|Parties|Consignee|Address|Country|Name","FRANCE") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|WinID","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|AccountNumber","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Name","AABC SHIPPING, INC.") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Phone","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Fax","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Email","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|Line1","110 FARA WAY") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|Line2","") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|Place","OZ") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|PostalCode","11222") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|StateProvince","NY") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|Country|Code","US") loo_Xml.UpdateChildContent("Mawb|Parties|Notify|Address|Country|Name","U.S.A.") loo_Xml.UpdateChildContent("Mawb|Parties|Agent|WinID","") loo_Xml.UpdateChildContent("Mawb|Parties|Agent|AccountNumber","FACCT#1234") loo_Xml.UpdateChildContent("Mawb|Accounting|Identifier","GEN") loo_Xml.UpdateChildContent("Mawb|Accounting|Information","SARFWER") loo_Xml.UpdateChildContent("Mawb|Accounting|Identifier","MCO") loo_Xml.UpdateChildContent("Mawb|Accounting|Information","WERWERWER") loo_Xml.UpdateChildContent("Mawb|ShipmentReference|ReferenceNumber","ZDFASF") loo_Xml.UpdateChildContent("Mawb|ShipmentReference|AdditionalInformation","ZDFASF") loo_Xml.UpdateChildContent("Mawb|RoutingDetails|FromAirportCode","EWN") loo_Xml.UpdateChildContent("Mawb|RoutingDetails|ToAirportCode","LON") loo_Xml.UpdateChildContent("Mawb|RoutingDetails|CarrierCode","AA") loo_Xml.UpdateChildContent("Mawb|RoutingDetails|FlightNumber","N123") loo_Xml.UpdateChildContent("Mawb|RoutingDetails|FlightDate","2016-11-30T00:00:00") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|CurrencyCode","USD") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|ChargeCode","PP") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|WeightOrValuation","P") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|Other","P") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|ValuesForCarriage","1300.00") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|ValuesForCustoms","12000.00") loo_Xml.UpdateChildContent("Mawb|ChargesDeclaration|ValuesForInsurance","11000.00") loo_Xml.UpdateChildContent("Mawb|Handling|SpecialServiceInformation","Please Notify Consigneetestwwwww") loo_Xml.UpdateChildContent("Mawb|Handling|OtherServiceInformation","") loo_Xml.UpdateChildContent("Mawb|Handling|SCI","") loo_Xml.UpdateChildContent("Mawb|Handling|SpecialHandling|Code","AOG") loo_Xml.UpdateChildContent("Mawb|Handling|SpecialHandling|Code","ATT") loo_Xml.UpdateChildContent("Mawb|Rates|NumberOfPieces","12") loo_Xml.UpdateChildContent("Mawb|Rates|GrossWeight|Value","244.70") loo_Xml.UpdateChildContent("Mawb|Rates|GrossWeight|UOM","L") loo_Xml.UpdateChildContent("Mawb|Rates|SLAC","12") loo_Xml.UpdateChildContent("Mawb|Rates|RateClassCode","N") loo_Xml.UpdateChildContent("Mawb|Rates|CommodityItemNumber","") loo_Xml.UpdateChildContent("Mawb|Rates|ChargeableWeight","245.0") loo_Xml.UpdateChildContent("Mawb|Rates|RateOrCharge","8.00") loo_Xml.UpdateChildContent("Mawb|Rates|ChargeAmount","1960.00") loo_Xml.UpdateChildContent("Mawb|Rates|NatureAndQuantityOfGoods","CONSOLIDATION PER ATTACHED MANIFEST.") loo_Xml.UpdateChildContent("Mawb|Rates|Dims|Pcs","12") loo_Xml.UpdateChildContent("Mawb|Rates|Dims|Length","4") loo_Xml.UpdateChildContent("Mawb|Rates|Dims|Width","8") loo_Xml.UpdateChildContent("Mawb|Rates|Dims|Height","4") loo_Xml.UpdateChildContent("Mawb|Rates|Dims|UOM","CMT") loo_Xml.UpdateChildContent("Mawb|ChargesSummary|WeightCharge","1960.00") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Description","AW") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Amount","123.00") loo_Xml.UpdateChildContent("Mawb|OtherCharges|ChargeIdentifier","C") loo_Xml.UpdateChildContent("Mawb|OtherCharges|PrepaidCollect","C") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Description","FC") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Amount","55.00") loo_Xml.UpdateChildContent("Mawb|OtherCharges|ChargeIdentifier","A") loo_Xml.UpdateChildContent("Mawb|OtherCharges|PrepaidCollect","P") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Description","FC") loo_Xml.UpdateChildContent("Mawb|OtherCharges|Amount","101.00") loo_Xml.UpdateChildContent("Mawb|OtherCharges|ChargeIdentifier","C") loo_Xml.UpdateChildContent("Mawb|OtherCharges|PrepaidCollect","C") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Name","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Email","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Name","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Email","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Name","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Email","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Name","") loo_Xml.UpdateChildContent("Mawb|EmailNotifications|Email","") loo_Xml.UpdateChildContent("Mawb|Execution|Date","2015-08-07T00:00:00") loo_Xml.UpdateChildContent("Mawb|Execution|Place","OZ NY") loo_Xml.UpdateChildContent("Mawb|Execution|ShipperSignature","OAS FREIGHT FORWARDE") loo_Xml.UpdateChildContent("Mawb|Execution|CarrierSignature","OAS FREIGHT FORWARDE") loo_Xml.UpdateChildContent("Hawbs|AwbNumber","001-12312123") loo_Xml.UpdateChildContent("Hawbs|HawbNumber","CGL201107-27") loo_Xml.UpdateChildContent("Hawbs|HawbStatus","D") loo_Xml.UpdateChildContent("Hawbs|NumberOfPieces","12") loo_Xml.UpdateChildContent("Hawbs|GrossWeight|Value","244.70") loo_Xml.UpdateChildContent("Hawbs|GrossWeight|UOM","K") loo_Xml.UpdateChildContent("Hawbs|Locations|PortOfOrigin|Code","EWN") loo_Xml.UpdateChildContent("Hawbs|Locations|PortOfDestination|Code","LON") loo_Xml.UpdateChildContent("Hawbs|Commodity","HWB #: CGL20110") loo_Xml.UpdateChildContent("Hawbs|SLAC","12") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Name","ABC SHIPPNG AGAIN") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Phone","111-222-3333") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Fax","") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Email","") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Address|Line1","100 MAIN STREET") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Address|Place","OZ") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Address|PostalCode","ZIP") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Address|StateProvince","NY") loo_Xml.UpdateChildContent("Hawbs|Parties|Shipper|Address|Country|Code","US") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Name","AABC SHIPPING & PACKAGING, INC.") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Phone","111-222-3334") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Fax","222-111-3334") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Email","") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Address|Line1","500 HARBOR DRIVE") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Address|Place","BEAUFORT") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Address|PostalCode","28516") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Address|StateProvince","NC") loo_Xml.UpdateChildContent("Hawbs|Parties|Consignee|Address|Country|Code","US") loo_Xml.EmitXmlDecl = 0 loo_Resp = loo_Http.PText("POST","http://integration.winwebconnect.com/api/v1/Awb",loo_Xml.GetXml(),"utf-8","application/xml",0,0) if loo_Http.LastMethodSuccess <> 1 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Xml return end if loo_XmlResponse = create oleobject // Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0 li_rc = loo_XmlResponse.ConnectToNewObject("Chilkat.Xml") loo_XmlResponse.LoadXml(loo_Resp.BodyStr) // See below for an example XML response body. Write-Debug "Response Body:" Write-Debug loo_XmlResponse.GetXml() Write-Debug "---" Write-Debug "Response Header:" Write-Debug loo_Resp.Header destroy loo_Resp Write-Debug "Success." destroy loo_Http destroy loo_Xml destroy loo_XmlResponse |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.