#!/usr/bin/perl -w #Version: 2.0.0.0 #Page: Client.jsp #Copyright (c)2003 eShippers, Inc. #Build Request String Via Key/Value Pairs $requestParameters = "Version=" + "2.0.0.0" + "&ShipmentID=" + "1234" + "&QueryID=" + "YourQueryCode" + "&Username=" + "YourUsername" + "&Password=" + "YourPassword" + "&TotalCarriers=" + "2" + "&CarrierCode1=" + "UPS" + "&CarrierAccount1=" + "123456789" + "&CarrierInvoiced1=" + "1" + "&CarrierCode2=" + "FDX" + "&CarrierAccount2=" + "" + "&CarrierInvoiced2=" + "0" + "&TotalClasses=" + "3" + "&ClassCode1=" + "1DY" + "&ClassCode2=" + "2DY" + "&ClassCode3=" + "GND" + "&DeliveryType=" + "COM" + "&ShipMethod=" + "DRP" + "&OriginationName=" + "John Smith" + "&OriginationAddress1=" + "123 Maple Lane" + "&OriginationAddress2=" + "" + "&OriginationAddress3=" + "" + "&OriginationCity=" + "Phoenix" + "&OriginationState=" + "AZ" + "&OriginationPostal=" + "85345" + "&OriginationCountry=" + "US" + "&DestinationName=" + "Jane Doe" + "&DestinationAddress1=" + "789 Oak Drive" + "&DestinationAddress2=" + "Suite #410" + "&DestinationAddress3=" + "Attention: Sales Department" + "&DestinationCity=" + "Tempe" + "&DestinationState=" + "AZ" + "&DestinationPostal=" + "85282" + "&DestinationCountry=" + "US" + "&Currency=" + "USD" + "&TotalPackages=" + "2" + "&BoxID1=" + "YourBoxCode1" + "&Weight1=" + "10" + "&WeightUnit1=" + "LB" + "&Length1=" + "10" + "&Width1=" + "10" + "&Height1=" + "10" + "&DimensionalUnit1=" + "IN" + "&Packaging1=" + "BOX" + "&Contents1=" + "OTR" + "&Cod1=" + "18500" + "&Insurance1=" + "15000" + "&BoxID2=" + "YourBoxCode2" + "&Weight2=" + "20" + "&WeightUnit2=" + "LB" + "&Length2=" + "20" + "&Width2=" + "20" + "&Height2=" + "20" + "&DimensionalUnit2=" + "IN" + "&Packaging2=" + "BOX" + "&Contents2=" + "OTR" + "&Cod2=" + "0" + "&Insurance2=" + "0" + "&TotalOptions=" + "3" + "&OptionCode1=" + "ADD" + "&OptionCode2=" + "PDD" + "&OptionCode3=" + "SDD"); #Send Query String To Rate Engine use IO::Socket; my $host="www.intershipper.com"; my $getstring="POST /Interface/Intershipper/XML/v2.0/HTTP.jsp HTTP/1.0\r\n $requestParameters\r\n"; my $sock = new IO::Socket::INET(PeerAddr => $host, PeerPort => 80, Proto => 'tcp') or die "couldn't connect"; print $sock "$getstring"; #Read From Buffer Until $sock Is null And Append Socket To $buf my $buf=""; while ($line = <$sock>) { $buf.=$line; } #Close Socket Connection close($sock); #Use Any XML Package To Parse $XMLString $XMLString = $buf; print "Content-type: text/html\012\012"; print "$XMLString";