Date:  10/30/2012 04:27:22 PM Msg ID:  004554
From:  Ali Koumaiha Thread:  004548
Subject:  Re: FedEx Shipping Code
Here is the code:

i pass 3 parameters to my procedure in my class.
returns a cursor for me.
i use the west-wind wwHTTP class for posting the URL and consuming the services back.

its 25$ for 10,000 hits from Auction Inc

 PROCEDURE GetShipRate(tcState,tcZipCode,tnAmount)

  lcKey = 'blablablabla' && You need your OWN API Key.

  TEXT TO lcXML TEXTMERGE NOSHOW
   <?xml version="2.1" encoding="utf-8" ?>
    <Envelope>
     <Header>     
      <AccountId><<lcKey>></AccountId>
     </Header>
     <Body>     
      <GetItemShipRateSS version="2.1">     
       <DetailLevel>1</DetailLevel>     
       <Currency>USD</Currency>           
       <DestinationAddress>           
        <ResidentialDelivery>true</ResidentialDelivery>           
        <CountryCode>US</CountryCode>           
        <PostalCode><<tcZipcode>></PostalCode>           
        <StateOrProvinceCode><<tcState>></StateOrProvinceCode >     
       </DestinationAddress>   
       <ItemList>      
        <Item>            
         <RefCode>TotalMobiel Shipping</RefCode>            
         <Quantity>1</Quantity>            
         <CalcMethod code="C">                  
          <CarrierCalcProps>                                                      
          <Weight>2</Weight>                        
          <WeightUOM>LBS</WeightUOM>                        
          <DeclaredValue><<TRANSFORM(tnAmount)>></DeclaredValue>                        
          <PackMethod>T</PackMethod>                  
         </CarrierCalcProps>            
         </CalcMethod>      
        </Item>   
       </ItemList>
      </GetItemShipRateSS>
     </Body>
    </Envelope>
  ENDTEXT  
  IF TYPE('loHTTP') <> 'O'
   loHTTP = CREATEOBJECT("wwHTTP")
  ENDIF
  lcRateScript = "http://api.auctioninc.com/websvc/shire"
  loHTTP.AddPostKey(lcXML)
  lcHTML = loHTTP.HTTPGet(lcRateScript)
  IF NOT EMPTY(loHttp.cErrorMsg)
   oPortal.IEMessagebox('error: ' + loHttp.cerrorMsg)
   RETURN ""
  ENDIF
  
  lcCursorShip = SYS(2015)
  CREATE CURSOR (lcCursorShip) (ShipMethod c(6), ShipDesc C(50), ShipRate N(10,2), Active L)
  FOR x = 1 TO OCCURS('<ServiceName>',lcHTML)
   lcShipping = STREXTRACT(lcHTML,'<ServiceCode>','</ServiceCode>',x)
   lcService = STREXTRACT(lcHTML,'<ServiceName>','</ServiceName>',x)
   lcRate  = STREXTRACT(lcHTML,'<Rate>','</Rate>',x)
   SELECT (lcCursorShip)
   APPEND BLANK
   REPLACE ShipMethod WITH lcShipping,;
    ShipDesc WITH lcService,;
    ShipRate WITH VAL(lcRate),;
    active WITH .t.
  ENDFOR   
  RETURN (lcCursorShip)
 
 
 EndProc

Sent by Joe Goldsmiith on 10/30/2012 10:43:18 AM:
 Hi Ali. Thanks for writing.
Yes, I would appreciate the code, thanks for asking. I would be happy to purchase it from you if you wish.
Joe
Sent by Ali Koumaiha on 10/30/2012 10:19:17 AM:
Joe,

i use AuctionInc for rates. very very easy to use.

if you need codes that i have written to get rates, let me know.
http://www.auctioninc.com/
Sent by Joe Goldsmiith on 10/30/2012 06:24:59 AM:
 Hello to all.
I'm with a laser manufacturing company and have written all of our back end code. There is a need to gather FedEx shipping rates for quotes. It seems that FedEx changed the way rates were gathered in March of 2012. If anyone has some FedEx rate code they wish to share or sell I would appreciate it.
Joe