[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: FedEx Rate Shopping



Matt, 
     Attached is our source code to call the Fedex Web Service, I hope this helps. 

Naresh  

Naresh Mistry | TM Architect | Nulogx Inc. | 5090 Explorer Dr, Suite 203, Mississauga, ON L4W 4T9 | T: 905-486-1162 x 238 | F: 905-267-3164 | C: 416-820-5231
www.nulogx.com | Transportation Management Solutions | www.cgfi.ca | Canadian General Freight Index - Register Today



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Matt Carey
Sent: Monday, May 07, 2012 1:46 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: FedEx Rate Shopping

Hello All,

I'm an RPG III & IV old timer and haven't used much ILE yet.  I am, however, using RPG IV, free, and embedded SQL.  I would like to replace our in-house freight calculation programs and start using Scott's HTTPAPI to connect to FedEx's web service to obtain shipping rates.  I have signed up for FedEx's developer's resource center and downloaded Scott's HTTPAPI.  To get a jumpstart, I was wondering if anyone would be willing to share some source code that they have developed for FedEx's rate services?

Thanks,

Matt

 

ÿþ 

    

   3800      H DFTACTGRP(*NO) BNDDIR('HTTPAPI')                                                                         09/23/06

   3900                                                                                                                 09/23/06

   4101      FOSPSWSH   IF   e           k disk                                                                         02/22/11

   4200       * Shipment Web Service Header                                                                             02/22/11

   4201                                                                                                                 02/22/11

   4202      FOSPSWSD   IF   e           k disk                                                                         02/22/11

   4203       * Shipment Web Service Detail                                                                             02/22/11

   4204                                                                                                                 02/22/11

   4205      FOSLSWSDB  IF   e           k disk    RENAME(RPSWSD:RLSWSDB)                                               02/25/11

   4206       * Shipment Web Service Detail Logical Key = WDWSCD,WDELEM                                                 02/25/11

   4207                                                                                                                 02/25/11

   4208      FSMPRATE   UF   e           k disk                                                                         02/22/11

   4209       * External Rate File                                                                                      02/22/11

   4210                                                                                                                 02/22/11

   4211      FSMLRATE1  UF   e           k disk    RENAME(RPRATE:RLRATE1)                                               02/25/11

   4212       * External Rate File Logical Key = RESHP#,REATR,RECHR,REPCE#                                              02/25/11

   4213                                                                                                                 02/25/11

   4214      FSMPWAYB   IF   e           k disk                                                                         02/22/11

   4215       * A/P shipment control file                                                                               02/22/11

   4216                                                                                                                 02/22/11

   4220      FSMLRATI4  UF   e           k disk                                                                         03/01/11

   4221       * Rating Interface File                                                                                   03/01/11

   4222                                                                                                                 02/28/11

   4300       /copy qrpglesrc,httpapi_h                                                                                 09/23/06

   4301                                                                                                                 02/22/11

   4400      D #A1110        E DS                  ExtName(OSA1110)                                                     02/22/11

   4401      D packageOption   s             40    Dim(4) PERRCD(1) CTDATA                                              04/20/11

   4402       * ---------------------------------------------------------------                                         04/07/11

   4403       *                    Main Program Prototyp                                                                04/07/11

   4404       * ---------------------------------------------------------------                                         04/07/11

   4406      D Main            PR                   ExtPgm('OSR119FX')                                                  02/22/11

   4407      D                               12                                                                         02/17/11

   4408      D                                2                                                                         02/17/11

   4409      D                                4                                                                         02/17/11

   4410      D @A1110                               LikeDS(#A1110)                                                      02/17/11

   4411 60103D                                1                                                                         03/18/11

   4412 60103D                               11  2                                                                      03/18/11

   4413      D                                1                                                                         03/18/11

   4414      D                               64                                                                         04/11/11

   4415       * ---------------------------------------------------------------                                         04/07/11

   4416       *                       Main Procedure Interface                                                          04/07/11

   4417       * ---------------------------------------------------------------                                         04/07/11

   4418      D Main            PI                                                                                       02/17/11

   4419      D p0shp#                        12                                                                         02/17/11

   4420      D p0wscd                         2                                                                         02/18/11

   4421      d p0srv                          4                                                                         02/18/11

   4422      d p01110                               LikeDS(#A1110)                                                      02/17/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    3

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

   4423 60103d p0mode                         1                                                                         03/18/11

   4424 60103d p0Chr$                               Like(richr$)                                                        03/18/11

   4425      d p0rtncd                        1                                                                         02/18/11

   4426      d p0msgtxt                      64                                                                         04/11/11

   4427       * ---------------------------------------------------------------                                         04/07/11

   4428       *           Prototype definiton for StartOfElement Procedure                                              04/07/11

   4429       * ---------------------------------------------------------------                                         04/07/11

   4500      D StartOfElement  PR                                                                                       09/23/06

   4600      D   UserData                      *   value                                                                09/23/06

   4700      D   depth                       10I 0 value                                                                09/23/06

   4800      D   name                      1024A   varying const                                                        09/23/06

   4900      D   path                     24576A   varying const                                                        09/23/06

   5000      D   attrs                         *   dim(32767)                                                           09/23/06

   5100      D                                     const options(*varsize)                                              09/23/06

   5101       * ---------------------------------------------------------------                                         04/07/11

   5102       *           Prototype definiton for EndOfElement Procedure                                                04/07/11

   5103       * ---------------------------------------------------------------                                         04/07/11

   5200      D EndOfElement    PR                                                                                       09/23/06

   5300      D   UserData                      *   value                                                                09/23/06

   5400      D   depth                       10I 0 value                                                                09/23/06

   5500      D   name                      1024A   varying const                                                        09/23/06

   5600      D   path                     24576A   varying const                                                        09/23/06

   5700      D   value                    65535A   varying const                                                        09/12/07

   5800      D   attrs                         *   dim(32767)                                                           09/23/06

   5900      D                                     const options(*varsize)                                              09/23/06

   5901       * ---------------------------------------------------------------                                         04/07/11

   5902       *           Array Definition for Surcharge                                                                04/07/11

   5903       * ---------------------------------------------------------------                                         04/07/11

   7902      d SCount          s             10I 0                                                                      02/22/11

   7906      d surcharge       ds                  qualified                                                            02/24/11

   7907      d   array1                            dim(200)                                                             03/31/11

   7908      d   sid                          4  0 overlay(array1)                                                      04/05/11

   7909      d   stype                       40A   overlay(array1:*next)                                                04/05/11

   7910      d   sAmount                     15A   overlay(array1:*next)                                                02/24/11

   8001       * ---------------------------------------------------------------                                         04/07/11

   8002       *           Array Definition for Base Charge                                                              04/07/11

   8003       * ---------------------------------------------------------------                                         04/07/11

   8004      d PCount          s             10I 0                                                                      02/22/11

   8006      d package         ds                  qualified                                                            02/24/11

   8007      d   array2                            dim(200)                                                             03/31/11

   8008      d   pId                          4A   overlay(array2)                                                      02/24/11

   8009      d   pAmount                     15A   overlay(array2:*next)                                                02/24/11

   8010       * ---------------------------------------------------------------                                         04/07/11

   8011       *                      Misc. Variable                                                                     04/07/11

   8012       * ---------------------------------------------------------------                                         04/07/11

   8014      d tCount          s              1  0                                                                      04/07/11

   8018      D @Counter        s              3  0 Inz(0)                                                               02/22/11

   8019      D @n              s              3  0 Inz(0)                                                               02/25/11

   8020      D @ErrFlag        s               n   Inz(*Off)                                                            02/22/11

   8021      D @ErrWeb         s               n   Inz(*Off)                                                            04/07/11

   8100      D rc              s             10I 0                                                                      09/23/06

   8200      D postData        s          65535A   varying                                                              03/31/11

   8201      D postDataH       s           5000A   varying                                                              02/22/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    4

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

   8202      D postDataB       s          55000A   varying                                                              03/31/11

   8203      D postDataE       s            100A   varying                                                              02/22/11

   8204      D postDataF       s          20000A   varying                                                              04/20/11

   8205      D @FStreet        s             43A   varying                                                              02/23/11

   8206      D @TStreet        s             43A   varying                                                              02/23/11

   8207      D @FGrd           s               n   Inz(*Off)                                                            02/22/11

   8208      D @pId            s                   Like(repce#)                                                         02/25/11

   8209      D @v              s                   Like(whrvrs)                                                         03/15/11

   8210      D pstr1           s            500A                                                                        02/25/11

   8211      D pstr2           s            500A                                                                        02/25/11

   8212      D pstr3           s            500A                                                                        02/25/11

   8213      D pstr4           s            500A                                                                        02/25/11

   8214      D pstr5           s            500A                                                                        02/25/11

   8215      D pstr6           s            500A                                                                        02/25/11

   8216      D pstr7           s            500A                                                                        04/07/11

   8217      D pstr8           s            500A                                                                        04/07/11

   8218      D pstr9           s            500A                                                                        04/07/11

   8219      D pstrS           s            100A                                                                        03/04/11

   8302      D @cTotal         s                   Like(richr$)                                                         03/18/11

   8303      d @svpce#         s                   Like(repce#)                                                         03/30/11

   8305      d @TotPcs         s                   Like(reocr)                                                          04/05/11

   8306      d @packSpService  s               n   Inz(*off)                                                            04/20/11

   8307      d @pOptArray      s              2  0                                                                      04/20/11

   8308 60101D @cnctyp         s              1A                                                                        05/25/11

   8309                                                                                                                 04/06/11

   8310       * ---------------------------------------------------------------                                         04/07/11

   8311       * System Data Structre                                                                                    02/17/11

   8312       * ---------------------------------------------------------------                                         04/07/11

   8313      D                SDS                                                                                       02/17/11

   8314      D @ProgName         *Proc                                                                                  02/17/11

   8315      D @ParmCount        *Parms                                                                                 02/17/11

   8316      D @StatusCode       *Status                                                                                02/17/11

   8317      D @Routine          *Routine                                                                               02/17/11

   8318      D @LibName               81     90                                                                         02/17/11

   8319      D @JobName              244    253                                                                         02/17/11

   8320      D @UserID               254    263                                                                         02/17/11

   8321      D JobNumber             264    269                                                                         02/17/11

   8322                                                                                                                 02/17/11

   8700                                                                                                                 09/23/06

   8800       /free                                                                                                     09/23/06

  10300                                                                                                                 09/23/06

  10301        //------------------------------------------------------------//                                         04/07/11

  10302        //            M A I N    C O D E   S E C T I O N              //                                         04/07/11

  10303        //------------------------------------------------------------//                                         04/07/11

  10304                                                                                                                 04/06/11

  10305          http_debug(*ON);                                                                                       02/23/11

  10306          @ErrFlag = *Off;                                                                                       03/04/11

  10307          @ErrWeb  = *Off;                                                                                       04/07/11

  10308          clear package;                                                                                         04/06/11

  10309          clear surcharge;                                                                                       04/06/11

  10310          pCount = 0;                                                                                            04/06/11

  10311          sCount = 0;                                                                                            04/06/11

  10313                                                                                                                 04/05/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    5

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10314          //Validate External Engine Code and get Version #                                                      04/06/11

  10315          //-----------------------------------------------------------/                                         04/07/11

  10316                                                                                                                 04/06/11

  10317          Chain (p0wscd) ospswsh;                                                                                04/05/11

  10318          If not%Found(ospswsh);                                                                                 04/05/11

  10319            @ErrFlag = *On;                                                                                      04/05/11

  10320          Else;                                                                                                  04/05/11

  10321            @v = whrvrs;                                                                                         04/05/11

  10322          EndIf;                                                                                                 04/05/11

  10323                                                                                                                 04/06/11

  10324          //Validate Service Type and determine if FEDEX Ground                                                  04/06/11

  10325          //-----------------------------------------------------------/                                         04/07/11

  10326                                                                                                                 04/06/11

  10327          If @ErrFlag = *Off;                                                                                    04/05/11

  10328            Chain (p0wscd:'1':p0Srv) ospswsd;                                                                    04/05/11

  10329            If not%Found(ospswsd);                                                                               04/05/11

  10330              @ErrFlag = *On;                                                                                    04/05/11

  10331            Else;                                                                                                04/05/11

  10332              If wdelem = 'FEDEX_GROUND';                                                                        04/05/11

  10333                @FGrd = *On;                                                                                     04/05/11

  10334              Else;                                                                                              04/05/11

  10335                @FGrd = *Off;                                                                                    04/05/11

  10336              EndIf;                                                                                             04/05/11

  10337            EndIf;                                                                                               04/05/11

  10338          EndIf;                                                                                                 04/05/11

  10339                                                                                                                 04/06/11

  10340          //Call web Service                                                                                     04/06/11

  10341          //-----------------------------------------------------------/                                         04/07/11

  10343                                                                                                                 04/05/11

  10344          If @ErrFlag = *Off;                                                                                    04/05/11

  10345                                                                                                                 04/06/11

  10346          //FEDEX Ground Only (Single Call to Web Service)                                                       04/06/11

  10347          //-----------------------------------------------------------/                                         04/07/11

  10348            If @FGrd = *On;                                                                                      04/05/11

  10349              ExSr sbCrtXmlStr;                                                                                  04/05/11

  10350              If @ErrFlag = *Off;                                                                                04/05/11

  10351                ExSr sbCallWebSrv;                                                                               04/05/11

  10352              EndIf;                                                                                             04/05/11

  10353                                                                                                                 04/06/11

  10354          //Non FEDEX Ground (Multiple Calls to Web Service)                                                     04/06/11

  10355          //-----------------------------------------------------------/                                         04/07/11

  10356            Else;                                                                                                04/05/11

  10357              @Counter = 1;                                                                                      04/06/11

  10358              SetLL (p0shp#:'2':whbase) smprate;                                                                 04/05/11

  10359              DoU %Eof(Smprate);                                                                                 04/05/11

  10360                ReadE(n) (p0Shp#:'2':whbase) smprate;                                                            04/05/11

  10361                If Not %Eof(smprate);                                                                            04/05/11

  10362                  @svpce# = repce#;                                                                              04/06/11

  10363                  Chain (p0wscd:'1':p0Srv) ospswsd;                                                              04/06/11

  10364                  If %Found(ospswsd);                                                                            04/06/11

  10365                    ExSr sbCrtXmlStr;                                                                            04/06/11

  10366                    If @ErrFlag = *Off;                                                                          04/06/11

  10367                      pCount += 1;                                                                               04/06/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    6

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10368                      tCount  = 0;                                                                               04/07/11

  10369                      ExSr sbCallWebSrv;                                                                         04/06/11

  10370                    Else;                                                                                        04/06/11

  10371                      Leave;                                                                                     04/06/11

  10372                    EndIf;                                                                                       04/06/11

  10373                  Else;                                                                                          04/06/11

  10374                    @ErrFlag = *On;                                                                              04/06/11

  10375                    Leave;                                                                                       04/06/11

  10376                  EndIf;                                                                                         04/06/11

  10377                EndIf;                                                                                           04/06/11

  10378              EndDo;                                                                                             04/05/11

  10379            EndIf;                                                                                               04/05/11

  10380                                                                                                                 04/06/11

  10381          EndIf;                                                                                                 04/05/11

  10382                                                                                                                 04/05/11

  10383                                                                                                                 04/06/11

  10384          //Update RATE and RATI files                                                                           04/06/11

  10385          //-----------------------------------------------------------/                                         04/07/11

  10386          If @ErrFlag = *Off;                                                                                    03/03/11

  10387            ExSr sbUpdRateFile;                                                                                  03/03/11

  10388          EndIf;                                                                                                 03/03/11

  10389                                                                                                                 03/03/11

  10390                                                                                                                 04/06/11

  10391          //Error Handling                                                                                       04/06/11

  10392          //-----------------------------------------------------------/                                         04/07/11

  10393          If @ErrFlag = *On;                                                                                     03/01/11

  10394            p0rtncd = 'E';                                                                                       03/28/11

  10395            If @Errweb = *On;                      //Special Error                                               04/07/11

  10396              p0rtncd = 'W';                                                                                     04/07/11

  10397            Endif;                                                                                               04/07/11

  10398          EndIf;                                                                                                 03/01/11

  10399                                                                                                                 03/01/11

  10400          *inlr = *ON;                                                                                           02/18/11

  10401        //---------------- End of Main -------------------------------//                                         04/07/11

  10402                                                                                                                 02/18/11

  10403        //------------------------------------------------------------//                                         04/07/11

  10404        //            Subroutine - CrtXmlString                       //                                         04/07/11

  10405        //------------------------------------------------------------//                                         04/07/11

  10406          BegSr sbCrtXmlStr;                                                                                     02/18/11

  10407                                                                                                                 02/18/11

  10503         //Get the address Line                                                                                  04/07/11

  10504         //------------------------------------------------------------/                                         04/07/11

  10505            Chain (p01110.zpdiv:p01110.zpwhs:p0Shp#:'80':1.00) smpwayb;                                          02/22/11

  10506            If %Found(smpwayb);                                                                                  02/22/11

  10507              If wbfbku <> *Blanks;                                                                              04/08/11

  10508               @FStreet = %Trim(wbfbku)+'-'+%char(wbfblk)+' '+ %Trim(wbfad1);                                    02/23/11

  10509              Else;                                                                                              04/08/11

  10510               @FStreet =  %char(wbfblk) + ' ' + %Trim(wbfad1);                                                  04/08/11

  10511              EndIf;                                                                                             04/08/11

  10512              If wbtbku <> *Blanks;                                                                              04/08/11

  10513               @TStreet = %Trim(wbtbku)+'-'+%char(wbtblk)+' '+ %Trim(wbtad1);                                    02/23/11

  10514              Else;                                                                                              04/08/11

  10515               @TStreet = %char(wbtblk) + ' ' + %Trim(wbtad1);                                                   04/08/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    7

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10516              EndIf;                                                                                             04/08/11

  10517            EndIf;                                                                                               02/22/11

  10518                                                                                                                 05/25/11

  10519 60101   //  Residential or Commercial address (set boolean value)                                               05/26/11

  10520 60101      If p01110.zpctyp = 'C';                                                                              05/25/11

  10521 60101         @cnctyp = '0';                                                                                    05/25/11

  10522 60101      else;                                                                                                05/25/11

  10523 60101         @cnctyp = '1';                                                                                    05/25/11

  10524 60101      endif;                                                                                               05/25/11

  10525                                                                                                                 05/25/11

  10526         //            X M L  H E A D E R                                                                        04/07/11

  10527         //------------------------------------------------------------/                                         04/07/11

  10528                                                                                                                 02/18/11

  10600            postDataH = %trimr(WHXMLH)                                 +                                         02/18/11

  10601            '<soap:Body>'                                              +                                         02/23/11

  10602            '<RateRequest xmlns="'+ %Trim(WHRSU1) + '">'               +                                         02/23/11

  10604            '<WebAuthenticationDetail>'                                +                                         02/24/11

  10605            '<UserCredential>'                                         +                                         02/18/11

  10606            '<Key>'+%trim(WHUKEY)+'</Key>'                             +                                         02/18/11

  10607            '<Password>'+%trim(WHPWD)+'</Password>'                    +                                         02/18/11

  10608            '</UserCredential></WebAuthenticationDetail>'              +                                         02/18/11

  10609            '<ClientDetail>'                                           +                                         02/18/11

  10610            '<AccountNumber>'+%Trim(WHCACC)+'</AccountNumber>'         +                                         02/18/11

  10611            '<MeterNumber>'+%Trim(WHCMTR)+'</MeterNumber>'             +                                         02/18/11

  10612            '</ClientDetail>';                                                                                   02/18/11

  10613                                                                                                                 02/18/11

  10615         //      X M L  B O D Y                                                                                  04/07/11

  10616         //-----------------------------------------------------------//                                         04/07/11

  10617            postDataB = '<TransactionDetail>'                          +                                         02/18/11

  10618            '<CustomerTransactionId>***Rate V9 Request usng VC#***</'  +                                         02/23/11

  10619            'CustomerTransactionId>'                                   +                                         03/03/11

  10620            '</TransactionDetail>'                                     +                                         02/18/11

  10621            '<Version>'                                                +                                         02/18/11

  10622            '<ServiceId>crs</ServiceId>'                               +                                         02/18/11

  10623            '<Major>9</Major>'                                         +                                         02/18/11

  10624            '<Intermediate>0</Intermediate>'                           +                                         02/18/11

  10625            '<Minor>0</Minor>'                                         +                                         02/18/11

  10626            '</Version>'                                               +                                         02/18/11

  10627            '<ReturnTransitAndCommit>true</ReturnTransitAndCommit>'    +                                         02/18/11

  10629            '<RequestedShipment>'                                      +                                         02/18/11

  10631            '<ServiceType>'+ %Trim(WDELEM) + '</ServiceType>'          +                                         02/24/11

  10632            '<PackagingType>YOUR_PACKAGING</PackagingType>'            +                                         02/23/11

  10633            '<TotalInsuredValue>'                                      +                                         02/18/11

  10634            '<Currency>USD</Currency>'                                 +                                         02/18/11

  10635            '</TotalInsuredValue>'                                     +                                         02/18/11

  10636            '<Shipper><Address>'                                       +                                         02/18/11

  10637            '<StreetLines>'+ %Trim(@FStreet) + '</StreetLines>'        +                                         02/24/11

  10638            '<City>' + %Trim(p01110.zpcty2) + '</City>'                +                                         02/24/11

  10639            '<StateOrProvinceCode>' + %Trim(p01110.zpsta2)             +                                         02/24/11

  10640            '</StateOrProvinceCode>'                                   +                                         02/23/11

  10641            '<PostalCode>'+ %Trim(p01110.zppst2)+ '</PostalCode>'      +                                         02/24/11

  10642            '<CountryCode>' + %Trim(p01110.zpcnt2) + '</CountryCode>'  +                                         02/24/11

  10643            '</Address>'                                               +                                         02/18/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    8

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10644            '</Shipper><Recipient><Address>'                           +                                         02/18/11

  10645            '<StreetLines>' + %Trim(@TStreet) +  '</StreetLines>'      +                                         02/24/11

  10646            '<City>' + %Trim(p01110.zpcty) + '</City>'                 +                                         02/24/11

  10647            '<StateOrProvinceCode>' + %Trim(p01110.zpsta)              +                                         02/24/11

  10648            '</StateOrProvinceCode>'                                   +                                         02/23/11

  10649            '<PostalCode>' + %Trim(p01110.zppstc)+ '</PostalCode>'     +                                         02/24/11

  10650            '<CountryCode>'+ %Trim(p01110.zpcnt) + '</CountryCode>'    +                                         02/24/11

  10651 60101      '<Residential>'+ @cnctyp + '</Residential>'                +                                         05/25/11

  10652            '</Address></Recipient>'                                   +                                         02/18/11

  10653            '<ShippingChargesPayment>'                                 +                                         02/18/11

  10654            '<PaymentType>SENDER</PaymentType>'                        +                                         02/18/11

  10655            '<Payor><AccountNumber>'+%Trim(WHCACC)+'</AccountNumber>'  +                                         02/23/11

  10656            '</Payor></ShippingChargesPayment>'                        +                                         04/14/11

  10657            '<SpecialServicesRequested>';                                                                        04/14/11

  10658                                                                                                                 04/20/11

  10659            @packSpService = *Off;                                                                               04/20/11

  10660            SetLL p0Shp# smlrate1;                                                                               04/06/11

  10661            DoU %Eof(smlrate1);                                                                                  04/06/11

  10662              ReadE(n) p0Shp# smlrate1;                                                                          04/06/11

  10663              If not %Eof(smlrate1);                                                                             04/06/11

  10664                 Chain (p0wscd:reatr:rechr) ospswsd;                                                             02/18/11

  10665                 If %Found (ospswsd) and wdspcl = 'Y';                                                           02/18/11

  10666                   @pOptArray = 0;                                                                               04/20/11

  10667                   @pOptArray = %lookup(wdelem:packageOption);                                                   04/20/11

  10668                   If @pOptArray <> 0;                                                                           04/20/11

  10669                     @packSpService = *On;                                                                       04/20/11

  10670                     Select;                                                                                     04/20/11

  10671                     When wdelem = 'SIGNATURE_OPTION';                                                           04/20/11

  10672                     postDataF = postDataF                     +                                                 04/20/11

  10673                     '<SpecialServiceTypes>' + %trim(WDELEM)   +                                                 04/20/11

  10674                     '</SpecialServiceTypes>'                  +                                                 04/20/11

  10675                     '<SignatureOptionDetail><OptionType>'     +                                                 04/20/11

  10676                     'ADULT</OptionType>'                      +                                                 04/20/11

  10677                     '</SignatureOptionDetail>';                                                                 04/20/11

  10678                     Other;                                                                                      04/20/11

  10679                     Endsl;                                                                                      04/20/11

  10680                   Else;                                                                                         04/20/11

  10686                     postDataB = postDataB                     +                                                 04/15/11

  10687                     '<SpecialServiceTypes>' + %trim(WDELEM)   +                                                 04/15/11

  10688                     '</SpecialServiceTypes>';                                                                   04/15/11

  10690                   EndIf;                                                                                        04/20/11

  10691                 EndIf;                                                                                          02/18/11

  10692              EndIf;                                                                                             02/18/11

  10693            EndDo;                                                                                               02/18/11

  10694                                                                                                                 02/18/11

  10695         // PostDataB = postDataB +                                                                              04/14/11

  10696            PostDataB = postDataB + '</SpecialServicesRequested>'      +                                         04/14/11

  10697            '<RateRequestTypes>ACCOUNT</RateRequestTypes>'             +                                         02/23/11

  10698            '<PackageCount>@@@</PackageCount>'                         +                                         02/22/11

  10699            '<PackageDetail>INDIVIDUAL_PACKAGES</PackageDetail>';                                                02/23/11

  10700                                                                                                                 04/05/11

  10701            If @FGrd = *On;                                                                                      04/05/11

  10702            @Counter = 0;                                                                                        02/23/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE    9

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10703            SetLL (p0Shp#:'2':whbase) smprate;                                                                   04/05/11

  10704            DoU %Eof(Smprate);                                                                                   02/23/11

  10705              ReadE(n) (p0Shp#:'2':whbase) smprate;                                                              03/29/11

  10706              If Not %Eof(smprate);                                                                              02/23/11

  10707                 postDataB = postDataB + '<RequestedPackageLineItems>'  +                                        02/23/11

  10708                 '<SequenceNumber>' + %Trim(%char(@Counter+1))          +                                        02/23/11

  10709                 '</SequenceNumber>'                                    +                                        02/23/11

  10710                 '<GroupNumber>' + %Trim(%char(%int(REPCE#*100)))       +                                        02/23/11

  10711                 '</GroupNumber>'                                       +                                        02/23/11

  10712                 '<InsuredValue><Currency>USD</Currency>'               +                                        02/23/11

  10713                 '</InsuredValue><Weight><Units>LB</Units>'             +                                        02/23/11

  10714                 '<Value>'+ %Trim(%char(%dech(REWGT:8:1)))              +                                        03/03/11

  10715                 '</Value></Weight>'                                    +                                        03/03/11

  10716                 '<Dimensions>'                                         +                                        02/23/11

  10717                 '<Length>' + %Trim(%char(%int(RELEN))) + '</Length>'   +                                        02/23/11

  10718                 '<Width>'  + %Trim(%char(%int(REWID))) + '</Width>'    +                                        02/23/11

  10719                 '<Height>' + %Trim(%char(%int(REHGT))) + '</Height>'   +                                        02/23/11

  10720                 '<Units>IN</Units></Dimensions>';                                                               04/20/11

  10721                 If @packSpService = *On;                                                                        04/20/11

  10722                   postDataB = postDataB                            +                                            04/20/11

  10723                               '<SpecialServicesRequested>'         +                                            04/20/11

  10724                               postDataF                            +                                            04/20/11

  10725                               '</SpecialServicesRequested>';                                                    04/20/11

  10728                 EndIf;                                                                                          04/20/11

  10729                 postDataB = postDataB + '</RequestedPackageLineItems>';                                         04/20/11

  10731                 @Counter += 1;                                                                                  02/23/11

  10732              EndIf;                                                                                             02/23/11

  10733            EndDo;                                                                                               02/23/11

  10734            Else;                                                                                                04/05/11

  10735              Chain(n)(p0Shp#:'2':whbase:@svpce#) smlrate1;                                                      04/06/11

  10736              If %Found(smlrate1);                                                                               04/06/11

  10737                 postDataB = postDataB + '<RequestedPackageLineItems>'  +                                        04/05/11

  10738                 '<SequenceNumber>1</SequenceNumber>'                   +                                        04/05/11

  10739                 '<GroupNumber>' + %Trim(%char(%int(REPCE#*100)))       +                                        04/05/11

  10740                 '</GroupNumber>'                                       +                                        04/05/11

  10741                 '<InsuredValue><Currency>USD</Currency>'               +                                        04/05/11

  10742                 '</InsuredValue><Weight><Units>LB</Units>'             +                                        04/05/11

  10743                 '<Value>'+ %Trim(%char(%dech(REWGT:8:1)))              +                                        04/05/11

  10744                 '</Value></Weight>'                                    +                                        04/05/11

  10745                 '<Dimensions>'                                         +                                        04/05/11

  10746                 '<Length>' + %Trim(%char(%int(RELEN))) + '</Length>'   +                                        04/05/11

  10747                 '<Width>'  + %Trim(%char(%int(REWID))) + '</Width>'    +                                        04/05/11

  10748                 '<Height>' + %Trim(%char(%int(REHGT))) + '</Height>'   +                                        04/05/11

  10749                 '<Units>IN</Units></Dimensions>'                       +                                        04/05/11

  10750                 '</RequestedPackageLineItems>';                                                                 04/05/11

  10751              EndIf;                                                                                             04/06/11

  10752            EndIf;                                                                                               04/05/11

  10753                                                                                                                 02/23/11

  10754         //            X M L  E N D    S E C T I O N                                                             04/07/11

  10755         //-----------------------------------------------------------//                                         04/07/11

  10756            PostDataE = '</RequestedShipment>'                          +                                        02/23/11

  10757            '</RateRequest>'                                            +                                        02/23/11

  10758            '</soap:Body>'                                              +                                        02/22/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   10

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  10759            '</soap:Envelope>';                                                                                  02/22/11

  10760                                                                                                                 04/05/11

  10761              PostDataB = %replace(%char(@counter):postDataB:                                                    04/05/11

  10762                        %scan('@@@':postDataB):3);                                                               02/22/11

  10763                                                                                                                 04/05/11

  10764            PostData = %trim(PostDataH) + %trim(PostDataB) + %Trim(PostDataE);                                   02/22/11

  10765          //@Length = %len(%trim(postData));                                                                     04/06/11

  12900          EndSr;                                                                                                 02/24/11

  12901                                                                                                                 04/07/11

  12902        //------------------------------------------------------------//                                         04/07/11

  12903        //            Subroutine - sbCallWebSrv                       //                                         04/07/11

  12904        //------------------------------------------------------------//                                         04/07/11

  12905          BegSr sbCallWebSrv;                                                                                    02/24/11

  12909                                                                                                                 03/03/11

  13501              rc = http_url_post_xml( %trim(whrsu2)                                                              03/03/11

  13503                 : %addr(postData) + 2                                                                           03/03/11

  13504                 : %len(postData)                                                                                03/03/11

  13505                 : %paddr(StartOfElement)                                                                        03/03/11

  13506                 : %paddr(EndOfElement)                                                                          03/03/11

  13507                 : *NULL );                                                                                      03/03/11

  13508                                                                                                                 02/18/11

  13600            If (rc <> 1);                                                                                        02/24/11

  13801              @ErrFlag = *On;                                                                                    03/28/11

  13802              If rc = -1;                                                                                        04/07/11

  13803                @ErrWeb = *On;                                                                                   04/07/11

  13804              EndIf;                                                                                             04/07/11

  14100            Endif;                                                                                               03/28/11

  14101                                                                                                                 02/22/11

  14200           EndSr;                                                                                                02/24/11

  17800                                                                                                                 09/23/06

  18001        //------------------------------------------------------------//                                         04/07/11

  18002        //            sbUpdRateFile -Update Rate File                 //                                         04/07/11

  18003        //------------------------------------------------------------//                                         04/07/11

  18004        BegSr sbUpdRateFile;                                                                                     02/25/11

  18005                                                                                                                 02/25/11

  18006        //Error if first entry of package array is blank or zero                                                 03/30/11

  18008        //--------------------------------------------------------------                                         04/07/11

  18009          If package.pid(1) = *blanks or                                                                         03/30/11

  18010             package.pid(1) = '0';                                                                               03/30/11

  18011             @ErrFlag = *On;                                                                                     03/30/11

  18012             LeaveSr;                                                                                            03/30/11

  18013          EndIf;                                                                                                 03/30/11

  18014                                                                                                                 03/30/11

  18015        //- Populate base charge in SMPRATE from the array                                                       04/07/11

  18016        //--------------------------------------------------------------                                         04/07/11

  18017                                                                                                                 03/30/11

  18018          @n = 1;                                                                                                02/25/11

  18020          DoU package.pid(@n) = ' ';                                                                             02/25/11

  18021            @pId  = %int(package.pid(@n))/100;                                                                   03/03/11

  18034                Chain (p0Shp#:'2':whbase:@PId) smlrate1;                                                         04/07/11

  18035                If %Found(smlrate1);                                                                             04/07/11

  18036                   rechr$ = %dec(package.pAmount(@n):11:2);                                                      04/07/11

  18037                   Update rlrate1;                                                                               04/07/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   11

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  18038                EndIf;                                                                                           04/07/11

  18041            @n += 1;                                                                                             02/25/11

  18042          EndDo;                                                                                                 02/25/11

  18043                                                                                                                 02/25/11

  18044        //- Populate Surcharges in SMPRATE from the array                                                        04/06/11

  18045        //--------------------------------------------------------------                                         04/07/11

  18046                                                                                                                 04/06/11

  18065          @n = 1;                                                                                                04/06/11

  18068                                                                                                                 04/06/11

  18069          Dou surcharge.stype(@n) = ' ';                                                                         02/25/11

  18076                                                                                                                 04/06/11

  18080          // 1. Get number of pieces from the corresponding base charge                                          04/07/11

  18081          //----------------------------------------------------------------                                     04/07/11

  18089              @TotPcs = 0 ;                                                                                      04/05/11

  18090              If surcharge.sid(@n) <> *Zero;                                                                     04/07/11

  18091                 repce# = surcharge.sid(@n)/100;                                                                 04/06/11

  18092                 Chain(n) (p0Shp#:'2':whbase:repce#) smlrate1;                                                   04/06/11

  18093                 If %Found(smlrate1);                                                                            04/07/11

  18094                   If reocr = 0;                                                                                 04/06/11

  18095                     @Totpcs = 1;                                                                                04/06/11

  18096                   Else;                                                                                         04/06/11

  18097                     @Totpcs = reocr;                                                                            04/06/11

  18098                   EndIf;                                                                                        04/07/11

  18099                 EndIf;                                                                                          04/07/11

  18100              EndIf;                                                                                             04/06/11

  18101                                                                                                                 04/07/11

  18102            // 2. Update the file                                                                                04/07/11

  18103            //--------------------------------------------------------                                           04/06/11

  18104                                                                                                                 04/06/11

  18105            Chain (p0wscd:surcharge.stype(@n)) oslswsdb;                                                         04/05/11

  18106            If %Found(oslswsdb);                                                                                 04/05/11

  18107              Chain (p0Shp#:wdatr:wdchr) smprate;                                                                04/05/11

  18108              If %Found(smprate);                                                                                04/05/11

  18109                 rechr$ += %dec(surcharge.sAmount(@n):11:2) * @Totpcs;                                           04/07/11

  18110                 update rprate;                                                                                  04/05/11

  18111              EndIf;                                                                                             04/05/11

  18112            EndIf;                                                                                               04/05/11

  18114            @n +=1;                                                                                              04/05/11

  18115          EndDo;                                                                                                 02/25/11

  18116                                                                                                                 02/25/11

  18117        //- Get the Total Sum of charges and pass back to rating engine                                          04/07/11

  18118        //  (Required for Rateshop)                                                                              04/07/11

  18119        //----------------------------------------------------------------                                       03/18/11

  18120            @cTotal = 0;                                                                                         04/07/11

  18121            Setll p0Shp# smprate ;                                                                               04/07/11

  18122            ReadE(n) p0Shp# smprate ;                                                                            04/07/11

  18123            DoW Not %Eof(smprate );                                                                              04/07/11

  18124              if reocr = 0;                                                                                      04/07/11

  18125               @cTotal += rechr$;                                                                                04/07/11

  18126              Else;                                                                                              04/07/11

  18127               @cTotal += rechr$ * reocr;                                                                        04/07/11

  18128              EndIf;                                                                                             04/07/11

  18129              ReadE(n) p0Shp# smprate;                                                                           04/07/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   12

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  18130            EndDo;                                                                                               04/07/11

  18131            p0chr$ = @cTotal;                                                                                    04/07/11

  18132                                                                                                                 03/18/11

  18133                                                                                                                 04/06/11

  18134        //- Update SMPRATI (Only if update mode is *on)                                                          04/07/11

  18135        //--------------------------------------------------------------                                         04/07/11

  18136          If p0mode = '1';                                                                                       04/07/11

  18137                                                                                                                 04/06/11

  18138            Setll (p0Shp#) smprate;                                                                              03/18/11

  18139            ReadE(n) p0Shp# smprate;                                                                             03/29/11

  18140            DoW Not %Eof(smprate);                                                                               03/18/11

  18141              SetLL (reShp#:reseq:rechr:repce#) smlrati4;                                                        03/18/11

  18142              DoU %Eof(smlrati4);                                                                                03/18/11

  18143                ReadE (reShp#:reseq:rechr:repce#) smlrati4;                                                      03/18/11

  18144                If  Not %Eof(smlrati4);                                                                          03/18/11

  18154                    If reocr = 0;                                                                                04/07/11

  18155                      richr$ = rechr$;                                                                           04/07/11

  18156                    Else;                                                                                        04/07/11

  18157                      richr$ = rechr$ * reocr;                                                                   04/07/11

  18158                    EndIf;                                                                                       04/07/11

  18159                    update rprati;                                                                               03/18/11

  18161                EndIf;                                                                                           03/18/11

  18162              EndDo;                                                                                             03/18/11

  18163              ReadE(n) p0Shp# smprate;                                                                           03/29/11

  18164            EndDo;                                                                                               03/18/11

  18165                                                                                                                 04/06/11

  18166          EndIf;                                                                                                 04/07/11

  18167                                                                                                                 03/18/11

  18168                                                                                                                 03/18/11

  18169                                                                                                                 03/18/11

  18170        //- Delete SMPRATE                                                                                       03/02/11

  18171        //--------------------------------------------------------------                                         04/07/11

  18172          Setll (p0Shp#) smprate;                                                                                03/18/11

  18173          ReadE p0Shp# smprate;                                                                                  03/18/11

  18174          doW Not %Eof(smprate);                                                                                 03/01/11

  18175             Delete rprate;                                                                                      03/18/11

  18176             ReadE p0Shp# smprate;                                                                               03/18/11

  18177          Enddo;                                                                                                 02/28/11

  18178                                                                                                                 02/28/11

  18179        EndSr;                                                                                                   02/25/11

  18180                                                                                                                 03/03/11

  18181        //------------------------------------------------------------//                                         04/07/11

  18182        //            Generic Error Handler                           //                                         04/07/11

  18183        //------------------------------------------------------------//                                         04/07/11

  18184        BegSr *PSSR;                                                                                             03/03/11

  18185           p0RtnCd = 'E';                                                                                        03/03/11

  18186        EndSr;                                                                                                   03/03/11

  18187                                                                                                                 03/03/11

  18188       /end-free                                                                                                 02/25/11

  18189         //-----------------------------------------------------------//                                         04/07/11

  18190         //           Procedures - Start of Element                   //                                         04/07/11

  18191         //-----------------------------------------------------------//                                         04/07/11

  18192                                                                                                                 09/23/06

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   13

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  18200      P StartOfElement  B                                                                                        09/23/06

  18300      D StartOfElement  PI                                                                                       09/23/06

  18400      D   UserData                      *   value                                                                09/23/06

  18500      D   depth                       10I 0 value                                                                09/23/06

  18600      D   name                      1024A   varying const                                                        09/23/06

  18700      D   path                     24576A   varying const                                                        09/23/06

  18800      D   attrs                         *   dim(32767)                                                           09/23/06

  18900      D                                     const options(*varsize)                                              09/23/06

  19000       /free                                                                                                     09/23/06

  19500                                                                                                                 09/23/06

  19501         If @Fgrd = *Off and tCount > 1;                                                                         04/07/11

  19502            Return;                                                                                              04/07/11

  19503         EndIf;                                                                                                  04/07/11

  19504        //*------------------------------------------------------------*                                         04/07/11

  19505        //              Path for surcharges (Non-Ground)                                                         04/07/11

  19506        //*------------------------------------------------------------*                                         04/07/11

  19507         pstr1 = '/soapenv:Envelope/soapenv:Body/'     + %Trim(@v) +                                             02/25/11

  19508                 'RateReply/'                          + %Trim(@v) +                                             02/25/11

  19509                 'RateReplyDetails/'                   + %Trim(@v) +                                             02/25/11

  19510                 'RatedShipmentDetails/'               + %Trim(@v) +                                             02/25/11

  19511                 'ShipmentRateDetail/'                 + %Trim(@v) +                                             02/25/11

  19512                 'Surcharges';                                                                                   02/25/11

  19513        //*------------------------------------------------------------*                                         04/07/11

  19514        //              Path for surcharges (Ground)                                                             04/07/11

  19515        //*------------------------------------------------------------*                                         04/07/11

  19516         pStr9 = '/soapenv:Envelope/soapenv:Body/'     + %Trim(@v) +                                             04/07/11

  19517                 'RateReply/'                          + %Trim(@v) +                                             04/07/11

  19518                 'RateReplyDetails/'                   + %Trim(@v) +                                             04/07/11

  19519                 'RatedShipmentDetails/'               + %Trim(@v) +                                             04/07/11

  19520                 'RatedPackages/'                      + %Trim(@v) +                                             04/07/11

  19521                 'PackageRateDetail/'                  + %Trim(@v) +                                             04/07/11

  19522                 'Surcharges';                                                                                   04/07/11

  19524        //*------------------------------------------------------------*                                         04/07/11

  19525        //              Path for Gourp Number (Fedex-Ground)                                                     04/07/11

  19526        //*------------------------------------------------------------*                                         04/07/11

  19527         pstr2 = '/soapenv:Envelope/soapenv:Body/'     + %Trim(@v) +                                             02/25/11

  19528                 'RateReply/'                          + %Trim(@v) +                                             02/25/11

  19529                 'RateReplyDetails/'                   + %Trim(@v) +                                             02/25/11

  19530                 'RatedShipmentDetails/'               + %Trim(@v) +                                             02/25/11

  19531                 'RatedPackages';                                                                                02/25/11

  19532        //*------------------------------------------------------------*                                         04/07/11

  19533        //              Path for RateType (Non-Ground)                                                           04/07/11

  19534        //*------------------------------------------------------------*                                         04/07/11

  19535         pstr7 = '/soapenv:Envelope/soapenv:Body/'     + %Trim(@v) +                                             04/07/11

  19536                 'RateReply/'                          + %Trim(@v) +                                             04/07/11

  19537                 'RateReplyDetails/'                   + %Trim(@v) +                                             04/07/11

  19538                 'RatedShipmentDetails/'               + %Trim(@v) +                                             04/07/11

  19539                 'ShipmentRateDetail';                                                                           04/07/11

  19541                                                                                                                 04/07/11

  19542        //FedEx Ground                                                                                           04/07/11

  19543        //--------------------------------------------------------------                                         04/07/11

  19545         If @Fgrd = *On;                                                                                         04/07/11

  19546           Select;                                                                                               04/07/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   14

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  19547           When path = pstr9 and name = %trim(@v)+'SurchargeType';                                               04/07/11

  19548               sCount = sCount + 1;                                                                              02/22/11

  19549           When path = pstr2 and name = %Trim(@v)+'GroupNumber';                                                 04/07/11

  19550               pCount = pCount + 1;                                                                              04/07/11

  19551           EndSl;                                                                                                04/07/11

  19552                                                                                                                 04/07/11

  19553         //FedEx Non-Ground (e.g. 2 Day Express)                                                                 04/07/11

  19554         //-------------------------------------------------------------                                         04/07/11

  19555         Else;                                                                                                   04/07/11

  19556           Select;                                                                                               04/07/11

  19557           When path = pstr1 and name = %trim(@v)+'SurchargeType';                                               04/07/11

  19558               sCount = sCount + 1;                                                                              04/07/11

  19559           When path = pstr7 and name = %trim(@v)+'RateType';                                                    04/07/11

  19560               tCount += 1;                                                                                      04/07/11

  19561           EndSl;                                                                                                04/07/11

  19562         EndIf;                                                                                                  04/07/11

  19600       /end-free                                                                                                 09/23/06

  19700      P                 E                                                                                        09/23/06

  19800                                                                                                                 09/23/06

  19801         //-----------------------------------------------------------//                                         04/07/11

  19802         //           Procedures - End of Element                     //                                         04/07/11

  19803         //-----------------------------------------------------------//                                         04/07/11

  19900                                                                                                                 09/23/06

  20000      P EndOfElement    B                                                                                        09/23/06

  20100      D EndOfElement    PI                                                                                       09/23/06

  20200      D   UserData                      *   value                                                                09/23/06

  20300      D   depth                       10I 0 value                                                                09/23/06

  20400      D   name                      1024A   varying const                                                        09/23/06

  20500      D   path                     24576A   varying const                                                        09/23/06

  20600      D   value                    65535A   varying const                                                        09/12/07

  20700      D   attrs                         *   dim(32767)                                                           09/23/06

  20800      D                                     const options(*varsize)                                              09/23/06

  20900       /free                                                                                                     09/23/06

  20901                                                                                                                 02/25/11

  20902        If @Fgrd = *Off and tCount > 1;                                                                          04/07/11

  20903           Return;                                                                                               04/07/11

  20904        EndIf;                                                                                                   04/07/11

  20905                                                                                                                 04/07/11

  20906        //*------------------------------------------------------------*                                         04/07/11

  20907        //              Path for SUCCESS!!!                                                                      04/07/11

  20908        //*------------------------------------------------------------*                                         04/07/11

  20909        pstrS = '/soapenv:Envelope/soapenv:Body/'      + %Trim(@v) +                                             04/07/11

  20910                  'RateReply/'                         + %Trim(@v) +                                             04/07/11

  20911                  'Notifications';                                                                               03/04/11

  20912        //-------------------------------------------------------------*                                         04/07/11

  20913        //              Path for surcharges (Non -Ground)                                                        04/07/11

  20914        //-------------------------------------------------------------*                                         04/07/11

  20915        pstr3 = '/soapenv:Envelope/soapenv:Body/'       + %Trim(@v) +                                            04/07/11

  20916                'RateReply/'                            + %Trim(@v) +                                            04/07/11

  20917                'RateReplyDetails/'                     + %Trim(@v) +                                            04/07/11

  20918                'RatedShipmentDetails/'                 + %Trim(@v) +                                            04/07/11

  20919                'ShipmentRateDetail/'                   + %Trim(@v) +                                            04/07/11

  20920                'Surcharges';                                                                                    02/25/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   15

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  20921        //-------------------------------------------------------------*                                         04/07/11

  20922        //    Path for Base Charges(Shipment Level:Non FEDEX_GROUND)                                             04/07/11

  20923        //-------------------------------------------------------------*                                         04/07/11

  20924        pstr4 = '/soapenv:Envelope/soapenv:Body/'       + %Trim(@v) +                                            04/07/11

  20925                'RateReply/'                            + %Trim(@v) +                                            04/07/11

  20926                'RateReplyDetails/'                     + %Trim(@v) +                                            04/07/11

  20927                'RatedShipmentDetails/'                 + %Trim(@v) +                                            04/07/11

  20928                'ShipmentRateDetail/'                   + %Trim(@v) +                                            04/07/11

  20929                'TotalBaseCharge';                                                                               02/25/11

  20930        //-------------------------------------------------------------*                                         04/07/11

  20931        //       Path for Group Number (FEDEX_GROUND only)                                                       04/07/11

  20932        //-------------------------------------------------------------*                                         04/07/11

  20933        pStr5 = '/soapenv:Envelope/soapenv:Body/'       + %Trim(@v) +                                            04/07/11

  20934                'RateReply/'                            + %Trim(@v) +                                            04/07/11

  20935                'RateReplyDetails/'                     + %Trim(@v) +                                            04/07/11

  20936                'RatedShipmentDetails/'                 + %Trim(@v) +                                            04/07/11

  20937                'RatedPackages';                                                                                 02/25/11

  20938        //-------------------------------------------------------------*                                         04/07/11

  20939        //          Path for Base Charge (FEDEX_GROUND only)                                                     04/07/11

  20940        //-------------------------------------------------------------*                                         04/07/11

  20941        pStr6 = '/soapenv:Envelope/soapenv:Body/'       + %Trim(@v) +                                            04/07/11

  20942                'RateReply/'                            + %Trim(@v) +                                            04/07/11

  20943                'RateReplyDetails/'                     + %Trim(@v) +                                            04/07/11

  20944                'RatedShipmentDetails/'                 + %Trim(@v) +                                            04/07/11

  20945                'RatedPackages/'                        + %Trim(@v) +                                            04/07/11

  20946                'PackageRateDetail/'                    + %Trim(@v) +                                            04/07/11

  20947                'BaseCharge';                                                                                    02/25/11

  20948        //-------------------------------------------------------------*                                         04/07/11

  20949        //              Path for surcharges (Ground)                                                             04/07/11

  20950        //-------------------------------------------------------------*                                         04/07/11

  20951        pStr8 = '/soapenv:Envelope/soapenv:Body/'       + %Trim(@v) +                                            04/07/11

  20952                'RateReply/'                            + %Trim(@v) +                                            04/07/11

  20953                'RateReplyDetails/'                     + %Trim(@v) +                                            04/07/11

  20954                'RatedShipmentDetails/'                 + %Trim(@v) +                                            04/07/11

  20955                'RatedPackages/'                        + %Trim(@v) +                                            04/07/11

  20956                'PackageRateDetail/'                    + %Trim(@v) +                                            04/07/11

  20957                'Surcharges';                                                                                    04/07/11

  20960                                                                                                                 04/07/11

  20961        //Error Checking  (Applicable for all services)                                                          04/07/11

  20962        //--------------------------------------------------------------                                         04/07/11

  21001         If path = pstrS;                                                                                        04/07/11

  21002           If name = %Trim(@v)+'Severity';                                                                       04/07/11

  21003              If value <> 'SUCCESS' and                                                                          04/07/11

  21004                 value <> 'NOTE';                                                                                04/07/11

  21005                @ErrFlag = *on;                                                                                  04/07/11

  21006              EndIf;                                                                                             04/07/11

  21007           EndIf;                                                                                                04/07/11

  21008           //If name = %Trim(@v)+'Code';                                                                         04/11/11

  21009           //   If value = '403' or value = '417' or value='200' or                                              04/11/11

  21010           //      value = '0105';                                                                               04/11/11

  21011           //     @ErrWeb = *on;                                                                                 04/11/11

  21012           //   EndIf;                                                                                           04/11/11

  21013           //EndIf;                                                                                              04/11/11

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   16

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  21014           If @ErrFlag = *On;                                                                                    04/11/11

  21015             If name = %Trim(@v) + 'Message';                                                                    04/11/11

  21017               p0msgtxt = %Trim(value);                                                                          04/11/11

  21018             EndIf;                                                                                              04/11/11

  21019           EndIf;                                                                                                04/11/11

  21020         EndIf;                                                                                                  04/07/11

  21021                                                                                                                 04/07/11

  21022        //FedEx Ground Only                                                                                      04/07/11

  21023        //--------------------------------------------------------------                                         04/07/11

  21024         If @Fgrd = *On;                                                                                         04/07/11

  21025           Select;                                                                                               04/07/11

  21026           When path = pstr8;                                                                                    04/07/11

  21027              If name = %Trim(@v)+'SurchargeType';                                                               04/07/11

  21028                  surcharge.sid(sCount)   = %dec(package.pid(pCount):4:0);                                       04/07/11

  21029                  surcharge.stype(sCount) = value;                                                               04/07/11

  21030              EndIf;                                                                                             04/07/11

  21031           When path = %Trim(pstr8) + '/' + %Trim(@v) + 'Amount';                                                04/07/11

  21032              If name = %Trim(@v)+ 'Amount';                                                                     04/07/11

  21033                surcharge.samount(sCount) = value;                                                               04/07/11

  21034              EndIf;                                                                                             04/07/11

  21035           When path = pStr5;                                                                                    04/07/11

  21036              If name = %Trim(@v)+'GroupNumber';                                                                 04/07/11

  21037                 package.pid(pCount) = value;                                                                    04/07/11

  21038              EndIf;                                                                                             04/07/11

  21039           When path = pStr6;                                                                                    04/07/11

  21040              if name = %Trim(@v) + 'Amount';                                                                    04/07/11

  21041                package.pAmount(pCount) = value;                                                                 04/07/11

  21042              EndIf;                                                                                             04/07/11

  21043           EndSl;                                                                                                04/07/11

  21044                                                                                                                 04/07/11

  21045        //FedEx Non Ground                                                                                       04/07/11

  21046        //--------------------------------------------------------------                                         04/07/11

  21047         Else;                                                                                                   04/07/11

  21048           Select;                                                                                               04/07/11

  21049           When path = pstr3;                                                                                    04/07/11

  21050              If name = %Trim(@v)+'SurchargeType';                                                               04/07/11

  21051                  surcharge.sid(sCount) = @svpce# * 100;                                                         04/07/11

  21052                  surcharge.stype(sCount) = value;                                                               04/07/11

  21053              EndIf;                                                                                             04/07/11

  21054           When path = %Trim(pstr3) + '/' + %Trim(@v) + 'Amount';                                                04/07/11

  21055              If name = %Trim(@v)+ 'Amount';                                                                     04/07/11

  21056                surcharge.samount(sCount) = value;                                                               04/07/11

  21057              EndIf;                                                                                             04/07/11

  21058           When path = pStr4;                                                                                    04/07/11

  21059              If name = %Trim(@v) + 'Amount';                                                                    04/07/11

  21060                 package.pid(pCount) = %char(@svpce# * 100);                                                     04/07/11

  21061                 package.pamount(pCount) = value;                                                                04/07/11

  21062              EndIf;                                                                                             04/07/11

  21063           EndSl;                                                                                                04/07/11

  21064         EndIf;                                                                                                  04/07/11

  21065                                                                                                                 04/07/11

  25000       /end-free                                                                                                 09/23/06

  25100      P                 E                                                                                        09/23/06

  5761WDS V6R1M0  080215                  SEU SOURCE LISTING                            05/08/12 12:19:37    TMSODEV      PAGE   17

  SOURCE FILE . . . . . . .  OS60RLPT1/QRPGLESRC

  MEMBER  . . . . . . . . .  OSR119FX

  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0

  25200 **CTDATA packageOption                                                                                          04/20/11

  25300 SIGNATURE_OPTION                                                                                                04/20/11

  25400 APPOINTMENT_DELIVERY                                                                                            04/20/11

  25500 NON_STANDARD_CONTAINER                                                                                          04/20/11

  25600 PRIORITY_ALERT                                                                                                  04/20/11

                                  * * * *  E N D  O F  S O U R C E  * * * *

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------