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

RE: FedEx API Using RPG



Eric,

We have an internal Fedex server that does the estimated shipping charges.
It uses a FedEx service program called WEBAPICS that they provided.
However, we do track shipments through FedEx, so maybe that will help.

// set up the soap request                                         
Soap='<soapenv:Envelope +                                          
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; +
        xmlns:v2="http://fedex.com/ws/track/v2";> +                 
                                                                   
<soapenv:Header/> +                                          
                                                                   
 <soapenv:Body> +                                            
                                                                   
  <v2:TrackRequest> +                                        
                                                                   
    <v2:WebAuthenticationDetail> +                            
     <v2:UserCredential> +                                    
      <v2:Key>xxxxx</v2:Key> +                     
      <v2:Password>xxxx</v2:Password> +  
     </v2:UserCredential> +                                   
    </v2:WebAuthenticationDetail> +                           
                                                   
 <v2:ClientDetail> +                               
  <v2:AccountNumber>123</v2:AccountNumber> + 
  <v2:MeterNumber>123</v2:MeterNumber> +     
 </v2:ClientDetail> +                              
                                                   
 <v2:Version> +                                    
  <v2:ServiceId>trck</v2:ServiceId> +              
  <v2:Major>2</v2:Major> +                         
  <v2:Intermediate>0</v2:Intermediate> +           
  <v2:Minor>0</v2:Minor> +                         
 </v2:Version> +                                     
                                                        
 <v2:PackageIdentifier> +                            
  <v2:Value>' + %Trim(TrackNumber) + '</v2:Value> +  
  <v2:Type>TRACKING_NUMBER_OR_DOORTAG</v2:Type> +    
 </v2:PackageIdentifier> +                           
                                                        
 <v2:ShipmentAccountNumber>'+                        
  FedXCompany +                                      
 </v2:ShipmentAccountNumber>+                       
                                                        
 </v2:TrackRequest> +                                 
                                                        
</soapenv:Body> +                                     
                                                        
</soapenv:Envelope>';                                  

// post soap service to Fed Ex (ParseXML parses information) 
RC = Http_Url_Post_Xml( 'https://gateway.fedex.com:443/+     
                         web-services'                       
                       : %Addr(SOAP) + 2                     
                       : %Len(SOAP)                          
                       : *NULL                               
                       : %PAddr(ParseXML)                    
                       : %Addr(RESP)                         
                       : HTTP_TIMEOUT                        
                       : HTTP_USERAGENT                      
                       : 'text/xml;charset=UTF-8'            
                       : '"track"');                         
P ParseXML        B                                            
                                                                
 D ParseXML        PI                                           
 D   Save                          *   Value                    
 D   Depth                       10I 0 Value                    
 D   Name                      1024A   Varying Const            
 D   Path                     24576A   Varying Const            
 D   Value                    32767A   Varying Const            
 D   Attrs                         *   Dim(32767)               
 D                                     const options(*varsize)  
                                                                
  /Free                                                         
                                                                
   If Name = 'v2:Severity';                                     
    Severity = Value;                                           
   Endif;                                                       
                                         
  If Name = 'v2:ActualDeliveryTimestamp';
   Delivery = Value;                     
  Endif;                                 
                                         
 /End-Free                               
                                         
P                 E                                                                              

Hth,

Craig 

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Eric Hill
Sent: Tuesday, March 26, 2013 9:36 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: FedEx API Using RPG

I have set up an RPG program using HTTPAPI and using Scott's example to contact UPS to return an estimated shipping charge for a shipment.  I would now like to do the same thing with FedEx but am having trouble deciphering their manual.  Does anyone have any example code for the FedEx XML input and output for just a rate inquiry or any inquiry using the FedEx API.

 

Thanks!!!!

 


Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.  Unless expressly stated in this e-mail, nothing in this message or any attachment should be construed as a digital or electronic signature.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------